Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Latest commit

 

History

History
1014 lines (656 loc) · 35 KB

TransactionalMessagingApi.md

File metadata and controls

1014 lines (656 loc) · 35 KB

SalesforceMarketingCloud.TransactionalMessagingApi

All URIs are relative to https://www.exacttargetapis.com

Method HTTP request Description
createEmailDefinition POST /messaging/v1/email/definitions/ createEmailDefinition
createSmsDefinition POST /messaging/v1/sms/definitions createSmsDefinition
deleteEmailDefinition DELETE /messaging/v1/email/definitions/{definitionKey} deleteEmailDefinition
deleteQueuedMessagesForEmailDefinition DELETE /messaging/v1/email/definitions/{definitionKey}/queue deleteQueuedMessagesForEmailDefinition
deleteQueuedMessagesForSmsDefinition DELETE /messaging/v1/sms/definitions/{definitionKey}/queue deleteQueuedMessagesForSmsDefinition
deleteSmsDefinition DELETE /messaging/v1/sms/definitions/{definitionKey} deleteSmsDefinition
getEmailDefinition GET /messaging/v1/email/definitions/{definitionKey} getEmailDefinition
getEmailDefinitions GET /messaging/v1/email/definitions/ getEmailDefinitions
getEmailSendStatusForRecipient GET /messaging/v1/email/messages/{messageKey} getEmailSendStatusForRecipient
getEmailsNotSentToRecipients GET /messaging/v1/email/messages/ getEmailsNotSentToRecipients
getQueueMetricsForEmailDefinition GET /messaging/v1/email/definitions/{definitionKey}/queue getQueueMetricsForEmailDefinition
getQueueMetricsForSmsDefinition GET /messaging/v1/sms/definitions/{definitionKey}/queue getQueueMetricsForSmsDefinition
getSMSsNotSentToRecipients GET /messaging/v1/sms/messages/ getSMSsNotSentToRecipients
getSmsDefinition GET /messaging/v1/sms/definitions/{definitionKey} getSmsDefinition
getSmsDefinitions GET /messaging/v1/sms/definitions getSmsDefinitions
getSmsSendStatusForRecipient GET /messaging/v1/sms/messages/{messageKey} getSmsSendStatusForRecipient
partiallyUpdateEmailDefinition PATCH /messaging/v1/email/definitions/{definitionKey} partiallyUpdateEmailDefinition
partiallyUpdateSmsDefinition PATCH /messaging/v1/sms/definitions/{definitionKey} partiallyUpdateSmsDefinition
sendEmailToMultipleRecipients POST /messaging/v1/email/messages/ sendEmailToMultipleRecipients
sendEmailToSingleRecipient POST /messaging/v1/email/messages/{messageKey} sendEmailToSingleRecipient
sendSmsToMultipleRecipients POST /messaging/v1/sms/messages/ sendSmsToMultipleRecipients
sendSmsToSingleRecipient POST /messaging/v1/sms/messages/{messageKey} sendSmsToSingleRecipient

createEmailDefinition

EmailDefinition createEmailDefinition(body)

createEmailDefinition

Creates the definition for an email.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let body = new SalesforceMarketingCloud.EmailDefinition(); // EmailDefinition | JSON Parameters

apiInstance.createEmailDefinition(body).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
body EmailDefinition JSON Parameters

Return type

EmailDefinition

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

createSmsDefinition

SmsDefinition createSmsDefinition(body)

createSmsDefinition

Creates the definition for an SMS.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let body = new SalesforceMarketingCloud.SmsDefinition(); // SmsDefinition | JSON Parameters

apiInstance.createSmsDefinition(body).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
body SmsDefinition JSON Parameters

Return type

SmsDefinition

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

deleteEmailDefinition

DeleteSendDefinitionResponse deleteEmailDefinition(definitionKey)

deleteEmailDefinition

Deletes an email definition. You can't restore a deleted definition. The deleted definition is archived, and a delete location of the definition key is provided in the response for reference. You can reuse a deleted definition key because the information associated with it is copied to a new unique identifier.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let definitionKey = "definitionKey_example"; // String | Unique identifier of the definition to delete

apiInstance.deleteEmailDefinition(definitionKey).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
definitionKey String Unique identifier of the definition to delete

Return type

DeleteSendDefinitionResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

deleteQueuedMessagesForEmailDefinition

DeleteQueuedMessagesForSendDefinitionResponse deleteQueuedMessagesForEmailDefinition(definitionKey)

deleteQueuedMessagesForEmailDefinition

Deletes the queue for an email definition. The email definition must be in inactive status.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let definitionKey = "definitionKey_example"; // String | Unique identifier of the email definition

