You need to sign in to do that
Don't have an account?
error:[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]
Hi All,
I am attempting to use the REST API and its proving a real struggle at this last step - any help most appreciated!
Am trying to use the username-password flow to get oauth session token and uri.
I pass in the various parameters and am successfully returned a session token and uri. All good.
I get a session token and uri, so then try to do a describe, via a HTTP GET using uri + '/services/data/v20.0/sobjects/Account/describe'
I have locked session to IP
All I get is error:[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]
Any suggestions....?
LoL - Simon - in assisting as you have, you inadvertedly got me to a working REST transaction to salesforce...
I'd been using xhr.setRequestHeader('Authorization','OAuth: '+sessiontoken); [Appcelerator Titanium] and after weeks of trying the colon in request header was the culprit. DOH!
Thanks for your speedy support - we got there!
Cheers,
Carl
All Answers
Sounds like you're not adding the Authorization: OAuth {someAccessToken} http header to your request.
Thanks Simon for quick feedback.
Unfortunately I am putting token in header of request prior to sending. Given I am receiving the token back in JSON format, and parsing out the token should I be decoding it, or processing it some other way prior to trying to use it?
Any thoughts most appreciated!
Can you show exacly how you have the header, the OAuth part of the header value is case sensitive.
LoL - Simon - in assisting as you have, you inadvertedly got me to a working REST transaction to salesforce...
I'd been using xhr.setRequestHeader('Authorization','OAuth: '+sessiontoken); [Appcelerator Titanium] and after weeks of trying the colon in request header was the culprit. DOH!
Thanks for your speedy support - we got there!
Cheers,
Carl