Contacts
Friends, friend requests, user lookup. · 19 endpoints
- GET/accounts/{accountId}/friends
- GET/accounts/{accountId}/friend-requests
- POST/accounts/{accountId}/friend-requests
- POST/accounts/{accountId}/friend-requests/{userId}/accept
- POST/accounts/{accountId}/friend-requests/{userId}/reject
- POST/accounts/{accountId}/friend-requests/{userId}/cancel
- DELETE/accounts/{accountId}/friends/{userId}
- GET/accounts/{accountId}/users/lookup
- GET/accounts/{accountId}/users/{userId}
- GET/accounts/{accountId}/users/{userId}/mutual-groups
- POST/accounts/{accountId}/users/{userId}/block
- DELETE/accounts/{accountId}/users/{userId}/block
- PUT/accounts/{accountId}/users/{userId}/alias
- GET/accounts/{accountId}/friend-aliases
- GET/accounts/{accountId}/friend-recommendations
- GET/accounts/{accountId}/users/{userId}/friend-status
- GET/accounts/{accountId}/contacts/search
- GET/accounts/{accountId}/usernames/{username}
- GET/accounts/{accountId}/users/{userId}/presence
Friends list (Zalo). refresh=true reloads it from Zalo
GET
/api/v1/accounts/{accountId}/friendsScope: contacts:readParameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
limitquery · optional | integer ≥ 1 · ≤ 200 · default 50 | Maximum number of records (1–200) |
offsetquery · optional | integer ≥ 0 · default 0 | Skip the first N records |
searchquery · optional | string max 200 | |
refreshquery · optional | boolean default false |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/friends" \
-H "Authorization: Bearer dpk_xxx"Friend requests received / sent
GET
/api/v1/accounts/{accountId}/friend-requestsScope: contacts:readParameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
directionquery · optional | "received" | "sent" default "received" |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/friend-requests" \
-H "Authorization: Bearer dpk_xxx"Send a friend request (Zalo)
POST
/api/v1/accounts/{accountId}/friend-requestsScope: contacts:writeParameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
Request body (JSON)
user_idrequired | string max 200 | |
messageoptional | string max 150 · default "" |
Example request
bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/friend-requests" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"user_id":"string","message":""}'Accept a friend request
POST
/api/v1/accounts/{accountId}/friend-requests/{userId}/acceptScope: contacts:writeParameters
accountIdpath · required | string max 200 | |
userIdpath · required | string max 200 | User ID on the channel |
Example request
bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/friend-requests/{userId}/accept" \
-H "Authorization: Bearer dpk_xxx"Decline a friend request
POST
/api/v1/accounts/{accountId}/friend-requests/{userId}/rejectScope: contacts:writeParameters
accountIdpath · required | string max 200 | |
userIdpath · required | string max 200 | User ID on the channel |
Example request
bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/friend-requests/{userId}/reject" \
-H "Authorization: Bearer dpk_xxx"Cancel a sent friend request
POST
/api/v1/accounts/{accountId}/friend-requests/{userId}/cancelScope: contacts:writeParameters
accountIdpath · required | string max 200 | |
userIdpath · required | string max 200 | User ID on the channel |
Example request
bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/friend-requests/{userId}/cancel" \
-H "Authorization: Bearer dpk_xxx"Unfriend (Zalo)
DELETE
/api/v1/accounts/{accountId}/friends/{userId}Scope: contacts:writeParameters
accountIdpath · required | string max 200 | |
userIdpath · required | string max 200 | User ID on the channel |
Example request
bash
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/friends/{userId}" \
-H "Authorization: Bearer dpk_xxx"Look up a user by phone number (DB first, then Zalo)
GET
/api/v1/accounts/{accountId}/users/lookupScope: contacts:readParameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
phonequery · required | string max 20 |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/users/lookup" \
-H "Authorization: Bearer dpk_xxx"User profile from Zalo
GET
/api/v1/accounts/{accountId}/users/{userId}Scope: contacts:readParameters
accountIdpath · required | string max 200 | |
userIdpath · required | string max 200 | User ID on the channel |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/users/{userId}" \
-H "Authorization: Bearer dpk_xxx"Groups in common with a person (Zalo)
GET
/api/v1/accounts/{accountId}/users/{userId}/mutual-groupsScope: contacts:readParameters
accountIdpath · required | string max 200 | |
userIdpath · required | string max 200 | User ID on the channel |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/users/{userId}/mutual-groups" \
-H "Authorization: Bearer dpk_xxx"Block a user (Zalo, Facebook, Telegram)
POST
/api/v1/accounts/{accountId}/users/{userId}/blockScope: contacts:writeParameters
accountIdpath · required | string max 200 | |
userIdpath · required | string max 200 | User ID on the channel |
Example request
bash
curl -X POST "http://127.0.0.1:9900/api/v1/accounts/{accountId}/users/{userId}/block" \
-H "Authorization: Bearer dpk_xxx"Unblock a user
DELETE
/api/v1/accounts/{accountId}/users/{userId}/blockScope: contacts:writeParameters
accountIdpath · required | string max 200 | |
userIdpath · required | string max 200 | User ID on the channel |
Example request
bash
curl -X DELETE "http://127.0.0.1:9900/api/v1/accounts/{accountId}/users/{userId}/block" \
-H "Authorization: Bearer dpk_xxx"Set an alias (Zalo: synced to Zalo; other channels: stored in Deplao)
PUT
/api/v1/accounts/{accountId}/users/{userId}/aliasScope: contacts:writeParameters
accountIdpath · required | string max 200 | |
userIdpath · required | string max 200 | User ID on the channel |
Request body (JSON)
aliasrequired | string max 100 | Empty string = remove the alias |
Example request
bash
curl -X PUT "http://127.0.0.1:9900/api/v1/accounts/{accountId}/users/{userId}/alias" \
-H "Authorization: Bearer dpk_xxx" \
-H "Content-Type: application/json" \
-d '{"alias":"string"}'Aliases set on Zalo
GET
/api/v1/accounts/{accountId}/friend-aliasesScope: contacts:readParameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
pagequery · optional | integer ≥ 1 · ≤ 1000 · default 1 | |
countquery · optional | integer ≥ 1 · ≤ 500 · default 200 |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/friend-aliases" \
-H "Authorization: Bearer dpk_xxx"Friend suggestions and new friend requests from Zalo
GET
/api/v1/accounts/{accountId}/friend-recommendationsScope: contacts:readkind: request = someone sent you a friend request, suggestion = suggested by Zalo.
Parameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/friend-recommendations" \
-H "Authorization: Bearer dpk_xxx"Friendship status with a person (Zalo)
GET
/api/v1/accounts/{accountId}/users/{userId}/friend-statusScope: contacts:readParameters
accountIdpath · required | string max 200 | |
userIdpath · required | string max 200 | User ID on the channel |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/users/{userId}/friend-status" \
-H "Authorization: Bearer dpk_xxx"Search saved contacts & groups (accent-insensitive: "duong" finds "Dương"), ranked by match quality
GET
/api/v1/accounts/{accountId}/contacts/searchScope: contacts:readParameters
accountIdpath · required | string max 200 | Account ID (accounts.zalo_id). Facebook uses the Facebook ID, Telegram uses the Telegram account ID. |
qquery · optional | string max 200 · default "" | |
typequery · optional | "all" | "user" | "group" default "all" | |
limitquery · optional | integer ≥ 1 · ≤ 200 · default 50 | |
offsetquery · optional | integer ≥ 0 · default 0 |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/contacts/search" \
-H "Authorization: Bearer dpk_xxx"Resolve a Telegram @username to a user / group
GET
/api/v1/accounts/{accountId}/usernames/{username}Scope: contacts:readParameters
accountIdpath · required | string max 200 | |
usernamepath · required | string max 64 | With or without @ |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/usernames/{username}" \
-H "Authorization: Bearer dpk_xxx"Online status of a person (Zalo)
GET
/api/v1/accounts/{accountId}/users/{userId}/presenceScope: contacts:readstatus: online | offline (with last_seen_at, ms) | hidden (the person hides their online status) | unknown. Results are cached for 60 seconds per person; refresh=true asks Zalo again right away.
Parameters
accountIdpath · required | string max 200 | |
userIdpath · required | string max 200 | Zalo user ID |
refreshquery · optional | boolean | Bypass the 60-second cache |
Example request
bash
curl "http://127.0.0.1:9900/api/v1/accounts/{accountId}/users/{userId}/presence" \
-H "Authorization: Bearer dpk_xxx"