Preview SMS Campaign Message

Use this interface to preview an SMS message sent to a recipient. The SMS Campaign templates supported are: Broadcast, Direct API Notification, SMS Opt Out , and Custom.

A successful response returns a preview of the SMS campaign message.

Note: The Responsys Advanced API is generally available for all Responsys customers.

Service URL:

/rest/api/sms/v1.3/campaigns/{CampaignName}/preview

Required Path Parameters:

  • campaignName - Name of the SMS campaign to preview.

Request Method:

POST

Request Header:

Authorization=<AUTH_TOKEN>

Content-Type=application/json

Request Body - Required Properties:

  • matchKey – A match key to be used to match the recipient record, possible values include: EMAIL_ADDRESS_ , MOBILE_NUMBER_ , RIID_ , or CUSTOMER_ID_.

    Mobile Numbers must be in E164 format.

  • matchValue– The value corresponding to the match key.

  • optionalData– Optional data to specify with the request.

Sample Request Body

{
  {
    "matchKey": "RIID_",
    "matchValue": "40196367",
    "optionalData": [
      {
        "name": "FIRST_NAME",
        "value": "jim_1"
      },
      {
        "name": "LAST_NAME",
        "value": "smith_1"
      }
    ]
  }

Sample Response Body

{
    "preview": [
        {
            "riid": 40196367,
            "message": "Consider campaign Successful_Bill_Payment_Copy wherein text is as shown\nYour payment towards your BILLER_NAME bill of  Amount has been\ncompleted successfully. Please visit https://example.com/?ODY2L0WXCC for your\nreceipt.",
            "splitCount": 4
        }
    ]
}

Sample Error Responses

This section lists possible error responses when using this endpoint.

Campaign not found: Requests fail if the campaign name specified cannot be found in Responsys. The error resembles:

{
  "type": "",
  "title": "Campaign not found",
  "errorCode": "CAMPAIGN_NOT_FOUND",
  "detail": "[ Campaign1] Campaign Not Found",
  "errorDetails": []
}

Record not present in DB: Requests fail if there is no matching record found given the match criteria. The error resembles:

{
    "type": "",
    "title": "Invalid request parameters",
    "errorCode": "INVALID_PARAMETER",
    "detail": "No records found for given match criteria",
    "errorDetails": []
}

Incorrect Match Key passed: Requests fail when an invalid match key is given the request body. The error resembles:

{
    "type": "",
    "title": "Invalid request parameters",
    "errorCode": "INVALID_PARAMETER",
    "detail": "Match Key [ XYZ ] not supported",
    "errorDetails": []
}

Incorrect RIID passed: Requests fail when an incorrect RIID is specified in the request. The error resembles:

{
    "type": "",
    "title": "Invalid request parameters",
    "errorCode": "INVALID_PARAMETER",
    "detail": "RIID is not a valid number",
    "errorDetails": []
}

Incorrect mobile number passed: Requests fail if an incorrect mobile number is specified in the request. The error resembles:

{
    "type": "",
    "title": "Invalid request parameters",
    "errorCode": "INVALID_PARAMETER",
    "detail": "Mobile Number [ 40196367 ] is not valid",
    "errorDetails": []
}

Optional Data key / value is empty: Requests fail if an invalid value is given for any optional data fields. The error resembles:

{
    "type": "",
    "title": "Invalid request parameters",
    "errorCode": "INVALID_PARAMETER",
    "detail": "Optional data field is empty or null",
    "errorDetails": []
}

Duplicate optional data names specified: Requests fail if duplicate names are specified in the optional data section. The error resembles:

{
  "type": "",
  "title": "Invalid request parameters",
  "errorCode": "INVALID_PARAMETER",
  "detail": "Optional data field is empty or null",
  "errorDetails": []
}

 

Learn more

Trigger SMS message

Trigger email message

Merge members into a profile list and trigger email messages with attachments