Step 4: Update entity through API
Last updated
Last updated
Once the Entity and API are created, the API can be used to populate multiple records in the Entity βUserName_Acc_Activitiesβ.
To test the API, click the [Test] button.
The Test API box will display the βEntity actionsβ toggle button disabled. (Note: If βEntity actionsβ is not enabled, testing an API that is using entity actions will result in the status of βfailedβ in the response.) To allow the Entity to be updated or created with entity actions, click the βEntity actionsβ toggle button.
Select the default API gateway as βUserName_Acc_AddCustomerβ. The default API gateway will be selected if the user does not select an API gateway.
In the βRequestβ section, update the Json object in the Request section with values to test.
In this case, we add two (2) activities for the customer with a certain customer_id (Users must ensure to add a customer_id present in the entity βUserName_Acc_customers,β else it will give an error message).
Copy the following code and paste it into the Request section on the Test Console. (Ensure the data is present in the target entity)
{ "customer_id": "7c55d71fece9e418787f9628a3d77d19c",
"activities": [{
"Activity_Type": "Information Request/Query",
"Activity_Description": "test email",
"Activity_DateTime": "2021-03-03",
"Activity_Priority": 1,
"Activity_AssignedTo": "Test HD Team",
"Activity_CreatedBy": "Test Sales Team"
},
{
"Activity_Type": "Incoming call",
"Activity_Description": "test Incoming call",
"Activity_DateTime": "2021-11-29",
"Activity_Priority": 2,
"Activity_AssignedTo": "Test Marketing",
"Activity_CreatedBy": "Test Sales Team"
}
]
}
``
The test Console will be as per the image below.
To test if the record is created in the target entity, click the [Test API] button.
The Response section in the Test dialog displays a record creation success message.
In the list of Entities, click on βUserName_Acc_Activitiesβ. The created record will be displayed.
Note: If the βEntity actionsβ toggle button is disabled, and the API is tested, the Response section in the Test dialog displays an error message when the [Test API] button is clicked.