Expose business verification data (verified_level, issuer, actual_actors/host_storage) in /user/check, /user/info and message webhook

Open
#241 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 9 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
43/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
api, backend

Research direction

Start with pkg/user/service/user_service.go and trace how /user/check and /user/info build responses; then inspect the message webhook path and the whatsmeow parsing points named in the issue. The issue identifies the fields and example XML to support, but the approach may require changes in the upstream whatsmeow types or reading stanza attributes before parsing discards them. Done means the requested verification and business privacy data are exposed in all three API surfaces while /user/check keeps VerifiedName as a string.

Written by the indexing model from the issue text.

Description

Welcome!
  • Yes, I have searched for similar requests on GitHub and found none.
What type of feature?

Endpoint

What is the motivation for the request?

We need to tell apart three kinds of senders/contacts:

  1. Meta-verified businesses (blue/green check), to show a verification badge;
  2. Businesses served through the WhatsApp Business Platform / Cloud API or a BSP (e.g. banks, Facebook/Discord login codes), so automated replies are not sent back to automated accounts;
  3. WhatsApp Business app accounts (small businesses), which are often real customers and must be treated like regular users.

WhatsApp already sends everything needed, but it is lost before it reaches the API/webhook:

  • /user/check only returns VerifiedName as a string (item.VerifiedName.Details.GetVerifiedName() in pkg/user/service/user_service.go), dropping the certificate issuer and everything else.
  • The <verified_name> node in usync responses and in incoming <message> stanzas carries attributes that whatsmeow does not parse, so they never appear in /user/info, /user/check or the Message webhook (Info.VerifiedName).

What we observed with DEBUG_ENABLED=DEBUG (Evolution Go 0.7.1, whatsmeow upstream):

usync response (/user/check) for a large Brazilian bank:

<business>
  <verified_name actual_actors="1" host_storage="2" privacy_mode_ts="1695341172" v="1" verified_level="high"><!-- 174 bytes --></verified_name>
</business>

Incoming message from a WhatsApp Business app account:

<message category="peer" ... type="text" verified_level="unknown" verified_name="<serial>">
  <verified_name v="1" verified_level="unknown"><!-- certificate --></verified_name>
  ...
</message>

Decoded certificate of that app account: issuer = "smb:wa" (note the :wa suffix).

So:

  • verified_level (high vs unknown) identifies Meta-verified accounts;
  • actual_actors / host_storage / privacy_mode_ts only show up for businesses using the API/BSP;
  • Details.issuer (smb:wa vs ent:...) separates the Business app from enterprise certificates, but /user/check does not return it.
Usage Examples
  • Show a verification badge only for verified_level == "high".
  • Disable an AI/auto-responder for contacts with actual_actors/host_storage set (automated accounts), while still answering WhatsApp Business app users.
How should the feature be developed?

Without breaking clients that use VerifiedName as a string in /user/check:

  1. /user/check: add new fields next to VerifiedName, e.g. VerifiedIssuer (Details.issuer), VerifiedLevel, and a BusinessPrivacy object (actualActors, hostStorage, privacyModeTs).
  2. /user/info: include the same VerifiedLevel and BusinessPrivacy data (the full VerifiedName certificate is already there).
  3. Message webhook: expose the verified_level attribute of the <message> stanza (and of its <verified_name> child) in Info, e.g. Info.VerifiedLevel.

The attributes are dropped by whatsmeow (parseVerifiedName / parseVerifiedNameContent and parseMessageInfo only keep the certificate bytes), so this probably needs either a small change in whatsmeow (types.VerifiedName / types.MessageInfo gaining the attributes) or reading the node attributes in Evolution before they are discarded. Happy to help test or open a PR if you point us to the preferred approach.

Additional Notes

We searched issues/PRs for verified_level, VerifiedLevel, VerifiedName, actual_actors, host_storage, verified and business and found nothing related (#92 is about edit/revoke data in the message webhook).

Dominant language
Go
Stars
1k
Forks
610
PR merge metrics
No merged PRs in 30d

Getting set up

  • Ships a Dockerfile or Docker Compose file
  • Has a pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from evolution-foundation/evolution-go

All issues in evolution-foundation/evolution-go

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.