apiInstance.deleteQueuedMessagesForEmailDefinition(definitionKey).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
definitionKey String Unique identifier of the email definition

Return type

DeleteQueuedMessagesForSendDefinitionResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

deleteQueuedMessagesForSmsDefinition

DeleteQueuedMessagesForSendDefinitionResponse deleteQueuedMessagesForSmsDefinition(definitionKey)

deleteQueuedMessagesForSmsDefinition

Deletes the queue for a SMS definition. The SMS definition must be in inactive status.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let definitionKey = "definitionKey_example"; // String | Unique identifier of the SMS definition

apiInstance.deleteQueuedMessagesForSmsDefinition(definitionKey).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
definitionKey String Unique identifier of the SMS definition

Return type

DeleteQueuedMessagesForSendDefinitionResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

deleteSmsDefinition

DeleteSendDefinitionResponse deleteSmsDefinition(definitionKey)

deleteSmsDefinition

Deletes an sms definition. You can't restore a deleted definition. The deleted definition is archived, and a delete location of the definition key is provided in the response for reference. You can reuse a deleted definition key because the information associated with it is copied to a new unique identifier.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let definitionKey = "definitionKey_example"; // String | Unique identifier of the definition to delete

apiInstance.deleteSmsDefinition(definitionKey).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
definitionKey String Unique identifier of the definition to delete

Return type

DeleteSendDefinitionResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

getEmailDefinition

EmailDefinition getEmailDefinition(definitionKey)

getEmailDefinition

Gets email definition configuration details for a definition key.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let definitionKey = "definitionKey_example"; // String | Unique identifier of the definition to get

apiInstance.getEmailDefinition(definitionKey).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
definitionKey String Unique identifier of the definition to get

Return type

EmailDefinition

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

getEmailDefinitions

GetEmailDefinitionsResponse getEmailDefinitions(opts)

getEmailDefinitions

