SMS messages

  • JSON
  • XML

SMS messages

{{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 am9obi5zbWl0aDpteXBhc3N3b3Jk

x-api-key: your_api_key

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

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

 

{

"to" : "61400400400",

"subject" : "Test SMS Message",

"body" : "This is the body of my test SMS message"

}

{{codeEnd}}

Request Body Details

to

(required)

String

Ad-hoc recipients

  • Mobile phone: 61400400400
  • Landline phone: 61386000000

Defined Whispir recipients

  • Contact MRI:
    John_Smith.782749@Contact.whispir.com
  • User MRI:
    John_Smith@User.whispir.com
  • Distribution List MRI:
    Incidents.373947@List.whispir.com

subject

(required)

String

A description of the SMS message to be sent

body

(required)

String

The content of the SMS message, up to 1600 characters*

Notes:

  • SMS character counts are limited in some countries. Contact your local Whispir account manager for information about the supported number of characters in your region

  • MRI [Message Resource Identifier] is the unique Whispir address for the contact, user or distribution list

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