Handling Preview Operations

When a any workflow is about to get executed, MineOS makes an API call to the URL set in the Preview URL field. The HTTP request is of the following form (the full payload is available Here​):

POST https://example.com/endpoint HTTP/1.1
X-Mine-Signature: afd94341967f3fc2e56bc573bbd4aea9e7241a5835a3b41a96135ce4c5ff8449
Content-type: application/json

{
  "traceId": "WWkfD9P3zUuSdy8A7EwrnA",
  "integrationId": "397u04bmnuejfdx-_x6gvw",
  "isTest": false,
  "request": {...},
  "userInfo": {...},
  "evidence": {...}
}

The receiving endpoint is expected to return 200 OK with a JSON response body that includes a summary of user data records found. This data will not be shared with the requesting user, and is used as internal information to help you choose how to handle the request.

The response JSON must satisfy match the following structure:

{
  "records": [
    {
      "name": "firstRecord",
      "properties": [
        {
          "name": "fieldName",
          "value": "fieldValue"
        },
        {
          "name": "anotherName",
          "value": "anotherValue"
        }
      ]
    },
    ...
  ]
}
📘

Notes

  • You can returns as many records as you want
  • You can only return up to 3 properties for each record.
  • All property types should be string.
  • The request object does not always exist in a preview request.

Did this page help you?