Automation

The purpose of this document is to provide a guide for the correct use of the Masivian Automation API service, below you can see examples of the body of the request to start flows.

Sending flows by API

There are two steps to send campaigns via API:

  1. The first one is the creation of the flow from the graphical interface.
  2. The second is to send flow initiation API request.

You must enter the Automation creation module and in the start node, when selecting the data upload methid, choose the “API” option. When finishing the flow and clicking on the “Activate” button, an identifier (ID) of the flow will be shown which must be saved to be used in the next step.

Untitled

HTTP Method Endpoint
POST https://automation.masivapp.com/api/automation-model/campaign/init-from-api

Start Flow Api

Request structure for new flows created from the graphical interface of Masiv Web

Parameters

Header Type Description
Authorization string Basic 64 authentication token which matches Basic username:password encoded in base 64
Body Type Description
dataToReplace array Collection of people in an array, which will enter the flow
flowId string Id representing the flow created from the web interface
Responses Description
🟢 200 Request successfully received

Example

{
    "status": "ok",
    "pTracking": "5fe25b29c33b9800109bb854"
}
Responses Description
🔴 500 The model ID does not match one created for the authenticated account

Example

{
    "status": "error",
    "response": "FLOW-SERVICE originalError:(model not found)"
}

Request structure example

{
    "flowId": "5fe21261c33b980030933335",
    "dataToReplace": [
        {
            "name": "Carlos",
            "cellphone": "57301234567",
            "email": "[email protected]",            
            "age": 28,
            "message": "Hello this is a example"
        }
    ]
}

NOTE: Cellphone numbers must have country codes to avoid possible errors in the sending and operation of the campaigns.


Sending external notifications

To perform external event notifications to the Masiv Automation service the following end-point of type application/json must be consumed.