Response

The API response provides information about the status of a campaign and related details. The response is in JSON format and includes key data points related to the campaign.

The response consists of a JSON object with a "data" array containing campaign information. Below is a breakdown of the key fields:

  • campaignId: Unique identifier for the campaign.

  • campaignName: The name of the campaign (e.g., "campaign_test").

  • campaignVersion: Version identifier for the campaign.

  • sendoutId: Unique identifier for the sendout associated with the campaign.

  • status: The status of the campaign (e.g., "updated", "created").

  • acceptedCount: Number of accepted responses.

  • rejectedCount: Number of rejected responses.

  • error: An optional field indicating any errors encountered during the campaign processing. It is set to null if no errors occurred.

Examples:

Simple body request:

{
    "entries": [
        {
            "client": "+123456789",
            "campaignName": "campaign_test",
            "variables": {
                "client": "pablo",
                "name": "test2"
            }
        }
    ]
}

Response:

{
    "data": [
        {
            "campaignId": "2963626c-90ea-43e5-9b66-4ce70f003fe3",
            "campaignName": "campaignv3",
            "campaignVersion": "018c5c51-8631-28b5-3c81-b70ecf14faef",
            "sendoutId": "183e801b-1438-4177-b283-909135096e69",
            "status": "created",
            "acceptedCount": 1,
            "rejectedCount": 0,
            "error": null
        }
    ]
}

If you send the campaign again the status shows as Updated:

{
    "data": [
        {
            "campaignId": "2963626c-90ea-43e5-9b66-4ce70f003fe3",
            "campaignName": "campaignv3",
            "campaignVersion": "018c5c51-8631-28b5-3c81-b70ecf14faef",
            "sendoutId": "183e801b-1438-4177-b283-909135096e69",
            "status": "updated",
            "acceptedCount": 1,
            "rejectedCount": 0,
            "error": null
        }
    ]
}

If you send body without entries:

        {
            "client": "+123456789",
            "campaignName": "campaignv3",
            "variables": {
                "client": "pablo",
                "name": "test2"
            },
            "campaignVersion": "018c4a55-f3df-580c-1629-602f3b14d190"
        }

The response its going to be empty too:

{
    "data": []
}

If you specify a wrong campaign name:

{
    "entries": [
        {
            "client": "+123456789",
            "campaignName": "campaña",
            "variables": {
                "client": "pablo",
                "name": "test2"
            }
        }
    ]
}

You will get the error detail:

{
        "data": [
        {
            "campaignId": null,
            "campaignName": "campaña",
            "campaignVersion": null,
            "sendoutId": null,
            "status": "error",
            "acceptedCount": 0,
            "rejectedCount": 1,
            "error": {
                "message": "Campaign not found",
                "type": "ERROR_TYPE_NOT_FOUND",
                "code": "ERROR_CODE_CAMPAIGN_NOT_FOUND",
                "userTitle": "Campaign not found",
                "userMessage": "Please review the campaign name and/or campaign id."
            }
        }
    ]
}

If you specify a wrong campaign version:

{
    "entries": [
        {
            "client": "+123456789",
            "campaignName": "campaignv3",
            "variables": {
                "client": "pablo",
                "name": "test2"
            },
            "campaignVersion": "018c4a55-f3df-580c-1629-602f3b14d190"
        }
    ]
}

You will get the error detail:

{
    "data": [
        {
            "campaignId": "2963626c-90ea-43e5-9b66-4ce70f003fe3",
            "campaignName": "campaignv3",
            "campaignVersion": "018c4a55-f3df-580c-1629-602f3b14d190",
            "sendoutId": null,
            "status": "error",
            "acceptedCount": 0,
            "rejectedCount": 1,
            "error": {
                "message": "Campaign version not found",
                "type": "ERROR_TYPE_NOT_FOUND",
                "code": "ERROR_CODE_CAMPAIGN_VERSION_NOT_FOUND",
                "userTitle": "Campaign version not found",
                "userMessage": "Please review the campaign version."
            }
        }
    ]
}

If you don't specify all the variables:

{
    "entries": [
        {
            "client": "+123456789",
            "campaignName": "campaignv3",
            "variables": {
                "client": "pablo"
            }
        }
    ]
}

You will get the error detail:

{
    "data": [
        {
            "campaignId": "2963626c-90ea-43e5-9b66-4ce70f003fe3",
            "campaignName": "campaignv3",
            "campaignVersion": "018c5c51-8631-28b5-3c81-b70ecf14faef",
            "sendoutId": "183e801b-1438-4177-b283-909135096e69",
            "status": "error",
            "acceptedCount": 0,
            "rejectedCount": 1,
            "error": {
                "message": "Campaign entry is invalid",
                "type": "ERROR_TYPE_INVALID_REQUEST",
                "code": "ERROR_CODE_CAMPAIGN_ENTRY_INVALID",
                "userTitle": "Campaign entry is invalid",
                "userMessage": "Please check the inputs to the campaign entry."
            }
        }
    ]
}

Last updated