+ Start a Discussion
Venkat RanganVenkat Rangan 

How to specify SessionId for Bulk API POST request.


I am following the example here for getting started on Bulk API.


The Job Creation XML is sent using a HTTP POST where the Authorization Header has the Bearer: <OAuth Token>

The response I get is:

<?xml version="1.0" encoding="UTF-8"?><error
<exceptionMessage>Unable to find session id</exceptionMessage>

Where can I specify the Session ID for the Create Job call to succeed?

Just for reference, the XML that is posted (per example) is:

<?xml version="1.0" encoding="UTF-8"?>


You need to provide the session ID as a header using following syntax:
Authorization: Bearer [session ID]
Colon is just distinguisher between header name and header value. Authorization is the header name and Bearer [session Id] is the value.
No colon is required within the header value i.e. after bearer just a space followed by session id is enough.
Hi Venkat,

I have been suffering the same issue in that the response after successful basic authentication does not include the session id. As a result, I get the same error as you, regardless of the authorization header combinations included in the create job call (e.g. OAuth 00Ds***** or Bearer 00Ds***).

There is a field called "id" that is returned in a successful authentication response, which returns a url of the form "https://test.salesforce.com/id/00D4******K/0054*****Q". What are these, seeing as neither seem to be the session id.