API Triggered Broadcasts - Common API errors

API Triggered Broadcasts - Common API errors


These are some common errors you might encounter when sending an API request to trigger an API Triggered Broadcast campaign, as well as the reasons you might be encountering them.

Method Not Allowed

Method Not Allowed

Reason: Possible misspelling of the request URI. The URI should look like the following (with the campaign id inserted): https://api.customer.io/v1/api/campaigns/:id/triggers

"status":"400"

{
  "errors":[
    {
      "detail":"bad request (reference 01C4MWXZPAR1SHBSZT4ZMZ6KZV)",
      "status":"400"
    }
  ]
}

Reason: Issues with the JSON formatting of the request. This could be mismatched opening or closing brackets, missing commas or quotes, etc.

"status":"401"

{
  "errors":[
    {
      "detail":"unauthorized",
      "status":"401"
    }
  ]

Reason: Incorrect site ID and/or API key. Double-check the spelling of both and ensure they are formatted correctly (e.g. -u YOUR-SITE-ID-HERE:YOUR-SECRET-API-KEY-HERE when using cURL).

"status":"403"

{
    "errors": [
        "failed to download data file, server responded with code 403 Forbidden"
    ],
    "next": 0
}

Reason: The URL or the credentials provided in data_file_url might be incorrect.

"status":"404"

{  
  "errors":[  
    {  
      "detail":"not found (reference 01C4MWKQA9XTFNYR68QB7JJ0XA)",
      "status":"404"
    }
  ]
}

Reason: Your campaign trigger id wasn’t found. You can double-check it by looking at your campaign's Triggering Details tab.

"status":"422"

{
  "errors":[
    {
      "detail":"recipients filter is not valid",
      "source":{
        "pointer":"/data/attributes/recipients"
      },
      "status":"422"
    }
  ]
}

{
    "errors": [
        {
            "detail": "exactly one of \"recipients\", \"ids\", \"emails\", \"per_user_data\", or \"data_file_url\" must be provided",
            "source": {
                "pointer": "/data/attributes/recipients"
            },
            "status": "422"
        }
    ]
}

Reason: An issue with the recipients JSON.

Likely causes:

  • Mistyped values
  • Improper or missing request headers when sending a JSON cURL request (-H "Content-Type: application/json”)
  • Sending ids, emails or recipients alongside per_user_data or data_file_url. You can only use one of these for a given broadcast.

Need help?

If you've encountered a different error, or need more help fixing one of these, please let us know!

Was this article helpful?