Last Seen
#
Method#
/privacy/last-seenPOST
https://api.z-api.io/instances/{{instanceId}}/token/{{instanceToken}}/privacy/last-seen
#
HeaderKey | Value |
---|---|
Client-Token | ACCOUNT SECURITY TOKEN |
#
ConceptThrough this method, it is possible to configure who can see your "last seen" status.
#
Attributes#
RequiredAttributes | Type | Description |
---|---|---|
visualizationType | string | Visibility scope (ALL, NONE, CONTACTS, CONTACT_BLACKLIST) |
String (visualizationType)
Visibility scope. Accepted values:
- ALL (Everyone can see)
- NONE (No one can see)
- CONTACTS (Only my contacts)
- CONTACT_BLACKLIST (Only my contacts, except...)
#
OptionalAttributes | Type | Description |
---|---|---|
contactsBlacklist | array object | Contacts to be added or removed from the blacklist. Should be sent when "visualizationType" is "CONTACT_BLACKLIST" |
Array Object (contactsBlacklist)
Attributes | Type | Description |
---|---|---|
action | string | Action to be taken for the contact; add or remove from the blacklist (add, remove) |
phone | string | Contact's phone number |
#
Request BodyMethod
POST
https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/privacy/last-seen
Example
Important
It is essential to highlight that the blacklist (list of disallowed contacts) is different for each privacy configuration, meaning that the blacklist for "last seen" is not the same as that for "profile photo," and so on for all configurations that accept the blacklist.
Tip
You do not need to resend the "contactsBlacklist" attribute with contacts already added. This parameter is only for changes in the blacklist.
#
Response#
200Attributes | Type | Description |
---|---|---|
success | boolean | true if successful, false in case of failure |
Example
#
405In this case, ensure that you are sending the method specification correctly, i.e., check if you sent the POST or PUT as specified at the beginning of this topic.
#
415If you receive a 415 error, make sure to add the "Content-Type" of the object you are sending in the request headers, in most cases, it should be "application/json".