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}}"
    }
}

There are two types of responsiveness - synchronous and asynchronous. Read more about it in responsiveness approaches.

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}}"
    }
}

There is a difference between List/Search and Get modules although they use the same GET method.

List/Search modules return multiple bundles and should be a Search module type.

Get modules return only one bundle (specified by the entered ID) and should be Action modules.

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}}"
            }
        }

If you don't want to iterate the array returned from the API, you can wrap it in an object.

Update

Used for modules that are updating an object. Most of the time these modules use a PATCH or PUT request.

When a module is type Update, a new keyword appears inside Make - erase.

{
    "url": "/contacts/{{parameters.contact_id}}",
    "method": "PUT",
    "body": "{{omit(parameters,'contact_id')}}",
    "response": {
        "output": "{{body}}"
    }
}

There are two types of update approaches - partial and full. Read more about it in update approaches.

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