Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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

POST /api/notifications


PARAMETERS 


text

TemplateId

view

senderName

recipients

recipientsDescription

beep

The content of the notification

Id of the template used  as the notification's content

View object used to render the selected template

The name of the sender (optional). Default: the name of the user sending the notification.

Array of recipients as string 

Description of recipients (optional)

Enable/Disable audio notification. Default: false



Recipients

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

{
	"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
  • team
  • user


EXAMPLES


Sending a simple text notification

POST https://{host}/api/notifications

{
    "text": "Hello!",
    "recipients": "[{\"model\": \"user\", \"ids\": [1]}]",
    "recipientsDescription": "This is a description",
    "beep": false
}
curl https://{host}/api/notifications -d '[{"text": "Hello!", "recipients": "[{\"model\": \"user\", \"ids\": [1]}]", "recipientsDescription": "This is a description", "beep": "false"}]' -v -u {name}:{password} -X POST


Using a template

POST https://{host}/api/notifications

{
    "TemplateId": 1,
    "view": {"content": "Hello!"},
    "recipients": "[{\"model\": \"user\", \"ids\": [1]}, {\"model\": \"voiceQueue\", \"ids\": [2,3]}]",
    "recipientsDescription": "This is a description",
    "beep": true
}
curl https://{host}/api/notifications -d '[{"text": "Hello!", "recipients": "[{\"model\": \"user\", \"ids\": [1]}]", "recipientsDescription": "This is a description", "beep": "false"}]' -v -u {name}:{password} -X POST



  • No labels