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
1 Answer