Integrations

The Integration settings panel is used to exchange data between PTM and external systems. It can be used to configure task imports, data exports, notifications, and event transmission through APIs, email, or webhooks.
Integration parameters should be changed by an administrator or a specialist responsible for connecting external systems.
 

Selecting an integration

The top of the panel contains two fields:
  • Integration groups — the integration group
  • Integration system — the system to connect
Select a group and system from the lists. PTM will then display the available parameters and the integration configuration form.
 

Integration list

The Form integration section displays configured integrations. The table may contain the following columns:
  • Key
  • Name
  • URL
  • Headers, json
  • Params, json
Integrations can be used, for example, to:
  • automatically import tasks from email using a predefined template
  • send notifications
  • transmit task, vehicle, and location data
  • exchange data with external ERP and other corporate systems
 

Configuring a webhook

After selecting an integration, complete the fields in the Integration Form section:
  • Webhook URL — the address to which PTM sends data
  • Webhook headers, json — additional HTTP headers, such as an authorization token
  • Webhook params, json — the data sent to the external system
  • Algorithm ID — the ID of the PILOT algorithm that should process the event
Additional fields may be located lower in the form. Scroll the panel to check all available parameters.
After completing the fields, click Save.
 

Inserting data into a webhook

The following parameters are available for each integration:
  • Webhook URL — the address used to send webhooks
  • Webhook headers — additional HTTP headers, such as an authorization token
  • Webhook params — the payload sent in the webhook
The following special functions are used to insert data automatically:
  • fn[getApiKey]— retrieves the API key from the configuration; available only for the Sarmix ERP system
  • fn[getAgentId]— retrieves the vehicle ID from PILOT
  • fn[getCurrentAgentLocation]— retrieves the vehicle’s current location
  • fn[getCurrentUTC]— retrieves the current vehicle packet time in seconds
  • fn[getCurrentZoneId]— retrieves the ID of the geofence where the vehicle is located
  • fn[getTaskId]— retrieves the ID of the task being performed by the vehicle
  • fn[getErpOrderId]— retrieves the order ID; available only for the Sarmix ERP system
  • fn[getCurrentSpeed]— retrieves the vehicle’s current speed
  • fn[getVehicleNumber]— retrieves the vehicle number
 

Webhook parameters example

The Webhook params, json field contains a JSON object with the data to be sent to the external system. Special functions are used to insert values automatically.
{
  "access_token": "fn[getApiKey]",
  "agent_id": "fn[getAgentId]",
  "geolocation": "fn[getCurrentAgentLocation]",
  "time_event": "fn[getCurrentUTC]",
  "zone_id": "fn[getCurrentZoneId]",
  "pilot_task_id": "fn[getTaskId]",
  "erp_order_id": "fn[getErpOrderId]",
  "speed": "fn[getCurrentSpeed]",
  "vehiclenumber": "fn[getVehicleNumber]"
}
 
The system will automatically replace the functions with actual values, for example:
{
  "access_token": "123456789abcdef",
  "agent_id": "4521",
  "geolocation": "55.751244,37.618423",
  "time_event": "1750054800",
  "zone_id": "125",
  "pilot_task_id": "98765",
  "erp_order_id": "ORD-4567",
  "speed": "68",
  "vehiclenumber": "А123ВС777"
}
 

Additional integration parameters

  • Algorithm ID — the ID of an algorithm created in PILOT to process notifications
  • Algorithm data, json — the payload sent to a PILOT algorithm when a notification is triggered. This parameter is configured by technical support when necessary. Its contents and structure depend on the specific algorithm and processing scenario
Example:
{
  "-6": {
    "text": "Выполните действия",
    "options": [
      "Действие 1",
      "Действие 2",
      "Действие 3"
    ]
  }
}
  • Algorithm timer — the time to wait for the algorithm to execute, in seconds
  • Sensor ID — the sensor ID from the PILOT system
  • Emails — a list of email addresses to which notifications should be sent