taralex
taralex

Reputation: 935

Salesforce SOAP SessionId as REST token

I'm logging my users in using SOAP in my app. But then I want to use Analytics API, which is REST. But I don't want them to enter their credentials all over again. Is there a way that I can use my already obtained SOAP sessionId as the token for REST API? When I tried to do that, I got an authentication error back from the REST call. Did I miss something or is it just not possible?

Upvotes: 4

Views: 1256

Answers (1)

superfell
superfell

Reputation: 19050

Yes its possible, just use the SOAP session Id in the same place you'd use a access token you'd gotten via OAuth, by adding a Authorization: Bearer {sessionId} HTTP header to your REST API requests.

Upvotes: 6

Related Questions