whatsapp-http-api
whatsapp-http-api copied to clipboard
[Feature Request] Add support for metadata in "Send messages" methods and webhook responses
Is your feature request related to a problem? Please describe.
I'm always frustrated when I can't identify which specific message was sent from the database when a webhook is triggered. This makes it difficult to mark messages as delivered.
Describe the solution you'd like
I would like to have the ability to send additional custom fields in the "Send messages" methods. For example:
{
"chatId": "[email protected]",
"text": "Hi there!",
"session": "mysession",
"custom_fields": {
"field_1": "val_1",
"field_2": "val_2",
"field_3": "val_3"
}
}
When the webhook request is sent, these custom fields should be returned. This will allow me to easily track and identify which specific message was sent and update the database accordingly.
Describe alternatives you've considered
I considered using the response from the /api/sendText
method, but I am worried that the webhook might arrive first, and my script might not be ready in time. Another alternative could be using custom headers in the "Send messages" methods that would be returned with each request, allowing for unique identification of requests.
Additional context
I mentioned the "Send messages" example because this is where I specifically need this feature. However, it could be beneficial to add this functionality to all requests.