0

Im using SendBird platform API to create chat in my website, when i try to retrieve the previously send messages in a channel using below API:

https://api.sendbird.com/v3/{channel_type}/{channel_url}/messages

METHOD : GET

Request: ?message_ts=long(Required)&prev_limit=int(Optional, default: 15, 0~200)&next_limit=int(Optional, default: 15, 0~200)&include=boolean(Optional, default: true)&reverse=boolean(Optional, default: false)&custom_type=string(Optional)&message_type=string(Optional)&sender_id=string(Optional)

after passing value to above request,im getting an error saying

{ "message": "Not authorized. Get messages function can be called only from Park or Enterprise plan.", "code": 400108, "error": true }

can some one please help me with this

Thanks Nithin

2 Answers2

0

The Message Retrieval API which you are calling is a premium feature as you can see in Senbird's Pricing Page.

You will have to contact Sendbird and upgrade to their premium plan in order to retrieve message and successfully call the endpoint.

0

You can retrieve messages in SDKs (available for JavaScript too).

In Android call this method,

mChannel.getPreviousMessagesByTimestamp()

where mChannel is an object of type GroupChannel(OpenChannel also allowed).

And as far as I know, it is ok to retrieve messages like that.

For Javascript refer to this link

Harish Gyanani
  • 1,366
  • 2
  • 22
  • 43