Just point your REST call to this file and it will store it to a file. Just change $file to whatever file you would like, currently set to request.json. Also remember to chmod that file so it's writable.