Module actions
You can define a module's actions to take advantage of features.
Create
Used for modules that are creating an object. Most of the time these modules use a POST request.
{
"url": "/contacts",
"method": "POST",
"body": {
"{{...}}": "{{omit(parameters, 'date')}}",
"date": "{{formatDate(parameters.date, 'YYYY-MM-DD')}}"
},
"response": {
"output": "{{body}}"
}
}
Read
Used for modules that are retrieving an object. Most of the time these modules use a GET request.
{
"url": "/contacts/{{parameters.contact_id}}",
"method": "GET",
"response": {
"output": "{{body}}"
}
}
Search module
If you happen to receive this error: Invalid module output. Expected Object, but found Array.
, it means that your module should be a Search type. A search module expects an array output type and, unlike the action type module, supports the pagination directive.
"response": {
"output":
{
"myArray": "{{body}}"
}
}
Update
Used for modules that are updating an object. Most of the time these modules use a PATCH or PUT request.
{
"url": "/contacts/{{parameters.contact_id}}",
"method": "PUT",
"body": "{{omit(parameters,'contact_id')}}",
"response": {
"output": "{{body}}"
}
}
Delete
Used for modules that are deleting an object. Most of the time these modules use a DELETE request.
{
"url": "/contacts/{{parameters.contact_id}}",
"method": "DELETE",
"response": {
"output": "{{undefined}}"
}
}
Last updated