Salesforce support requested to abort bulk data jobs from API, we tried doing it via UI, but salesforce support said it did not work! looking for ways to do it via rest, soap or any other ways
You can abort bulk data jobs using CURL command as below
curl -H 'X-SFDC-Session: <<insert session id here>>' -H 'Content-Type:text/csv;charset=UTF-8' -d @job.xml <<insert your org endpoint url here>>services/async/38.0/job/<<insert job id you want to abort>>
create file job.xml with following content
<?xml version="1.0" encoding="UTF-8"?> <jobInfo xmlns="http://www.force.com/2009/06/asyncapi/dataload"> <state>Aborted</state> </jobInfo>
If you want to close job change above file to
Salesforce documentation - Bulk API Developer Guide please see section "Walk Through a Bulk Query Sample".