message.received event carries the sender under data.message.sender:
usr_… id is stable: the same user always has the same id, in direct
chats and in groups. Use it to key your own records.
Resolve the name and phone
To turn the id into something you can greet or match on, callGET /v1/users/{user_id} (see the API Reference tab):
name is the canonical stored value. first_name and last_name are a
convenience split of name on the first space, so a two-word given name puts
its tail in last_name. Greet with them, but store name if you need the
exact value.
In a group, read
sender.id from each message.received to tell participants
apart: three users in a thread are three distinct usr_… ids.Scope
You can only resolve a user you currently share an active conversation with (direct or group). Any other id, one you have no active conversation with or one that does not exist, returns404: