POST /messaging/v1/sms/definitions
Creates a send definition.
Name | Type | Description | |
---|---|---|---|
definitionKey | string | Required | Unique, user-generated key to access the definition object. |
name | string | Required | Name of the definition. Must be unique. |
content.message | string | Required | The message content that you want sent with each message. Use substitution strings and AMPscript to personalize the message. |
status | string | Operational state of the definition: active, inactive, or deleted. A message sent to an active definition is processed and delivered. A message sent to an inactive definition isn’t processed or delivered. Instead, the message is queued for later processing for up to three days. | |
description | string | User-provided description of the send definition. | |
subscriptions.shortCode | string | Required | The short or long code for the mobile transmissions for each message on this definition. |
subscriptions.countryCode | string | The country code associated with the shortCode for the mobile transmissions for each message on this definition. Don't use for long codes, unless your account configuration requires it. | |
subscriptions.keyword | string | Required | The keyword used to track messages |
subscriptions.autoAddSubscriber | boolean | Allows you to add a recipient as subscriber against the shortCode using contactKey. When false, the message is rejected if contactKey doesn’t exist as a subscriber. Default is true. | |
options.urlShortenerOptions.IsLinkShorteningEnabled | boolean | Indicates if URL shortening is enabled for URLs in the message body. The values are true and false . | |
options.urlShortenerOptions.isSubscriberTrackingEnabled | boolean | Indicates if subscriber level tracking is enabled for URLs in the message body. The values are true and false . The value is true if the value of shortenerType is SFMC . | |
options.urlShortenerOptions.shortenerType | string | The type of URL shortener. The values is SFMC . | |
options.SmsMessageRegulatoryAuthorityTemplateId | string | The ID of the DLT template used in the SMS. This attribute is available only for customers in India. |
Status | Name | Type | Description |
---|---|---|---|
201 | Send definition is created. Review example response. | ||
requestId | string | The unique identifier of this request. | |
name | string | Name of the definition. | |
definitionKey | string | Unique, user-generated key to access the definition object. | |
definitionId | string | A unique object identifier. | |
description | string | User-provided description of the send definition. | |
status | string | Operational state of the definition: active, inactive, or deleted. A message sent to an active definition is processed and delivered. A message sent to an inactive definition isn’t processed or delivered. Instead, the message is queued for later processing for up to three days. | |
createdDate | string | Date the definition was created. | |
modifiedDate | string | Date and time the definition was most recently changed. | |
content.message | string | The message content that you want sent with each message. Use substitution strings and AMPscript to personalize the message. | |
subscriptions.shortCode | string | The short or long code for the mobile transmissions for each message on this definition. | |
subscriptions.countryCode | string | The country code associated with the shortCode for the mobile transmissions for each message on this definition. Don't use for long codes, unless your account configuration requires it. | |
subscriptions.keyword | string | The keyword used to track messages | |
subscriptions.autoAddSubscriber | boolean | Allows you to add a recipient as subscriber against the shortCode using contactKey. When false, the message is rejected if contactKey doesn’t exist as a subscriber. Default is true. | |
subscriptions.updateSubscriber | boolean | Updates the recipient subscriber data including mobile number. Default is true. | |
options.urlShortenerOptions.IsLinkShorteningEnabled | boolean | Indicates if URL shortening is enabled for URLs in the message body. The values are true and false . | |
options.urlShortenerOptions.isSubscriberTrackingEnabled | boolean | Indicates if subscriber level tracking is enabled for URLs in the message body. The values are true and false . The value is true if the value of shortenerType is SFMC . | |
options.urlShortenerOptions.shortenerType | string | The type of URL shortener. The values is SFMC . | |
options.SmsMessageRegulatoryAuthorityTemplateId | string | The ID of the DLT template used in the SMS. |
If autoAddSubscriber
is passed as true
, then updateSubscriber
must be set to false
.
Failing to do so results in the return of an error "{ "message": "MCMS_UTM_Validation_InvalidValue: autoAddSubscriber needs to be enabled if updateSubscribers is true.", "errorcode": 10005, "documentation": "" }
".
To associate a short code to a send definition, use the alphabetic countryCode
and numeric shortCode
attributes.
The response includes information about the send definition.
To associate a long code or international phone number to a send definition, add the numeric country code at the beginning of the phone number. Then, use this number as the shortCode
attribute. Don't use the alphabetic countryCode
attribute unless your account configuration requires it.
Response | Reason |
---|---|
201 Created | Send definition is created. Review example response. |
409 Conflict | Send definition exists on the server. |
400 Bad Request | Invalid request. |
403 Forbidden | Failed to pass authorization. |
500 Server Error | Internal error. |