0

We want to give an external system the standard API to upsert records from Account Object with an external Id.

The records have an associate parent Account that needs to be filled also with the same External ID.

For example :

{
 "Name":"New Account",
 "External_Id__c":"123",
 "ParentId":"567" //from the field: External_Id__c
}

In Docs: https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_upsert.htm

under "Upserting Records and Associating with an External ID" section, we can use only one record, but we want to get a list of records by external Id and not only one.

I know I can use the Bulk API - But as far as I looked for, I can't insert any Associating lookup field with external Id using that way.

I tried :

/services/async/49.0/job
{"operation":"upsert","object":"Account","contentType":"JSON","externalIdFieldName":"External_Id__c"}

And then :

/services/async/49.0/job/JOBID/batch
[{
    "Name": "APITest01",
    "External_Id__c": "11001",
    "parentId": {"External_Id__c": "535"}
}, {
    "Name": "APITest02",
    "External_Id__c": "110012",
    "parentId": {"External_Id__c": "535"}
}, {
    "Name": "APITest03",
    "External_Id__c": "110013",
    "parentId":{"External_Id__c": "535"}
}]

And also :

   /services/async/49.0/job/JOBID/batch
    [{
        "Name": "APITest01",
        "External_Id__c": "11001",
        "parentId":"535"
    }, {
        "Name": "APITest02",
        "External_Id__c": "110012",
        "parentId":"535"
    }, {
        "Name": "APITest03",
        "External_Id__c": "110013",
        "parentId":"535"
    }]

Where ParentId is the parent account and also need to use the External_Id__c field to be assign.

The account is one of the objects they need to send us. It should be Account, Contact, and another custom object.

All of them should be upserted by an External Id and its JSON should be between 5k - 16k of records, regrading the Object.

I'll be glad if someone has a way to do so, + write me the limitation of the method if it possible.

Thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.