2

I am trying to pull the failed records from a bulk job that I have using this API call:

https://COMPANYNAME.my.salesforce.com/services/data/v56.0/jobs/ingest/{jobId}/failedResults

This API call is not pulling anything in Postman, but I am able to pull data if I drop off the failedResults portion of the call.

I know that my results do have failed results from the returned JSON:

{
    "id": "{jobId}",
    "operation": "upsert",
    "object": "Object",
    "createdById": "{userId}",
    "createdDate": "2022-10-17T05:08:38.000+0000",
    "systemModstamp": "2022-10-17T05:09:04.000+0000",
    "state": "Closed",
    "externalIdFieldName": "{externalId}",
    "concurrencyMode": "Serial",
    "contentType": "ZIP_CSV",
    "apiVersion": 55.0,
    "jobType": "Classic",
    "numberRecordsProcessed": #######,
    "numberRecordsFailed": ##,
    "retries": 0,
    "totalProcessingTime": ########,
    "apiActiveProcessingTime": #######,
    "apexProcessingTime": ########
}

Should I be using something else than Postman to make this call or what could I do to pull these failed records?

1
  • I tried this in my Dev org using workbench and could see in the raw response that the below URI's are giving correct results/services/data/v56.0/jobs/ingest/7507F00000XVC8qQAH/successfulResults/ /services/data/v56.0/jobs/ingest/7507F00000XVC8qQAH/failedResults/ You might want to try workbench and let me know if you are stuck somewhere specifically Commented Oct 31, 2022 at 14:25

1 Answer 1

1

I tried with below steps via workbench and could see the failedResults generated:

  1. POST Method: /services/data/v56.0/jobs/ingest

Body:

{
"object": "Account",
"externalIdFieldName": "SLASerialNumber__c",
"contentType": "CSV",
"operation": "upsert",
"columnDelimiter": "COMMA",
"lineEnding": "CRLF"
}

Batch created with contentUrl: services/data/v56.0/jobs/ingest/7507F00000XVTynQAH/batches


  1. PUT METHOD: services/data/v56.0/jobs/ingest/7507F00000XVTynQAH/batches

Header:

Content-Type: text/csv
Accept: application/json;charset=UTF-8

Body:

SLASerialNumber__c,Tradestyle,Name
1234,fashion,Maddali
1111,fashion

  1. PATCH METHOD: /services/data/v56.0/jobs/ingest/7507F00000XVTynQAH

Header:

Accept: application/json;charset=UTF-8
Content-Type: application/json;charset=UTF-8

Body:

{"state":"UploadComplete"}

  1. GET METHOD: /services/data/v56.0/jobs/ingest/7507F00000XVTynQAH/failedResults/

    "sf__Id","sf__Error",SLASerialNumber__c,Tradestyle,Name "","INVALID_FIELD:Number of fields in header is different from the row. header = 3 row = 2:--","","",""

failed result

/services/data/v56.0/jobs/ingest/7507F00000XVTynQAH/successfulResults/

"sf__Id","sf__Created",SLASerialNumber__c,Tradestyle,Name
"0017F00002RxEKDQA3","false","1234","fashion","Maddali"

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .