What API should I use to Accept or Decline a Web Message?

Hi,

I need to implement a custom web messaging client. What is the proper steps to accept or decline a web message?

I tried to use the following API while the participant state is alerting

patch /api/v2/conversations/messages/{conversationId}/participants/{participantId}

with {"state":"connected"} as the payload.

and I am getting 400 error saying the participant does not have a active conversation.
'
What else am I missing?

Thanks,
Michael

Also, ChatGPT has a code sample which POST /api/v2/conversations/{conversationId}/accept which is not in the API Explorer. Any help will be very much appreciated.

Hi @Michael_Wong This page has an example of the API you would be calling there messaging-apis#update-conversation-participant as well as various other messaging APIs you will most likely be wanting to use with your custom client. But that looks like the same one you already tried (your payload looks fine to me). It's possible you supplied the wrong conversationId or participantId in the request, and that's why you got the 400 bad request. If you start at the top of that page it has a good example of a "typical" messaging Conversation, and you can apply that to your situation hopefully.

Hi Michael,

Thanks for reaching out to us. I always tell people to be careful with ChatGPT. I double-checked our Swagger docs and we do not have a POST /api/v2/conversations/{conversationId}/accept endpoint. I have played around with Chatgpt and it does tend to hallucinate when dealing with very product-specific APIs.

I say that as someone who has been led down the rabbit hole of wondering why something did not work after using ChatGPT to look up an answer. On most stuff it is great, but there is always the risk :slight_smile:

Thanks,
John Carnell
Director, Developer Engagement

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