MessagingResource Resource

Messaging resource to access the inbox (list, view, mark read, delete) and send messages

GET /msg/list

List messages for the current user

Request Parameters
name type description default constraints
unread query true if only unread messages shall be shown, false for all messages (default) false boolean
Response Codes
code condition
200 Message list is returned.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json GenericResponse (JSON) response containing the messages

Example

Request
GET /msg/list
Content-Type: application/json
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

POST /msg/read

Set messages to be read

Request Body
media type data type description
application/json MessagesReadRequest (JSON) request containing the list of messages to be set read
Response Codes
code condition
200 Messages were set to be read.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json GenericResponse (JSON) generic response

Example

Request
POST /msg/read
Content-Type: application/json
Accept: application/json

                
{
  "messages" : [ 12345, 12345 ]
}
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

POST /msg/send

Send a message to users/groups

Request Body
media type data type description
application/json MessageSendRequest (JSON) request to send messages
Response Codes
code condition
200 Message was sent.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json GenericResponse (JSON) generic response

Example

Request
POST /msg/send
Content-Type: application/json
Accept: application/json

                
{
  "message" : "...",
  "translations" : {
    "property1" : "...",
    "property2" : "..."
  },
  "parameters" : [ "...", "..." ],
  "toGroupId" : [ 12345, 12345 ],
  "toUserId" : [ 12345, 12345 ],
  "instantTimeMinutes" : 12345
}
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

DELETE /msg/{id}

Delete message with given ID

Request Parameters
name type description constraints
id path message id required int
Response Codes
code condition
204 Message {id} was deleted.
404 Message {id} does not exist.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
Response Body
media type data type description
application/json object (JSON) response

Example

Request
DELETE /msg/{id}
Content-Type: application/json
Accept: application/json

                
...
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
...