Discussions

Ask a Question
Back to All

Issues sending and retrieving messages

Having some trouble with sending and retrieving messages.

First example I try to send a message to a room previously created called "API Test Room". Here's what I see:

curl --request POST
--url https://api.8x8.com/chat/api/chat/v1/messages/
--header 'accept: /'
--header 'content-type: application/json'
--header 'x-api-key: my-API-key-was-here'
--data '{"messageRaw":"test 123","room":"API Test Room"}'

Error received:

"timestamp":"2020-08-06T05:35:39.689+0000"
"status":404
"error":"Not Found"
"message":"Room name not available"
"path":"/api/chat/v1/messages/"'

Second example with getting messages from a room:

curl --request GET
--url 'https://api.8x8.com/chat/api/chat/v1/messages?pageSize=30&room=API%20Test%20Room&ts=0'
--header 'accept: /'
--header 'x-api-key: my-API-key-was-here'

"timestamp":"2020-08-06T05:36:15.400+0000"
"status":404
"error":"Not Found"
"message":"Room name not available"
"path":"/api/chat/v1/messages"

Am I missing something here? Thanks for the help.