>From Stack >Overflow:<http://stackoverflow.com/questions/12532757/php-example-of-the-heroku-json-rest-api>
$ch = curl_init( ); curl_setopt( $ch, CURLOPT_URL, 'https://api.heroku.com/apps/myapp/ps'); curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true); curl_setopt( $ch, CURLOPT_USERPWD, ":yesthisismyrealapikeyanditworks"); return curl_exec($ch); This works. On Thursday, September 20, 2012 9:34:22 PM UTC-5, Dave wrote: > > I'm trying to get the app process status with the REST API and am having a > bit of trouble getting it to return good data > > $ch = curl_init( ); > > curl_setopt( $ch, CURLOPT_URL, 'https://api.heroku.com'); // No > clue what to put here. > curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true); > curl_setopt( $ch, CURLOPT_USERPWD, > ":yesthisismyrealapikeyanditworks"); // trust me on this line :) > curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Accept: > application/json', 'Content-Type: application/json')); //total guess > curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET'); > curl_setopt( $ch, CURLOPT_POSTFIELDS, ' > https://api.heroku.com/apps/myapp/ps'); // where myapp is actually my > app name > > // Getting results > return curl_exec($ch); > > This hasn't returned anything useful. I'm new to JSON and curl, so go easy > on me please. Thanks. > > Dave > -- You received this message because you are subscribed to the Google Groups "Heroku" group. To unsubscribe from this group, send email to heroku+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/heroku?hl=en_US?hl=en