Nav
7 years agoAce
Rest Apiv2 to retrieve messages with authentication
Hi,
I am working on ApiV2 rest call to retrieve all messages. I used the below
$aurl = "https://api.lithium.com/community/2.0/xxxxxxx/search?q=SELECT+*+FROM+messages&api.pretty_print=true"; print_r($aresponse = drupal_http_request($aurl, array('headers' => array('client_id' => 'xxxxxx','Content-Type' => 'application/json', 'client_secret' => 'xxx'), )));exit;
I got the below error
{"status":"Unauthorized","message":"Invalid Access Token. Please refresh the token","statusCode":401} [protocol] => HTTP/1.1 [status_message] => Internal Server Error
Please suggest.
Hi
This is working fine when I follow the below
https://community.xxxxxxxxxx.co.uk/auth/oauth2/authorize?client_id=xxxxxxxxxxx&response_type=code&redirect_uri=http://community.xxxx.co.uk/
Thanks