I'm having some trouble accessing API endpoints using a valid token that I just got from the OAuth process.
I'm passing data as I think I should and am trying to access any endpoint at this point (Actually, I need to create a case, but even getting
/limits to work would be nice)
$url = $domain . '/services/data/v34.0/sobjects/limits'; $curl = curl_init($url); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HTTPHEADER, array("Authorization: OAuth $token", "Content-type: application/json")); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, ''); return curl_exec($curl);
My developer instance is at
na16.salesforce.com and if I understand it correctly, I need to be using that domain for my API calls.
I feel like maybe I'm just missing an extra header item that I need to send or something, but I'm having no luck finding what that needs to be.
Perhaps I need to create some kind of session first? Either way, I'm having no luck figuring out what that is after a whole lot of searching.
The code above is the entirely of my call to the API. What is missing here?