Scenarios

Updating a scenario

To update an existing scenario you can use a PUT request to the /scenarios endpoint.

The following fields are required:

  • name: The name of the scenario.
  • description: The details of the scenario.
  • message { to, subject, body }.

High-level request elements

name

String

Specifies the name of the scenario.

description

String

Specifies the description of the scenario.

createdTime

Number

Specifies the scenario created time value in Epoch.

allowedUsers

String

Specifies the usage permission:

  • EVERYONE
  • SELECTEDUSERS

When SELECTEDUSERS is provided, then ‘allowedUserIds’ shall contain the userID of the allowed users.

allowedUserIds

String

Specifies the comma separated list of users who can run this scenario.

Only contains value when allowedUsers is set to ‘SELECTEDUSERS’.

message

Object

Specifies the messaging options.

to

String

Specifies the phone number or MRI or distribution list to which the message has to be sent.

subject

String

Specifies the subject of the message.

body

String

Specifies the body of the message.

label

String

Specifies the label for the message (to view during reporting).

email

Object

Email message that can be sent as part of this scenario:

  • body: The main content of the email.
  • footer: The email footer.
  • type: Text/plain or text/HTML.

voice

Object

Similar to a text message, a voice call can also be triggered. This provides the necessary information for the channel.

  • header: Header for message. This will be played before the subject.
  • body: The main content of the message.
  • footer: The message footer. Played after the body. Usually contains a thank-you note.
  • type: ConfCall:, ConfAccountNo:, ConfPinNo:, ConfModPinNo:, Pin:

web

Object

See Web and social messaging. The web message structure remains exactly the same.

social

Object

See Web and social messaging. The social message structure remains exactly the same.

from

String

The user/contact that the communication will be sent from when the scenario is run.

Example:
joe.bloggs.company@Contact.Melbourne.whispir.au

  • JSON
  • XML

Updating a scenario

The following API calls allow users to update scenarios using the Whispir API:

{{codeStart}}

HTTP 1.1 PUT https://api.<region>.whispir.com/scenarios/F0547F6F2E4839F8?apikey=[your_api_key]

Authorization: Basic am9obi5zbWl0aDpteXBhc3N3b3Jk

x-api-key: your_api_key

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

{

"title": "Emergency Comms - Fire",

"description": "Scenario to use during fire evacuation",

"allowedUsers": "EVERYONE",

"message": {

"to": "+1000000000",

"subject": "Scenario Emergency Comms - Fire",

"body": "Evacuate the building Immediately. Do not use the lifts.",

"label": "",

"voice": {},

"from": "joe.bloggs.company@Contact.Melbourne.whispir.au",

"social": {

"social": [

{

"id": "socialType",

"body": "text/plain"

}

]

}

}

}

{{codeEnd}}