Docs
Search…
API Reference
This section describes the endpoint.

livechat/upload/:rid

post
https://<BASE URL>api/v1/livechat/upload/:rid
Requires a path parameter and an authorized access token.

cURL Request

Refer to the following example cURL command that uploads a file from a system to a chat room:
1
curl 'https://techwritingchallenge.rocket.chat/api/v1/livechat/upload/general' \
2
-X POST \
3
-H 'Content-Type: application/json' \
4
-H "X-Auth-Token: 8nAQfgDpOR5I60CiyGu9L-3SXMsK6HB9CS7_1Y1Tv_X" \
5
-F '[email protected]/home/sugandhs/Pictures/RocketChat/Path.png' \
6
Copied!

cURL Response

Refer to the following example cURL response for the above request:
1
{
2
"message": {
3
"rid": "GENERAL",
4
"visitorToken": "8nAQfgDpOR5I60CiyGu9L-3SXMsK6HB9CS7_1Y1Tv_X",
5
"file": {
6
"name": "Path",
7
"size": 24,
8
"type": "image/png"
9
}
10
},
11
"success": true
12
}
Copied!

Error Codes

Refer to the following error codes that you may see when your cURL request has potential errors:
400
401
415
413
Bad request
Unauthorized access.
File type is not supported.
File size is too large.