Comet Add Users not working

Hi,

I have been using comet chat pro v2. APIs for add user to a group, add admin to a group, send a custom message were working perfectly fine before few weeks. But, these are showing error message " BAD REQUEST" . Is there any change in APIs? If so, why these are not notified since these will affect the working of app?

Hi @rok.reflections,

Could you let us know whether you are using REST APIs or SDKs for above APIs mentioned by you.
We had checked the REST APIs for add admin/user to a group and send custom message and it was working perfectly fine.

The documentation link that must be referred for the APIs specified by you -

  1. add user/admin to group - https://prodocs.cometchat.com/reference#add-members
  2. sending custom message - https://prodocs.cometchat.com/reference#send-messages

Also it would be great if you could provide us entire error message.

Warm Regards,
Siva
CometChat Team

Hi @siva.nadar,
We are using REST APIs. We were using the APIs(v2) from JAN, and was working perfectly fine. This is message we got for sending custom message :

Client error: POST https://api-us.cometchat.io/v2.0/users/082a5d3a-eb6b-4b68-8870-75733e4440bc/messages?category=custom&type=text&receiver=c1e500f3-853b-479f-b7c6-1f1de38e864e&receiverType=group&text=User%20%20contributed%20Time%2020%20hours&data%5Btext%5D=User%20%20contributed%20Time%2020%20hours&data%5Bmetadata%5D=%7B%22time%22%3A%2220%20hours%22%2C%22contributer%22%3A%22User%20%22%7D resulted in a 400 Bad Request response:
{“error”:{“code”:“ERR_EMPTY_CUSTOM_DATA”,“message”:"For the custom category, data must have either non-empty customData (truncated…)

I have tried APIs from the docs you have shared. And now it is working fine. I have found that some requests have been changed. My question is, how we’ll know if there any change in API happens? We donot want to find it out after the app crashes.

Hi @rok.reflections,

The request you have shared has POST body params as a query string. With the security patches added in the recent release API stopped accepting POST params sent in a query string.

There are no changes to inputs and API endpoints since the release of v2.0. The updates to this version only include optimizations and security patches.

We maintain API reference separately for each release so that developers can continue using the older versions.

Warm Regards,

Ketan Yekale
CometChat Pro

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.