Gets a list of email definitions.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let opts = { 
  'filter': "filter_example", // String | Filter by status type. Accepted values are active, inactive, or deleted. Valid operations are eq and neq.
  'pageSize': 8.14, // Number | Number of definitions, which are array elements, to return per paged response.
  'page': 8.14, // Number | Page number to return.
  'orderBy': "orderBy_example" // String | Sort by a dimension. You can sort by only one dimension. Accepted values are definitionKey, name, createdDate, modifiedDate, and status.
};
apiInstance.getEmailDefinitions(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
filter String Filter by status type. Accepted values are active, inactive, or deleted. Valid operations are eq and neq. [optional]
pageSize Number Number of definitions, which are array elements, to return per paged response. [optional]
page Number Page number to return. [optional]
orderBy String Sort by a dimension. You can sort by only one dimension. Accepted values are definitionKey, name, createdDate, modifiedDate, and status. [optional]

Return type

GetEmailDefinitionsResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

getEmailSendStatusForRecipient

GetDefinitionSendStatusForRecipientResponse getEmailSendStatusForRecipient(messageKey)

getEmailSendStatusForRecipient

Gets the send status for a message. Because this route is rate-limited, use it for infrequent verification of a messageKey. To collect send status at scale, subscribe to transactional send events using the Event Notification Service.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let messageKey = "messageKey_example"; // String | Unique identifier to track message send status. You must provide it in singleton requests using the recipient attribute. To provide it in batch requests, use the recipients array attribute. If you don’t provide the message key for recipients, it’s generated in the response.

apiInstance.getEmailSendStatusForRecipient(messageKey).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
messageKey String Unique identifier to track message send status. You must provide it in singleton requests using the recipient attribute. To provide it in batch requests, use the recipients array attribute. If you don’t provide the message key for recipients, it’s generated in the response.

Return type

GetDefinitionSendStatusForRecipientResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

getEmailsNotSentToRecipients

GetDefinitionsNotSentToRecipientsResponse getEmailsNotSentToRecipients(type, opts)

getEmailsNotSentToRecipients

Gets a paginated list of messages that were not sent, ordered from oldest to newest.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let type = "type_example"; // String | Only notSent is supported.

let opts = { 
  'pageSize': 56, // Number | Number of messageKeys (array elements) to return per response page.
  'lastEventId': 56 // Number | Event ID from which you want the response to start. To obtain the initial event ID, submit a request without a lastEventId. The events in the response are listed top to bottom from oldest to newest.
};
apiInstance.getEmailsNotSentToRecipients(type, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
type String Only notSent is supported.
pageSize Number Number of messageKeys (array elements) to return per response page. [optional]
lastEventId Number Event ID from which you want the response to start. To obtain the initial event ID, submit a request without a lastEventId. The events in the response are listed top to bottom from oldest to newest. [optional]

Return type

GetDefinitionsNotSentToRecipientsResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

getQueueMetricsForEmailDefinition

GetQueueMetricsForSendDefinitionResponse getQueueMetricsForEmailDefinition(definitionKey)

getQueueMetricsForEmailDefinition

Gets metrics for the messages of an email definition. Applies to messages that are accepted but not yet processed.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let definitionKey = "definitionKey_example"; // String | Unique identifier of the email definition

apiInstance.getQueueMetricsForEmailDefinition(definitionKey).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
definitionKey String Unique identifier of the email definition

Return type

GetQueueMetricsForSendDefinitionResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

getQueueMetricsForSmsDefinition

GetQueueMetricsForSendDefinitionResponse getQueueMetricsForSmsDefinition(definitionKey)

getQueueMetricsForSmsDefinition

Gets metrics for the messages of a SMS definition. Applies to messages that are accepted but not yet processed.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let definitionKey = "definitionKey_example"; // String | Unique identifier of the SMS definition

apiInstance.getQueueMetricsForSmsDefinition(definitionKey).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
definitionKey String Unique identifier of the SMS definition

Return type

GetQueueMetricsForSendDefinitionResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

getSMSsNotSentToRecipients

GetDefinitionsNotSentToRecipientsResponse getSMSsNotSentToRecipients(type, opts)

getSMSsNotSentToRecipients

Gets a paginated list of messages that were not sent, ordered from oldest to newest.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let type = "type_example"; // String | Only notSent is supported.

let opts = { 
  'pageSize': 56, // Number | Number of messageKeys (array elements) to return per response page.
  'lastEventId': 56 // Number | Event ID from which you want the response to start. To obtain the initial event ID, submit a request without a lastEventId. The events in the response are listed top to bottom from oldest to newest.
};
apiInstance.getSMSsNotSentToRecipients(type, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
type String Only notSent is supported.
pageSize Number Number of messageKeys (array elements) to return per response page. [optional]
lastEventId Number Event ID from which you want the response to start. To obtain the initial event ID, submit a request without a lastEventId. The events in the response are listed top to bottom from oldest to newest. [optional]

Return type

GetDefinitionsNotSentToRecipientsResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

getSmsDefinition

SmsDefinition getSmsDefinition(definitionKey)

getSmsDefinition

Gets SMS definition configuration details for a definition key.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let definitionKey = "definitionKey_example"; // String | Unique identifier of the definition to get

apiInstance.getSmsDefinition(definitionKey).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
definitionKey String Unique identifier of the definition to get

Return type

SmsDefinition

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

getSmsDefinitions

GetSmsDefinitionsResponse getSmsDefinitions(opts)

getSmsDefinitions

Gets a list of SMS definitions.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let opts = { 
  'filter': "filter_example", // String | Filter by status type. Accepted values are active, inactive, or deleted. Valid operations are eq and neq.
  'pageSize': 8.14, // Number | Number of definitions, which are array elements, to return per paged response.
  'page': 8.14, // Number | Page number to return.
  'orderBy': "orderBy_example" // String | Sort by a dimension. You can sort by only one dimension. Accepted values are definitionKey, name, createdDate, modifiedDate, and status.
};
apiInstance.getSmsDefinitions(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
filter String Filter by status type. Accepted values are active, inactive, or deleted. Valid operations are eq and neq. [optional]
pageSize Number Number of definitions, which are array elements, to return per paged response. [optional]
page Number Page number to return. [optional]
orderBy String Sort by a dimension. You can sort by only one dimension. Accepted values are definitionKey, name, createdDate, modifiedDate, and status. [optional]

Return type

GetSmsDefinitionsResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

getSmsSendStatusForRecipient

GetDefinitionSendStatusForRecipientResponse getSmsSendStatusForRecipient(messageKey)

getSmsSendStatusForRecipient

Gets the send status for a message. Because this route is rate-limited, use it for infrequent verification of a messageKey. To collect send status at scale, subscribe to transactional send events using the Event Notification Service.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let messageKey = "messageKey_example"; // String | Unique identifier to track message send status. You must provide it in singleton requests using the recipient attribute. To provide message key in batch requests, use the recipients array attribute. If you don’t provide the message key for recipients, it’s generated in the response.

apiInstance.getSmsSendStatusForRecipient(messageKey).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
messageKey String Unique identifier to track message send status. You must provide it in singleton requests using the recipient attribute. To provide message key in batch requests, use the recipients array attribute. If you don’t provide the message key for recipients, it’s generated in the response.

Return type

GetDefinitionSendStatusForRecipientResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

partiallyUpdateEmailDefinition

EmailDefinition partiallyUpdateEmailDefinition(definitionKey, body)

partiallyUpdateEmailDefinition

Updates a specific email definition.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let definitionKey = "definitionKey_example"; // String | Unique identifier of the definition.

let body = new SalesforceMarketingCloud.UpdateEmailDefinitionRequest(); // UpdateEmailDefinitionRequest | JSON Parameters

apiInstance.partiallyUpdateEmailDefinition(definitionKey, body).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
definitionKey String Unique identifier of the definition.
body UpdateEmailDefinitionRequest JSON Parameters

Return type

EmailDefinition

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

partiallyUpdateSmsDefinition

SmsDefinition partiallyUpdateSmsDefinition(definitionKey, body)

partiallyUpdateSmsDefinition

Updates a specific SMS definition.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let definitionKey = "definitionKey_example"; // String | Unique identifier of the definition.

let body = new SalesforceMarketingCloud.UpdateSmsDefinitionRequest(); // UpdateSmsDefinitionRequest | JSON Parameters

apiInstance.partiallyUpdateSmsDefinition(definitionKey, body).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
definitionKey String Unique identifier of the definition.
body UpdateSmsDefinitionRequest JSON Parameters

Return type

SmsDefinition

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

sendEmailToMultipleRecipients

SendDefinitionToMultipleRecipientsResponse sendEmailToMultipleRecipients(body)

sendEmailToMultipleRecipients

Sends a message to multiple recipients using an email definition. You can provide a messageKey in the request; otherwise, the messageKey is automatically generated in the response.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let body = new SalesforceMarketingCloud.SendEmailToMultipleRecipientsRequest(); // SendEmailToMultipleRecipientsRequest | JSON Parameters

apiInstance.sendEmailToMultipleRecipients(body).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
body SendEmailToMultipleRecipientsRequest JSON Parameters

Return type

SendDefinitionToMultipleRecipientsResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

sendEmailToSingleRecipient

SendDefinitionToSingleRecipientResponse sendEmailToSingleRecipient(messageKey, body)

sendEmailToSingleRecipient

Sends a message to a single recipient via an email definition using a messageKey path parameter.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let messageKey = "messageKey_example"; // String | Unique identifier used to track message status. Can be automatically created when you create a message or provided as part of the request. Each recipient in a request must have a unique messageKey. If you use a duplicate messageKey in the same send request, the message is rejected.

let body = new SalesforceMarketingCloud.SendEmailToSingleRecipientRequest(); // SendEmailToSingleRecipientRequest | JSON Parameters

apiInstance.sendEmailToSingleRecipient(messageKey, body).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
messageKey String Unique identifier used to track message status. Can be automatically created when you create a message or provided as part of the request. Each recipient in a request must have a unique messageKey. If you use a duplicate messageKey in the same send request, the message is rejected.
body SendEmailToSingleRecipientRequest JSON Parameters

Return type

SendDefinitionToSingleRecipientResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

sendSmsToMultipleRecipients

SendDefinitionToMultipleRecipientsResponse sendSmsToMultipleRecipients(body)

sendSmsToMultipleRecipients

Sends a message to multiple recipients using an email definition. You can provide a messageKey in the request; otherwise, the messageKey is automatically generated in the response.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let body = new SalesforceMarketingCloud.SendSmsToMultipleRecipientsRequest(); // SendSmsToMultipleRecipientsRequest | JSON Parameters

apiInstance.sendSmsToMultipleRecipients(body).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
body SendSmsToMultipleRecipientsRequest JSON Parameters

Return type

SendDefinitionToMultipleRecipientsResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

sendSmsToSingleRecipient

SendDefinitionToSingleRecipientResponse sendSmsToSingleRecipient(messageKey, body)

sendSmsToSingleRecipient

Sends a message to a single recipient via a SMS definition using a messageKey path parameter.

Example

const SalesforceMarketingCloud = require ('salesforce-marketing-cloud-sdk');

let apiInstance = new SalesforceMarketingCloud.TransactionalMessagingApi();

let messageKey = "messageKey_example"; // String | Unique identifier of the definition used to track message status. The messageKey can be created automatically when you create a message, or you can provide it as part of the request. Each recipient in a request must have a unique messageKey. If you use a duplicate messageKey in the same send request, the message is rejected.

let body = new SalesforceMarketingCloud.SendSmsToSingleRecipientRequest(); // SendSmsToSingleRecipientRequest | JSON Parameters

apiInstance.sendSmsToSingleRecipient(messageKey, body).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
messageKey String Unique identifier of the definition used to track message status. The messageKey can be created automatically when you create a message, or you can provide it as part of the request. Each recipient in a request must have a unique messageKey. If you use a duplicate messageKey in the same send request, the message is rejected.
body SendSmsToSingleRecipientRequest JSON Parameters

Return type

SendDefinitionToSingleRecipientResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined