Vlocity Facts #52 || Using DataMapper Post as Rest API

In Previous posts we have seen how to

In this post we will see how to Invoke DataMapper Post as REST API.

Data Mapper Post Invocation Using POST

You can use the Data Mapper REST API to invoke any type of Data Mapper. To update Salesforce objects using a Data Mapper Load, send a POST request with a JSON payload formatted according to the expected input structure of the Data Mapper Load.

To update Salesforce data, issue a POST request with a URL formatted as follows:

/services/apexrest/{myOrgNamespace}/v2/DataRaptor/

  • myOrgNamespace - Namespace prefix

In the POST data, specify the following parameters:

  • bundleName — Name of the Data Mapper Load to invoke
  • objectList — JSON data to be loaded. Must match the format expected by the Data Mapper Load.
  • filesList — (Optional) Map of keys to base 64-encoded files.
  • bulkUpload — TRUE to use batch Apex.
Example: We will create a sample Data Mapper Post to create Account data. We will use this below mentioned Json to make a call out 
{
   "bundleName" : "DRLAccountUpdate",
   "objectList" : {
      "AccountInformation": {
         "AccountName": "Vlocity Facts",
         "AccountAddress": "52 block NA Street",
         "AccountCity": "Vijayawada",
"AccountState": "TN",
"AccountZip": "94110",
} }, "bulkUpload" : false }


From Workbench we will call this DataMapper Post by using below syntax
/services/apexrest/{myOrgNamespace}/v2/DataRaptor/
URL:  /services/apexrest/omnistudio/v2/DataRaptor
and use above mentioned request data to make a call out 
Output:



Comments

Popular posts from this blog

Vlocity Facts #01 | OmniStudio DataRaptors

Vlocity Facts #44 || Communication between Omniscript and Flexcard [Pub/Sub]

Vlocity Facts #37 || Configure Google Maps in Type Ahead Block