Handling Copy Operations

When a copy workflow is executed, MineOS makes an API call to the URL set in the Copy URL field. The HTTP request is of the following form:

POST https://example.com/endpoint HTTP/1.1
X-Mine-Signature: 4r4ClKnSeGWvTGQzMCUcEEK9uF528mvOlN/jtKMQ==
Content-type: application/json

{
  "traceId": "123456789abcdefghijklm",
  "integrationId": "0c36xnykgewwbzfukh1jkq",
  "isTest": true
  ...
}

The receiving endpoint is expected to return one of the following responses:

200 OK (Sync Flow)

Returning 200 indicates to MineOS that the data collection process has been completed successfully, and the process will be marked as 'completed' in the UI. The response is expected to contain JSON with the user data that was collected. In this flow, your endpoint is expected to return a response within 60 seconds.

202 Accepted (Async Flow)

Returning 202 indicates to MineOS that the data collection process has started, and the process will be marked as 'in progress' in the UI. Your endpoint can now use as much time as it wants to collect user data and send it back to MineOS when ready.

Once ready, you should use the Update custom integration status API to update the integration status and provide the collected data. You can only call the update integration status API once; the operations is considered as completed once you call it.

Note that this flow supports more scenarios and is the recommended approach.

Any other status code

Failing to respond with 200/202, or returning any non 2xx http status code, will cause MineOS to keep retrying the request until a valid 200/202 response is returned or the retry attempts have reached a maximum, marking the process as failed.


Comparing Async vs. Sync flow

FlowSyncAsync
Max processing time60sunlimited
Implementation ComplexitySimpleSlightly more advanced
Supported statusesSupports only 'Success' status.Supports multiple status flags: Success, Failed, User not found etc, as well as supplying a custom message along the status.
Supported data formatsJSONJSON or File URLs