Skip to content

Latest commit

 

History

History
100 lines (75 loc) · 4.14 KB

File metadata and controls

100 lines (75 loc) · 4.14 KB

Update Livechat Room

Edit a LiveChat room. Update the topic, tags, and other details of a Livechat room.

{% hint style="info" %} It requires the view-l-room permission. {% endhint %}

HTTP MethodURLRequires Auth
POSTapi/v1/livechat/room.saveInfoyes

Body

KeyExample ValueDescription
guestData*

"guestData" : {

"_id": "rbAXPnMktTFbNpwtJ" }

An object of the updated guestdata.
roomData*

"roomData" : {

"_id": "nf52k8bpJ8y7oHmwk", "topic": "Hmm",

"tags": ["testtags"] }

An object of updated roomdata.

guestData Object

KeyExample ValueDescription
_id*rbAXPnMktTFbNpwtJThe guest ID.
namejohnThe name of the guest.
emailjohn.test@rocket.chatThe email of the guest.
phone4478390282The contact of the guest.
livechatData

"livechatData" :

{ "id1": "value1", "id2": "value2" }

Custom fields information.

roomData Object

KeyExample ValueDescription
_id*rbAXPnMktTFbNpwtJThe room ID.
topicTest123The topic of the room.
tags["testtags"]An array of tags to be associated with the room.
priorityId5PMgshbQWsoHsYy2cThe priority ID of the room.
slaId6417f67528384134ed600dc6The SLA priority ID of the room.
livechatData"livechatData" : { "id1": "value1", "id2": "value2"}Custom fields information.

Example Body

{
"guestData": {
		"_id": "rbAXPnMktTFbNpwtJ"

	},
"roomData": {
		"_id": "nf52k8bpJ8y7oHmwk",
		"topic": "Hmm",
		"tags": ["testtags"]
	}
}

Example Call

curl --location 'http://localhost:3000/api/v1/livechat/room.saveInfo' \
--header 'x-auth-token: Wnb_e6wG4a74JiMxpSogmn9iP-K6wGk2F09sDRwLiLq' \
--header 'x-user-id: rbAXPnMktTFbNpwtJ' \
--header 'Content-Type: application/json' \
--data '{
"guestData": {
		"_id": "rbAXPnMktTFbNpwtJ"

	},
"roomData": {
		"_id": "nf52k8bpJ8y7oHmwk",
		"topic": "Hmm",
		"tags": ["testtags"]
	}
}'

Example Response

Success

{
    "success": true
}

Error

Any of the following errors can occur on the endpoint.

  • Authorization: Requires an authentication token for the request to be made.
  • Invalid Room: Occurs when the given _id in roomData object is invalid and doesn't belong to any room in the workspace.

{% tabs %} {% tab title=" Authorization" %}

{
    "status": "error",
    "message": "You must be logged in to do this."
}

{% endtab %}

{% tab title="Invalid Room ID" %}

{
    "success": false,
    "error": "error-invalid-room"
}

{% endtab %} {% endtabs %}

Change Log

Version Description
5.3.0 Added