0

we've set up triggered sends, and it works just fine... however, on occasion the BuildRowSetfromString fails because the delimiter is missing (for example, there are 3 products in the email, but only 2 values in one of the fields).

This causes our Triggered Send to error and pause the Triggers... which is expected.

However, is it possible to use the API to get the status and error of the post that failed?

As you can probably guess, I am not an API writer/expert!

1

There are different steps to email sends. However, in your case when an API request is made, the validation is first made on the authentication and data attributes. Once initial validation is successful then a response will be passed back to the invoker.

On the second step, the platform (SFMC) will try to validate the email with the data and possibly AMPscript in your case. This step is independent to the first API call you make to send an email.

To confirm the delivery report of the email send, you'd need to make a second API call to SFMC which is known as Get Email Delivery Details

Process:

  • Once the first API call is successful the response will contain a recipientSendId.
HTTP/1.1 202 Accepted
    {
       "requestId": "e2ddb203-ea53-4843-b2d4-9f8c0c862913",
       "responses": [   {
          "recipientSendId": "e2ddb203-ea53-4843-b2d4-9f8c0c862913",
          "hasErrors": false,
          "messages": ["Queued"]
       }]
    }
  • You'd then use the recipientSendId to make a second API call to validate the email send delivery report.
Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com
GET /messaging/v1/messageDefinitionSends/key:external_key/deliveryRecords/a7038ea5-51b7-4574-ac22-183654378dd2
Content-Type: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN
  • From this, you can confirm if the email send was successful by inspecting the response of the request.
HTTP/1.1 200 OK
{
    "deliveryTime": "2014-09-18T07:38:34.943",
    "id": "bd52a488-2f5c-de11-92ee-001cc494ae9e",
    "messageId": "a7038ea5-51b7-4574-ac22-183654378dd2",
    "status": "Sent",
    "to": {
        "address": "example@example.com",
        "id": 195711367,
        "key": "example@example.com"
    }
}

Reference:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.