Table of Contents


Updating Records

Updating records in Magentrix is a HTTP POST operation. The data in the post operation must resemble the Entity being populated in terms of the field's appearance. The HTTP POST must use the following end-point:  

POST https://<your-portal-domain>/rest/2.0/edit?e={objectname}
   -H "Authorization: <token>" 
   -H "Content-Type: application/json"   
   -H "Accept: application/json"   
   -d [BODY PAYLOAD]

There are three parameters that need to be provided to the HTTP POST.
 
URL Parameters:
e: This is the name of the entity being updated. For example, “Account”.
fieldsToNull: a list of comma-separated field names that you want to set to null. 

Payload Body
data: This is the JSON representation of the record for the specified entity being updated. Note that the “Id” property is required for an update.
 
Magentrix only updates the field values you provide; other fields are kept as their previous state. If you need to clear out values of certain fields (set them to NULL), you need to use "fieldsToNull" parameter.
 

Here's an example of a request for updating an Account record:

POST https://<your-portal-domain>/rest/2.0/edit?e=Account
   -H "Authorization: <token>"
   -H "Content-Type: application/json"
   -H "Accept: application/json"
   -d [ACCOUNT DATA FIELDS]


Here's an example of the request body for updating an Account record:

{ 
    "Id":"00200000000001F0001",
    "Name":"Test from JSON", 
    "BillingStreet":"The Landmark @ One Market"
}

You also pass an array of data to update records in bulk, it is recommended to not include more than 200 records within a payload.


Here's an example of the response body for updating fields in an Account record:

​{
   "Id":"00200000000001F0001",
   "Errors":[],
   "HasError":false
}