Start a new chat

post

/rest/ofscCollaboration/v1/chats

This operation creates a new chat with another user, helpdesk or a conference chat with a group of users.

Request

Supported Media Types
Body ()
The schema of the request body object for this operation.
Root Schema : StartChatRequest
Type: object
The schema of the request body object for this operation.
Show Source
Nested Schema : Attachment
Type: object
Show Source
Nested Schema : recipients
Type: array
Minimum Number of Items: 1
The login of the message recipients in the chat.
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 operation completed successfully.
Body ()
Root Schema : StartChatResponse
Type: object
The details of the new chat.
Show Source
  • The unique identifier of the chat in Oracle Field Service.
  • participants
    Link to participant of the chat
  • The login of the user who started the chat. This field is present only for the chats started by a user.
  • The time (in UTC time zone) when the chat started. The time is in 'YYYY-MM-DD HH:MM:SS' format.
  • Allowed Values: [ "normal", "conference" ]

    The type of the chat. The possible values of this field are:

    • normal - A chat between two participants
    • conference - A chat with more than two participants
Nested Schema : participants
Type: array
Link to participant of the chat
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 create a chat with another user or a group of users by submitting a POST request on the REST resource:

cURL command Example

The following shows an example of the cURL command for a normal chat.

curl -X POST "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCollaboration/v1/chats" -H "Accept: application/json" -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...W7B2fXbKpLz1m-sCG9QQA" -H "Content-Type: application/json" -d "{\"text\" : \"text message\", \"recipients\" : [\"smith\"]}"

The following shows an example of the cURL command for a conference chat.

curl -X POST "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCollaboration/v1/chats" -H "Accept: application/json" -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9...W7B2fXbKpLz1m-sCG9QQA" -H "Content-Type: application/json" -d "{\"text\" : \"test message\", \"recipients\" : [\"miller\", \"smith\"]}"

Response Header Example

The following shows an example of the response header.

HTTP/1.1 201 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": 2,
    "type": "normal",
    "startedBy": "williams",
    "startedTime": "2019-04-22 11:46:58",
    "participants": {
        "links": [
            {
                "rel": "canonical",
                "href": "https://<instance_name>.fs.ocs.oraclecloud.com/rest/ofscCollaboration/v1/chats/2/participants"
            }
        ]
    }
}
Back to Top