CX Sales & B2B Service - API Batch Call (REST and SOAP)

Hi,

In this post, I will discuss how to call SOAP and REST API for batch operations. With the batch operation, it can help to improve the API execution throughput and performance. You may find it useful if you have use case to CRUD large data set through API.

SOAP API -

In this example, I use TCA Organization SOAP to update TAXID for multiple party organizations.

WSDL - https://URL/crmService/FoundationPartiesOrganizationService?WSDL

Request Payload (Body) -
   <soapenv:Body>
      <typ:processOrganization>
         <typ:changeOperation>Merge</typ:changeOperation>
         <typ:organizationParty>
            <org:PartyId>300000079969647</org:PartyId>
            <org:OrganizationProfile>
               <org:OrganizationProfileId>300000079969647</org:OrganizationProfileId>
               <org:PartyId>300000079969647</org:PartyId>
               <org:JgzzFiscalCode>ID1</org:JgzzFiscalCode>
            </org:OrganizationProfile>
         </typ:organizationParty>
         <typ:organizationParty>
            <org:PartyId>300000079969617</org:PartyId>
            <org:OrganizationProfile>
               <org:OrganizationProfileId>300000079969617</org:OrganizationProfileId>
               <org:PartyId>300000079969617</org:PartyId>
               <org:JgzzFiscalCode>ID2</org:JgzzFiscalCode>
            </org:OrganizationProfile>
         </typ:organizationParty>
         <typ:organizationParty>
            <org:PartyId>300000079969508</org:PartyId>
            <org:OrganizationProfile>
               <org:OrganizationProfileId>300000079969508</org:OrganizationProfileId>
               <org:PartyId>300000079969508</org:PartyId>
               <org:JgzzFiscalCode>ID3</org:JgzzFiscalCode>
            </org:OrganizationProfile>
         </typ:organizationParty>
         <typ:processControl>
            <typ1:returnMode>Key</typ1:returnMode>
            <typ1:exceptionReturnMode>Key</typ1:exceptionReturnMode>
            <typ1:partialFailureAllowed>false</typ1:partialFailureAllowed>
         </typ:processControl>
      </typ:processOrganization>
   </soapenv:Body>



REST API -

In this example, I use custom object REST to update attribute1_c for multiple records of custom object ABC_c.

REST - https://URL/crmRestApi/resources/latest/

Request Header - Content-Type: application/vnd.oracle.adf.batch+json

Request Body - 
{
"parts": [
{
"id": "part1",
"path": "/ABC_c/300000312300921",
"operation": "update",
"payload": {
  "attribute1_c": "1"
}
},
{
"id": "part2",
"path": "/ABC_c/300000312288887",
"operation": "update",
"payload": {
  "attribute1_c": "1"
}
}
]
}

Please try it out and let me know how it goes.

Thanks,
Adam Liu



Reference Document -

REST API

SOAP API

Comments

Post a Comment

Popular posts from this blog