Skip to Content
avatar image
Former Member

Issue getting the OAuth request & access token for accessing OData API

Hi,

I am facing issues getting the OAuth access token from SAP Jam. I checked the following link for the steps

http://help.sap.com/download/documentation/sapjam/developer/#d89d05047eb04755ab29312b65497832.html

http://help.sap.com/download/documentation/sapjam/developer/#1ef715a906cb494080f53ef9a819458d.html

As per the information in the above links I tried to fetch the request token (oauth/request_token) but not able to get the request token.

Below is my code snippet used to get the request token:

$data = array(
    'oauth_consumer_key' => '<<consumer_key>>', 
    'oauth_signature' => 'mdGRoILktVrGG6bvB%2FJd4hK0jSo%3D',
    'oauth_signature_method' => 'HMAC-SHA1',
    'oauth_nonce' => '"y-s52YCzMQ',
    'oauth_version' => '1.0',                 
    'oauth_timestamp' => '1316126857',                 
    'oauth_callback' => 'oob',
);
$curl = curl_init(); 

curl_setopt_array($curl, array( 
CURLOPT_RETURNTRANSFER => 1,     
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
      'Content-Type: application/x-www-form-urlencoded',
)), 
CURLOPT_URL => 'https://developer.sapjam.com/oauth/request_token"',
CURLOPT_USERAGENT => 'Codular Sample cURL Request',     
CURLOPT_POST => 1,     
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data)),
)); 
$resp = curl_exec($curl);
if($resp === false) 
{     
     echo 'Curl error: ' . curl_error($curl);
}
else
{     
    echo 'Operation completed without any errors '.$resp; 
} 
curl_close($curl);

After executing the above code it gives the following error message:

Sorry, the page you are looking for does not live here. If you think the error is yours, please try again. If it's our fault, we'll get right on it.

Please contact us to describe what happened.

Kindly suggest me some solution for this issue. Also let me know the steps or if possible a code snippet to get the request_token and access_token.

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers