I want to create a query job using Bulk API. I have logged in succesfully in my sandbox using curl. I now have a sessionId and a serverURL returned by Salesforce.
I have an XML that creates a query job:
create-query-job.xml
<?xml version="1.0" encoding="UTF-8"?>
<jobInfo xmlns="http://www.force.com/2009/06/asyncapi/dataload">
<operation>query</operation>
<object>Account</object>
<concurrencyMode>Parallel</concurrencyMode>
<contentType>CSV</contentType>
</jobInfo>
My curl statement is:
curl -H "X-SFDC-Session: 0012010!ASAAA.912AASAVASAAS" -H "Content-Type: application/xml; charset=UTF-8" -D @create-query-job.xml https://instance--Dev.my.salesforce.com/services/async/50.0/job
For security reasons, I have not pasted the real session Id or the instance name, but you get it :)
I read in some documentation that on Mac (which I'm using), you need to either escape the exclamation point on the sessionId (tried - same error) or enclose the sessionId in single quotes (tried->Invalid session id error this time).
So trying this, I get the error:
<?xml version="1.0" encoding="UTF-8"?><error
xmlns="http://www.force.com/2009/06/asyncapi/dataload">
<exceptionCode>InvalidUrl</exceptionCode>
<exceptionMessage>Create Job must be a POST request</exceptionMessage>
How can I fix this and create the Job, returning the jobId ? Thank you for your ans
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…