Jump to: navigation, search

SendMessage

This operation is part of the IM Session API section of the Web Services API.

Overview

Sends a message to the other participants in the IM session.

Request URL /api/v2/me/im-sessions/{id}
HTTP Method POST
Required Features api-voice-instant-messaging

Parameters

Parameter Value
operationName SendMessage
text The message text to send. (mandatory)
destination The number to reach. This should represent a SIP extension that supports IM. (mandatory)

To enable IM communication, both agents must be logged in on a place with a SIP multimedia DN — that is, a SIP DN configured with the following Annex options in the [TServer] section:

  • multimedia option set to true
  • sip-signalling-chat option set to none
devicePath The path to a device assigned to the current user that is to be used for the operation. (mandatory)

Samples

Request

POST /api/v2/me/im-sessions/00446K0L8GAC3B9R8O7GK2LAES00000D
{
  "operationName": "SendMessage",
  "text": "Hello! This is my first message.",
  "destination": 
  {
    "phoneNumber": "16001"
  },
  "devicePath": "/devices/8191741c-bcb7-4e86-9493-98dc993446f"
}

HTTP Response

{
  "statusCode": 0
}

CometD Response

{  
   "messageType": "IMLogUpdateMessage",
   "notificationType": "NewMessage",
   "imSessionPath": "/im-sessions/12398123091823091283012",
   "message":"Hello! This is my first message."
}

Feedback

Comment on this article:

blog comments powered by Disqus
This page was last modified on January 22, 2016, at 11:56.