Delete messages api return "message": "Must provide either to_contact or to_channel parameter."

Description
When i try to delete a message from a channel i get
“message”: “Must provide either to_contact or to_channel parameter.”

i already provided
to_channel in the body of the request and still get the same error ! delete request body is totally ignored here!

Error
“message”: “Must provide either to_contact or to_channel parameter.”

Which App Type (OAuth / Chatbot / JWT / Webhook)?
Knowing the endpoint/s can help us to identify your issue faster. Please link the ones you need help/have a question with.
OAuth

Which Endpoint/s?
Knowing the API endpoint/s can help us to identify your issue faster. Please link the ones you need help/have a question with.
DELETE /chat/users/{userId}/messages/{messageId}
How To Reproduce (If applicable)
Steps to reproduce the behavior:

  1. Request URL / Headers (without credentials) / Body

url : DELETE /chat/users/{userId}/messages/{messageId}
body
{
“to_channel” : “48a3349f-5f39-4116-a432-d7cdd0fbf3ab”
}

Screenshots (If applicable)
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Hi @maged.ahmedr,

Is it possible to share the full request URL including user and message IDs? This will help me to take a closer look. Please also double check that the user whose message you’re trying to delete is assigned with a role that has Edit permission for Chat Messages.

Thanks,
Will

Hey will,

This is full URL including user and message ids
https://api.zoom.us/v2/chat/users/qAzlHSReTx6m9KQt4RyeQQ/messages/5b292599-b676-4909-8203-945c0e33ebdc

request body

{
    "to_channel" : "48a3349f-5f39-4116-a432-d7cdd0fbf3ab"
}

Hey @maged.ahmedr,

Thank you for providing additional information. Are you able to confirm that you are using an account-level OAuth app when making this request? Using a user-level, or not having the proper scopes, can cause the request to fail. If you’ve double-checked all of this, please let me know.

Thanks,
Max

Hey MaxM,

Yes i doubled checked, i’m using a account-level Oauth and having all scopes .

Hey @maged.ahmedr,

Thank you for providing additional information. I double-checked our documentation on this and realized that this endpoint uses a query parameter instead of a request body. This is the case for most DELETE method endpoints.

My apologies for not catching that sooner, I hope that helps!

Thanks,
Max

1 Like