function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

BULK API Error - Example from Bulk API Developer's Guide - Page 74.

Hi All,

I am writing a BULK API script using CURL command same as example discussed in Bulk API Developer's Guide page 74. I have wrote below script 

export client_id='not for sharing'
export client_secret='not for sharing'
export username='not for sharing'
export password='not for sharing'
export returnvalues='./returnvalues.txt'
export createjob='./createjob.txt'
export batchDetails='./batchDetails.txt'
export instanceURL='' 
export loginURL=''

curl -d "grant_type=password" -d "client_id=$client_id" -d "client_secret=$client_secret" -d "username=$username" -d "password=$password" -o 

$returnvalues -s

sessionId=`cat $returnvalues | sed 's/[{}]/''/g' | awk -v RS=',"' -F: '/^access_token/{print $2}' | sed 's/\(^"\|"$\)//g'`

echo $sessionId

curl -H "X-SFDC-Session: $sessionId" -H "Content-Type: application/xml; charset=UTF-8" -d @create-job.xml $instanceURL -o $createjob -s

cat $createjob
echo ""

jobId=`grep id $createjob | sed 's/<\/id>//' | sed 's/ *<id>//'`

echo $jobId


echo $jobURL

curl —d @query.txt -H "X-SFDC-Session: $sessionId" -H "Content-Type: text/csv; charset=UTF-8" $jobURL
On last line as curl is adding a job to batch, I am getting an error as
curl: (6) Could not resolve host: 97d
curl: (6) Could not resolve host: query.txt
<?xml version="1.0" encoding="UTF-8"?><batchInfoList
   xmlns="" />

Any idea about the problem ? I am using sames steps from the guide. Could you please help ?

The output should be similar following. 

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

Please reply,

Best Regards,

Rahul Borgaonkar
ShashankShashank (Salesforce Developers) 
Please see if these links help: