Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the same pattern for onmessage and onack. #1917

Open
tiagoandrepro opened this issue Jun 20, 2024 · 0 comments
Open

Set the same pattern for onmessage and onack. #1917

tiagoandrepro opened this issue Jun 20, 2024 · 0 comments
Labels
enhancement New feature or request needs triage

Comments

@tiagoandrepro
Copy link
Contributor

When receiving a webhook for a new message received on WhatsApp, I get one structure, and when I send a message, I get another. Is it possible to standardize both events since they are related to messages?

{ "event": "onack", "session": "9c5532b8-a02a-48a1-a8c2-907fba1fb2df", "id": { "fromMe": true, "remote": "[email protected]", "id": "86A2B99CAF91EE93FF75FD8BD1F3138E", "_serialized": "[email protected]_86A2B99CAF91EE93FF75FD8BD1F3138E" }, "viewed": false, "body": "Tudo bom", "type": "chat", "t": 1718901986, "notifyName": "Bot Test", "from": "[email protected]", "to": "[email protected]", "author": "[email protected]", "ack": 2, "invis": false, "isNewMsg": true, "star": false, "kicNotified": false, "recvFresh": true, "isFromTemplate": false, "pollInvalidated": false, "isSentCagPollCreation": false, "latestEditMsgKey": null, "latestEditSenderTimestampMs": null, "mentionedJidList": [], "groupMentions": [], "isEventCanceled": false, "eventInvalidated": false, "isVcardOverMmsDocument": false, "isForwarded": false, "labels": [], "hasReaction": false, "productHeaderImageRejected": false, "lastPlaybackProgress": 0, "isDynamicReplyButtonsMsg": false, "isCarouselCard": false, "parentMsgId": null, "isMdHistoryMsg": false, "stickerSentTs": 0, "isAvatar": false, "lastUpdateFromServerTs": 0, "invokedBotWid": null, "bizBotType": null, "botResponseTargetId": null, "botPluginType": null, "botPluginReferenceIndex": null, "botPluginSearchProvider": null, "botPluginSearchUrl": null, "botPluginSearchQuery": null, "botPluginMaybeParent": false, "botReelPluginThumbnailCdnUrl": null, "botMsgBodyType": null, "requiresDirectConnection": false, "bizContentPlaceholderType": null, "hostedBizEncStateMismatch": false, "senderOrRecipientAccountTypeHosted": false, "placeholderCreatedWhenAccountIsHosted": false }

{ "event": "onmessage", "session": "9c5532b8-a02a-48a1-a8c2-907fba1fb2df", "id": "[email protected]_3AC7DCC8ECE26D7CC41F", "viewed": false, "body": "Ol\u00e1", "type": "chat", "t": 1718903953, "notifyName": "Tiago Andr\u00e9", "from": "[email protected]", "to": "[email protected]", "ack": 1, "invis": false, "isNewMsg": true, "star": false, "kicNotified": false, "recvFresh": true, "isFromTemplate": false, "pollInvalidated": false, "isSentCagPollCreation": false, "latestEditMsgKey": null, "latestEditSenderTimestampMs": null, "mentionedJidList": [], "groupMentions": [], "isEventCanceled": false, "eventInvalidated": false, "isVcardOverMmsDocument": false, "isForwarded": false, "labels": [], "hasReaction": false, "productHeaderImageRejected": false, "lastPlaybackProgress": 0, "isDynamicReplyButtonsMsg": false, "isCarouselCard": false, "parentMsgId": null, "isMdHistoryMsg": false, "stickerSentTs": 0, "isAvatar": false, "lastUpdateFromServerTs": 0, "invokedBotWid": null, "bizBotType": null, "botResponseTargetId": null, "botPluginType": null, "botPluginReferenceIndex": null, "botPluginSearchProvider": null, "botPluginSearchUrl": null, "botPluginSearchQuery": null, "botPluginMaybeParent": false, "botReelPluginThumbnailCdnUrl": null, "botMsgBodyType": null, "requiresDirectConnection": null, "bizContentPlaceholderType": null, "hostedBizEncStateMismatch": false, "senderOrRecipientAccountTypeHosted": false, "placeholderCreatedWhenAccountIsHosted": false, "chatId": "[email protected]", "fromMe": false, "sender": { "id": "[email protected]", "name": "Tiago Andr\u00e9", "shortName": "Tiago", "pushname": "Tiago Andr\u00e9", "type": "in", "isBusiness": false, "isEnterprise": false, "isSmb": false, "labels": [], "isContactSyncCompleted": 0, "textStatusLastUpdateTime": -1, "syncToAddressbook": true, "formattedName": "Tiago Andr\u00e9", "isMe": false, "isMyContact": true, "isPSA": false, "isUser": true, "isWAContact": true, "profilePicThumbObj": { "id": "[email protected]", "tag": null }, "msgs": null }, "timestamp": 1718903953, "content": "Ol\u00e1", "isGroupMsg": false, "mediaData": [] }

@tiagoandrepro tiagoandrepro added enhancement New feature or request needs triage labels Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request needs triage
Projects
None yet
Development

No branches or pull requests

1 participant