Send a message

post

/rest/ofscCollaboration/v1/chats/{chatId}/messages

This operation sends a message to an existing chat.

Request

Supported Media Types
Path Parameters
Body ()
The schema of the request body object for this operation.
Root Schema : SendMessageRequest
Type: object
The schema of the request body object for this operation.
Show Source
Nested Schema : Attachment
Type: object
Show Source
Nested Schema : ImageContent
Type: object
Show Source
Back to Top

Response

Supported Media Types

201 Response

This section describes the 201 status response for this operation. This response code indicates that the message was sent successfully.
Body ()
Root Schema : SendMessageResponse
Type: object
The response body object for this operation.
Show Source

Default Response

This section describes the default error response for this operation.
Body ()
Root Schema : Error
Type: object
Show Source
Back to Top

Examples

The following example shows how to send a message to an existing chat by submitting a POST request on the REST resource:

cURL command Example

The following shows an example of the cURL command.

curl -X POST "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCollaboration/v1/chats/1/messages" -H "Accept: application/json" -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...p6aZOp6sT1k3j-7WIlK6bbbLg" -H "Content-Type: application/json" -d "{\"text\" : \"Message Text\"}"

Response Header Example

The following shows an example of the response header.

HTTP/1.1 200 OK
Server: nginx
Date: Thu, 22 Apr 2019 16:28:18 GMT
Content-Type: application/json; charset=utf-8
Connection: close

Response Body Example

The following shows an example of the response body in JSON format.

{
    "chatId": 1,
    "text": "Message Text",
    "author": "williams",
    "time": "2019-04-22 09:47:34",
    "sequenceNumber": 6,
    "messageId": 6
}
Back to Top