Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Status
subtletrue
colourYellow
titleAVAILABLE FROM VERSION 2.5.0

You can send a notification to an agent or a group of agents authenticated on the web interface by using the following API endpoint:

Code Block
languagexml
themeMidnight
POST /api/notifications


PARAMETERS 

...

width15%
text

...

TemplateId

view

...

recipients

recipientsDescription

beep

...

width60%
The content of the notification
TemplateIdId of the template used  as the notification's content
viewView object used to render the selected template
senderNameThe name of the sender (optional). Default: the name of the user sending the notification.
recipientsArray of recipients as string (see details)
recipientsDescriptionDescription of recipients

...

 that will be displayed in the notification title (optional)
beepEnable/Disable audio notification. Default: false



Info
titleRecipients

Anchor
Recipients
Recipients
The recipients array must contains at least one object structured as below:

Code Block
{
	"model": "user", 
	"ids": [1, 2]
}
  • model: identifies the entity group to which the notification will be sent
  • ids: a list of the selected model's resources' ids

The following models are supported: 

  • chatqueue
  • faxqueue
  • mailqueue
  • openchannelqueue
  • smsqueue
  • voicequeue
  • whatsappqueue
  • team
  • user


Note

If you specify as a model a queue or team that does not have any agents associated, no notification will be sent.


EXAMPLES

...

Sending a simple text notification

Image Added

Code Block
languagexml
themeConfluence
POST https://{host}/api/notifications

{
    "text": "Hello!",
    "recipients": "[{\"model\": \"user\", \"ids\": [1]}]",

   "recipientsDescription": "This is a description",
    "beep": false
}
Code Block
languagexml
themeFadeToGreyMidnight
curl httpshttp://{host}/api/notifications -d '[{"text": "Hello!", "recipients": "[{\"model\": \"user\", \"ids\": [1]}]", "recipientsDescription": "This is a description", "beep": "false"}]' -v -u {name}:{password} -X POSTH "Content-Type: application/json"


Using a template

Image Added

Code Block
languagexml
themeConfluence
POST https://{host}/api/notifications

{
    "TemplateId": 1,
    "view": {"content": "Hello!"},
    "recipients": "[{\"model\": \"userteam\", \"ids\": [1]}, {\"model\": \"voiceQueue\", \"ids\": [2,3]}]",
    "recipientsDescription": "ThisGroup isof a descriptionagents",
    "beep": true
}
Code Block
languagexml
themeFadeToGreyMidnight
curl https://{host}/api/notifications -d '[{"TemplateId": "1", "view": {"textcontent": "Hello!"}, "recipients": "[{\"model\": \"userteam\", \"ids\": [1]}, {\"model\": \"voiceQueue\", \"ids\": [2,3]}]", "recipientsDescription": "ThisGroup isof a descriptionagents", "beep": "falsetrue"}]' -v -u {name}:{password} -H "Content-X POSTType: application/json"