how do I send images and files in Livechat through the rest api, I can only send text
curl -X POST -H “Content-type:application/json” http://localhost:3000/api/v1/livechat/message -d “{“token”: “$token”, “rid”: “$roomid”, “msg”: “$msg”}”
how do I send images and files in Livechat through the rest api, I can only send text
curl -X POST -H “Content-type:application/json” http://localhost:3000/api/v1/livechat/message -d “{“token”: “$token”, “rid”: “$roomid”, “msg”: “$msg”}”
Hi!
there is an undocumented endpoint at:
/livechat/upload/, the code is here:
I’ll try to open up an issue regarding this.
Also, at 3.18.1, it will result in a 500 error, even when the endpoint works great.
the error in logs is:
rocketchat_1 | TypeError: Cannot read property ‘statusCode’ of undefined
rocketchat_1 | at Array. (app/api/server/api.js:415:139)
rocketchat_1 | at Logger._log (app/logger/server/server.js:286:27)
rocketchat_1 | at Logger. [as info] (app/logger/server/server.js:101:22)
rocketchat_1 | at Object._internalRouteActionHandler [as action] (app/api/server/api.js:415:13)
rocketchat_1 | at Route.share.Route.Route._callEndpoint (packages/nimble_restivus/lib/route.coffee:150:32)
rocketchat_1 | at packages/nimble_restivus/lib/route.coffee:59:33
rocketchat_1 | at packages/simple_json-routes.js:98:9
there is an issue opened here: