Overriding templates

Users can easily override the content of the message template by supplying the content inline with the request to the /messages endpoint. Thus, any information provided in the message request will take precedence over the templated content

All the features that are specified in the template [for example, any message aliasing or the content of those channels that were not overridden] will still be respected when the message is delivered

  • JSON
  • XML

{{codeStart}}

# To send a Message overriding a Template Message saved in a User-defined workspace

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

# To send a Message overriding a Template Message saved in 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",

"messageTemplateName" : "Sample Template",

"subject" : "This will override the Template subject",

"body" : "This will override the template SMS body"

}

{{codeEnd}}

Sample Response

202 - Accepted