Get Async Action

Async actions API lets you track asynchronous operations scheduled in your Projects. Using this endpoint you can check the result of a scheduled asynchronous operation.

{
    "id": "aa_09414733b84a1ed3c4",
    "type": "CAMPAIGN.VOUCHERS_IMPORT_CSV",
    "status": "DONE",
    "result": {
        "message": "1 voucher(s) imported successfully, 0 failed.",
        "failed": []
    },
    "created_at": "2021-05-18T06:32:44.002Z",
    "object": "async_action"
}
{
    "code": 404,
    "key": "not_found",
    "message": "Resource not found",
    "details": "Cannot find async_action with id aa_09414733b83a1ed3c4",
    "request_id": "v-0942b9341250a5c698",
    "resource_id": "aa_09414733b83a1ed3c4",
    "resource_type": "async_action"
}

Response Schema

Response provides detailed information about the async action result.

Response schema type: object

{
    "id": "aa_09414733b84a1ed3c4", // string, unique ID of async action
    "type": "CAMPAIGN.VOUCHERS_IMPORT_CSV", // string, type of async action is different for each endpoints managed via async actions API
    "status": "DONE", // string, status informs if the async action is already completed
    "result": { // object, format specific for called async action
        "message": "1 voucher(s) imported successfully, 0 failed.", // string, shows how many records were processed successfully and how many failed
        "failed": [] // array, if any records failed during the process, it shows the failure details specific for the given async action (reason, row, code, customer's source id/id) .  
    },
    "created_at": "2021-05-18T06:32:44.002Z", // date time of scheduling async action
    "object": "async_action"
}
{
    "id": "aa_0941a57af5d96ddce7",
    "type": "CUSTOMERS.IMPORT_CSV",
    "status": "DONE",
    "result": {
        "message": "0 customer(s) imported successfully, 1 failed.",
        "failed": [
            {
                "source_id": "test_import_id",
                "row": 1,
                "reason": "Invalid phone format"
            }
        ]
    },
    "created_at": "2021-05-18T13:24:38.489Z",
    "object": "async_action"
}
Language
Response
Click Try It! to start a request and see the response here!