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:
curl 'https://techwritingchallenge.rocket.chat/api/v1/livechat/upload/general' \
-X POST \
-H 'Content-Type: application/json' \
-H "X-Auth-Token: 8nAQfgDpOR5I60CiyGu9L-3SXMsK6HB9CS7_1Y1Tv_X" \
-F '[email protected]/home/sugandhs/Pictures/RocketChat/Path.png' \

cURL Response

Refer to the following example cURL response for the above request:
{
"message": {
"rid": "GENERAL",
"visitorToken": "8nAQfgDpOR5I60CiyGu9L-3SXMsK6HB9CS7_1Y1Tv_X",
"file": {
"name": "Path",
"size": 24,
"type": "image/png"
}
},
"success": true
}

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.