Discussions
- General Development
- Schema Development
- Apex Code Development
- Visualforce Development
- Formulas & Validation Rules
- Security
- Mobile
- Force.com Sites & Site.com
- Chatter Development
- Java Development
- .NET Development
- Perl, PHP, Python & Ruby
- Desktop Integration
- APIs and Integrations
- Visual Workflow
- Apple, Mac and OS X
- VB and Office Development
- AppExchange Directory & Packaging
- Salesforce Labs & Open Source Projects
- Other Salesforce Applications
- Jobs Board
- Force.com Discussion Boards
- :
- Developer Boards for Force.com and Database.com
- :
- Perl, PHP, Python & Ruby Development
- :
- Bulk API Noob - using cURL, getting 'InvalidJob'
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Bulk API Noob - using cURL, getting 'InvalidJo b'
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-11-2012 12:34 PM
Hello, I'm going through the docs, just building the example client app using cURL on a Unix box with PHP, connecting using a free developer sandbox. Using this command to send the job:
curl https://myinstance-api.salesforce.com/services/async/25.0/job -H 'X-SFDC-Session: mysessionID' -H "Content-Type: application/xml; charset=UTF-8" -d mypath/job.txt
getting this response/error:
<?xml version="1.0" encoding="UTF-8"?><error
xmlns="http://www.force.com/2009/06/asyncapi/dataload">
<exceptionCode>InvalidJob</exceptionCode>
<exceptionMessage>Unable to parse Job</exceptionMessage>
As far as I can tell, the only thing different I'm doing from the docs is mypath instead of using '@' - if I use @, though, I get:
Warning: Couldn't read data from file "job.txt", this makes an empty POST.
<?xml version="1.0" encoding="UTF-8"?><error
xmlns="http://www.force.com/2009/06/asyncapi/dataload">
<exceptionCode>InvalidJob</exceptionCode>
<exceptionMessage>Unable to parse Job</exceptionMessage>
...so I think I'm correct in giving the absolute path. The text in 'job.txt' is copied directly from the docs, ie:
<?xml version="1.0" encoding="UTF-8"?>
<jobInfo xmlns="http://www.force.com/2009/06/asyncapi/dataload">
<operation>insert</operation>
<object>Contact</object>
<contentType>CSV</contentType>
</jobInfo>
Can someone help me determine what I may be doing wrong?
Solved! Go to Solution.
Re: Bulk API Noob - using cURL, getting 'InvalidJo b'
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-11-2012 03:52 PM
Re: Bulk API Noob - using cURL, getting 'InvalidJo b'
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-12-2012 06:56 AM
So how do I direct curl to where the file resides? I've tried many varations (-d @job.txt, -d @'mypath/job.txt', -d 'mypath/@job.txt', -d mypath/@job.txt') - I've checkec the curl man and it doesn't seem clear on this ...
Re: Bulk API Noob - using cURL, getting 'InvalidJo b'
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
07-12-2012 08:13 AM
My bad, I didn't include the full path *outside* the jail we were using. Thank you for your response!

