Creating Records
Creating records in Magentrix is a HTTP POST operation. The data in the post operation must resemble the Entity being populated in terms of how the fields look like. The HTTP POST must use the following end-point: https://instance.magentrix.com/REST/Create.
There are two parameters that need to be provided to the HTTP POST:
e: This is the name of the entity being populated. For example "Account" or “Force__Account”
data: This is the JSON representation of the record for the specified entity created.
Here's an example of creating a new Account:
POST https://<your-portal-domain>/rest/2.0/create?e=Account
-H "Authorization: Bearer <token>"
-H "Content-Type: application/json"
-H "Accept: application/json"
-d [JSON BODY CONTENT]
Here's an example of the request body for creating a new Account:
{
"Name":"My New Account Name",
"BillingStreet":"The Landmark @ One Market"
}
Here's an example of the request body to create multiple Accounts at once:
[
{
"Name":"Burlington Textiles",
/* list of more fields */
},
{
"Name":"Acme Limited",
/* list of more fields */
}
]
Note: It is recommended to send data in batches if you have large amount of data to push to Magentrix. It is recommended to limit the number of records between 200 to 400 records for optimum performance and avoid issues.
If successful, the JSON response will have the "HasError" property set to false and the "Id" property populated with the newly created record id. Otherwise, "HasError" will be true and "Errors" property will contain one or more records indicating the reason record creation failed.
Here's an example of the response body after calling the create resource:
{
"Id":"00200000000001F0001",
"Errors":[],
"HasError":false
}