Distribution lists

Sending messages to distribution lists

Sending a message to a distribution list is straightforward. The distribution list is specified with the MRI value which can be found when retrieving the Distribution Lists

IMPORTANT: the following API uses the /messages endpoint and its headers. Since the Workspaces are siloed please ensure that the message will get sent from the same Workspace where the Distribution List has been created

  • JSON
  • XML

{{codeStart}}

# To send from a User-defined workspace

POST https://api.<region>.whispir.com/workspaces/:workspace_id/messages

# To send from the default workspace

POST https://api.<region>.whispir.com/messages

 

Authorization: Basic asdf98nf89asdvasd2r398h8sdf

x-api-key: your_api_key

Content-Type: application/vnd.whispir.message-v1+json

Accept: application/vnd.whispir.message-v1+json

 

{

"to" : "Docs_Distribution_List.company@list.company.whispir.sg",

"subject" : "Simple SMS to list of contacts in the distribution list",

"body" : "This is the content of my sample SMS message."

}

{{codeEnd}}

Sample Response

202 - Accepted

In this case the Location header in the Response Headers will show the direct link to the message. Depending on the endpoint of choice we will respectively have:

https://api.<region>.whispir.com/workspaces/:workspace_id/messages/:message_id

https://api.<region>.whispir.com/messages/:message_id

NOTE: if the Location Header containing the message_id wasn't collected at the time of sending please refer to Retrieve a previously sent message. This process is same for SMS, email, voice and push notifications