How to: Perform batch operation for Entity

For information about prerequisites, see Integrate with Entities.

Batch endpoints are provided to create and update Entities in batches. The Batch endpoints support two methods to supply the Entity data:

  • JSON
  • CSV file upload

JSON Method

To create Entities in batch, call the Create Batch Request endpoint. The following examples show a request body for creating a Batch Entity request:

{
   "payload":[
      {
         "uniqueCode":"QK6A-JI6S-7ETR",
         "name":"car1",
         "owner":"worldlogistics",
         "category":"four-wheeler",
         "subCategory":"truck",
         "properties":{
            "color":"red"
         }
      },
      {
         "uniqueCode":"XNSS-HSJW-3NGU",
         "name":"car2",
         "owner":"worldlogistics",
         "category":"four-wheeler",
         "subCategory":"truck",
         "properties":{
            "color":"blue"
         }
      },
      {
         "uniqueCode":"NHLE-L6MI-4GE4",
         "name":"car3",
         "owner":"worldlogistics",
         "category":"four-wheeler",
         "subCategory":"truck",
         "properties":{
            "color":"black"
         }
      },
      {
         "uniqueCode":"6ETI-UIL2-9WAX",
         "name":"car4",
         "owner":"worldlogistics",
         "category":"four-wheeler",
         "subCategory":"truck",
         "properties":{
            "cole":"silver"
         }
      },
      {
         "uniqueCode":"2E62-E3SR-33FI",
         "name":"car5",
         "owner":"worldlogistics",
         "category":"four-wheeler",
         "subCategory":"truck",
         "properties":{
            "color":"white"
         }
      }
   ],
   "callback":"https://examplecallbackurl.com"
}

To update Entities in batch, call the Update Batch Request endpoint. The following examples show a request body for updating a Batch Entity request:

{
   "payload":[
      {
         "properties":{
            "color":"black"
         }
      },
      {
         "properties":{
            "color":"silver"
         }
      },
      {
         "properties":{
            "color":"white"
         }
      },
      {
         "properties":{
            "color":"blue"
         }
      },
      {
         "properties":{
            "color":"red"
         }
      }
   ],
   "callback":"https://examplecallbackurl.com"
}

To get the status of the batch request of an Entity Type specified by EntityTypePluralName, call the Get Batch Request Status endpoint.

File Upload Method

To create Entities in batch through CSV, call the File Upload Create Request endpoint.

To update Entities in batch through CSV, call the File Upload Update Request endpoint.

To get the status of the File Upload batch request of an Entity Type specified by EntityTypePluralName, call the Get File Upload Request Status endpoint.