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

Feat/labels #409

Merged
merged 5 commits into from
Feb 8, 2024
Merged

Conversation

judsonjuniorr
Copy link
Contributor

Labels management implementation.

You can use this to get the creation/edit/delete of each label and the association/dissociation from the contact

By default Baileys doesn't load all labels, sometimes it send the full labels list when creating/deleting or associating, but there's no rule for that
You can check this issue on Baileys: WhiskeySockets/Baileys#566 that requests to load the labels when the chats loaded

New endpoints:

GET /label/findLabels/{instanceName}
Will return all labels synced from whatsapp
CleanShot 2024-02-08 at 13 21 20

PUT /label/handleLabel/{instanceName}
Will add or remove the label from a contact chat
Request:
CleanShot 2024-02-08 at 13 23 06
Response:
CleanShot 2024-02-08 at 13 25 06

New webhooks:

2 new webhooks has been added: LABELS_EDIT and LABELS_ASSOCIATION

LABELS_EDIT is responsible to inform if a label has been changed/created/deleted with the following payload:
CleanShot 2024-02-08 at 13 29 13

LABELS_ASSOCIATION is responsible to inform what label has been added/removed from a contact chat with the following payload:
CleanShot 2024-02-08 at 13 30 53

Make sure to enable them on the env for it to work properly

@m7mdcc
Copy link

m7mdcc commented Jun 2, 2024

I think it's stop working ?
findLabels return empty array

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants