All pages
Powered by GitBook
1 of 3

Loading...

Loading...

Loading...

Action

The action module is a module that makes a request (or several) and returns a result. It does not have a state or any internal complex logic.

Action modules are straightforward modules that make one or more requests and return a single bundle as result. Each execution is isolated, so they do not have a state like polling triggers and they can't be used to output multiple bundles like search modules. You should use an action module when the API endpoint returns a single item in the response. Some examples of common action modules include:

  • Create an object

  • Update a user

  • Delete an email

  • Get a record (by its ID)

  • Download/Upload a file

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')}}"
{
    "url": "/contacts",
    "method": "POST",
    "body": "{{parameters}}",
    "response": {
        "output": "{{body}}"

{
    "url": "/contacts"
    "method": "POST",
    "qs": {},
    "headers": {},
    "body": {
        "name": 

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

Read

Used for modules that are retrieving an object. Most of the time these modules use a GET request.

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 module expects an array output type and, unlike the action type module, supports the directive.

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 - .

There are two types of update approaches - partial and full.

Delete

Used for modules that are deleting an object. Most of the time these modules use a DELETE request.

},
"response": {
"output": "{{body}}"
}
}
}
}
"{{parameters.name}}"
,
"email": "{{parameters.email}}",
"phone": "{{parameters.phone}}",
"address": "{{parameters.address}}"
},
"response": {
"output": "{{body}}"
}
}
responsiveness approaches
search
pagination
erase
{
    "url": "/contacts/{{parameters.contact_id}}",
    "method": "GET",
    "response": {
        "output": "{{body}}"
    }
}
"response": {
            "output":
            {
                "myArray": "{{body}}"
            }
        }
{
    "url": "/contacts/{{parameters.contact_id}}",
    "method": "PUT",
    "body": "{{omit(parameters,'contact_id')}}",
    "response": {
        "output": "{{body}}"
    }
}
{
    "url": "/contacts/{{parameters.contact_id}}",
    "method": "PUT",
    "body": {
        "name": "{{parameters.name}}",
        "email": "{{parameters.email}}",
        "phone": "{{parameters.phone}}",
        "address": "{{parameters.address}}"
    },
    "response": {
        "output": "{{body}}"
    }
} {
{
    "url": "/contacts/{{parameters.contact_id}}",
    "method": "DELETE",
    "response": {
        "output": "{{undefined}}"
    }
}

Components

Communication

For more information, see the communication documentation.

  • The communication response is extended with the wrapper object.

  • limit is not available in response as the result of the action should always be only one bundle

  • Communication can be .

Static parameters

You can use inside the action module without any restrictions.

Mappable parameters

You can use inside the action module without any restrictions.

Interface

The action module should always .

Samples

To help the users with setting up your module, you can provide .

Scope

When using an OAuth type of connection, use the to define scopes required by this action.

Available IML variables

These IML variables are available for you to use everywhere in this module:

Variable
Description

Additional variables available for the response object:

Variable
Description

Additional variables available after using the iterate directive, i.e. in wrapper or pagination directives:

Variable
Description

Additional variables available for pagination and response objects:

Variable
Description

Action module example

data

Contains the module’s data collection.

scenario

TBD

metadata.expect

Contains the module’s raw parameters array in the way you have specified it in the configuration.

metadata.interface

Contains module’s raw interface array in the way you have specified it in the configuration.

now

Current date and time

environment

TBD

temp

Contains custom variables created via the temp directive.

parameters

Contains the module’s input parameters.

connection

Contains the connection’s data collection.

common

Contains the app’s common data collection.

output

When using the wrapper directive, the output variable represents the result of the outputdirective.

iterate.container.first

Represents the first item of the array you iterated.

iterate.container.last

Represents the last item of the array you iterated.

body

Contains the body that was retrieved from the last request.

headers

Contains the response headers that were retrieved from the last request.

items

When iterating this variable represents the current item that is being iterated.

request-less
static parameters
mappable parameters
output only one bundle
samples
scope
{
	"url": "/api/users/create",
	"body": {
		"name": "{{parameters.name}}",
		"email": "{{lower(parameters.email)}}"
	},
	"method": "POST",
	"response": {
		"output": {
			"id": "{{body.id}}"
		}
	}
}
[]
[
	{
		"name": "email",
		"type": "email",
		"label": "Email address",
		"required": true
	},
	{
		"name": "name",
		"type": "text",
		"label": "Name",
		"required": true
	}
]
[
	{
		"name": "id",
		"type": "uinteger",
		"label": "User ID"
	}
]
{
	"id": 1
}