POST /sms/v1/automation/importSend

Overview 

Imports the contact file and data extension, and then sends the message. This API is only supported for Outbound Message template.

JSON Parameters 

NameTypeDescription
messageIdstringRequiredEncoded message Id
keywordstringRequiredA valid keyword on the shortcode for the message to opt the numbers on to
notificationEmailstringIf specified, email notifications will be sent on import and program completion
overridebooleanFlag to indicate whether the override text should be used
overrideTextstringText to override the existing message.
isDuplicationAllowedbooleanIf true, duplicate messages may be sent
isVisiblebooleanIf specified true, the import definition and list created will be visible
importDefinitionstringRequiredList of Import Definitions to be created (currently limited to 1)

Usage 

Example Request for FILE ImportType

1Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com
2POST /sms/v1/automation/importSend
3Content-Type: application/json
4Authorization: Bearer YOUR_ACCESS_TOKEN
5
6{
7  "MessageId": "MessageId",
8  "Keyword": "Test_Keyword",
9  "NotificationEmail": "myEmail@example.com",
10  "IsDuplicationAllowed" : true,
11  "ImportDefinition": [{
12    "FileName": "MyTestList.csv",
13    "ImportType": "FILE",
14    "ImportMappingType": "ManualMap",
15    "FieldMaps": [{
16      "Destination": "_FirstName",
17      "Source": "First Name"
18    }, {
19      "Destination": "_Subscriberkey",
20      "Source": "Subscriber Key"
21    }, {
22      "Destination": "_LastName",
23      "Source": "Last Name"
24    }, {
25      "Destination": "_MobileNumber",
26      "Source": "Mobile"
27    }, {
28      "Destination": "_CountryCode",
29      "Source": "Country"
30    }]
31  }]
32}

Example Request for DATA_EXTENSION ImportType

1Host: https://YOUR_SUBDOMAIN.rest.marketingcloudapis.com
2POST /sms/v1/automation/importSend
3Content-Type: application/json
4Authorization: Bearer YOUR_ACCESS_TOKEN
5
6{
7  "MessageId": "MessageId",
8  "Keyword": "Test_Keyword",
9  "NotificationEmail": "myEmail@example.com",
10  "Override": true,
11  "OverrideText": "Override Text for Demo!",
12  "IsDuplicationAllowed" : true,
13  "ImportDefinition": [{
14    "ImportType": "DATA_EXTENSION",
15    "ImportMappingType": "InferFromColumnHeadings",
16    "DataExtensionName": "MyDataExtension",
17    "IsFirstRowHeader": true
18  }]
19}

Example Response

1HTTP/1.1 202 Accepted
2{
3    "tokenId": "NDo8NDow",
4    "lastPublishDate": "2012-12-18T15:38:12.030Z"
5}

DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!