As the title. I'm using username/password flow to request an access token. So how can I request a SFDC sessionID from that token?
1 Answer
The access token plays the same role as the session ID. Essentially the access token is the session ID for your web service.
-
But the token get expire after a period of time, right? Commented Aug 13, 2014 at 5:44
-
That's right, so does the session ID. You can set the expiry time in Setup -> Security Controls -> Session Settings (Timeout Value) Commented Aug 13, 2014 at 5:46
-
As you said. I don't need to request for sessionID, right? If true, how can I work with access token like sessionID? Could you give me any example? Commented Aug 13, 2014 at 6:13
-
Once you get the access token you need to stick it to the authoization header
Authorization : OAuth YOURACCESSTOKEN
and then you can make subsequent callouts from your environment to SF. A good java (based on your tags) example : stackoverflow.com/questions/9258653/salesforce-rest-api-login (DaSh's answer). Commented Aug 13, 2014 at 6:17 -
1Thank you for your help. I'm practicing on the example you gave. Commented Aug 13, 2014 at 6:52