1

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?

2

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? – user3422401 Aug 13 '14 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) – Boris Bachovski Aug 13 '14 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? – user3422401 Aug 13 '14 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). – Boris Bachovski Aug 13 '14 at 6:17
  • 1
    Thank you for your help. I'm practicing on the example you gave. – user3422401 Aug 13 '14 at 6:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.