Contacts Client API
Generated client method reference for the contacts namespace.
This page documents 10 schema-registry client methods in the contacts namespace.
blockContact
Block a contact
Signature client.blockContact(contactId: string): Promise<boolean>
Usage
const result = await client.blockContact("447123456789@c.us");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<boolean> |
Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | contacts |
| Action | update |
| Functionality | both |
| Positional parameter order | contactId |
| Aliases | contactBlock, contacts.block, contacts.contactBlock |
| Deprecated aliases | contactBlock, contacts.contactBlock |
| License | none |
| WAPI override | contactBlock |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/contacts/block | blockContact | Active |
| Alias | PUT | /api/blockContact | blockContact | Active |
| Deprecated alias | PUT | /api/contactBlock | contactBlock | Deprecated |
| Deprecated alias | PUT | /api/contacts/contactBlock | contacts.contactBlock | Deprecated |
checkNumberStatus
Check if number is on WhatsApp
Signature client.checkNumberStatus(contactId: string): Promise<NumberCheck>
Usage
const result = await client.checkNumberStatus("447123456789@c.us");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<NumberCheck> |
| NumberCheck | View fields |
Resolves to NumberCheck. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<NumberCheck>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | contacts |
| Action | read |
| Functionality | both |
| Positional parameter order | contactId |
| Aliases | contacts.checkNumberStatus |
| Deprecated aliases | - |
| License | insiders |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/contacts/checkNumberStatus | checkNumberStatus | Active |
| Alias | GET | /api/checkNumberStatus | checkNumberStatus | Active |
checkReadReceipts
Check read receipts setting
Signature client.checkReadReceipts(contactId: string): Promise<boolean \| string>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.checkReadReceipts({
contactId: "447123456789@c.us",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<boolean | string> |
Resolves to boolean \| string. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | contacts |
| Action | read |
| Functionality | both |
| Positional parameter order | contactId |
| Aliases | contacts.checkReadReceipts, contacts.getReadReceipts, getReadReceipts |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/contacts/checkReadReceipts | checkReadReceipts | Active |
| Alias | GET | /api/checkReadReceipts | checkReadReceipts | Active |
| Alias | GET | /api/contacts/getReadReceipts | contacts.getReadReceipts | Active |
| Alias | GET | /api/getReadReceipts | getReadReceipts | Active |
getAllContacts
Retrieves all contacts
Signature client.getAllContacts(): Promise<Contact[]>
Usage
const result = await client.getAllContacts();Parameters
This method does not define input parameters.
Returns
| Prop | Value |
|---|---|
| Return type | Promise<Contact[]> |
| Contact | View fields |
Resolves to Contact[]. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<Contact[]>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | contacts |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | contacts.all, contacts.getAll, contacts.list, listContacts |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/contacts/getAll | getAllContacts | Active |
| Alias | GET | /api/contacts/all | contacts.all | Active |
| Alias | GET | /api/contacts/list | contacts.list | Active |
| Alias | GET | /api/getAllContacts | getAllContacts | Active |
| Alias | GET | /api/listContacts | listContacts | Active |
getBlockedIds
Get blocked contact IDs
Signature client.getBlockedIds(): Promise<ContactId[] \| false>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.getBlockedIds();Parameters
This method does not define input parameters.
Returns
| Prop | Value |
|---|---|
| Return type | Promise<ContactId[] | false> |
| ContactId | View fields |
Resolves to ContactId[] \| false. A rejected Promise indicates input validation or dispatch failure.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | contacts |
| Action | read |
| Functionality | both |
| Positional parameter order | - |
| Aliases | contacts.getBlockedIds |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/contacts/getBlockedIds | getBlockedIds | Active |
| Alias | GET | /api/getBlockedIds | getBlockedIds | Active |
getCommonGroups
Get common groups with contact
Signature client.getCommonGroups(contactId: string): Promise<CommonGroup[] \| false>
Usage
const result = await client.getCommonGroups("447123456789@c.us");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<CommonGroup[] | false> |
| CommonGroup | View fields |
Resolves to CommonGroup[] \| false. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<Array<{ id: GroupId; title: string }>>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | contacts |
| Action | read |
| Functionality | both |
| Positional parameter order | contactId |
| Aliases | contacts.getCommonGroups |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/contacts/getCommonGroups | getCommonGroups | Active |
| Alias | GET | /api/getCommonGroups | getCommonGroups | Active |
getContact
Get specific contact
Signature client.getContact(contactId: string): Promise<Contact \| null>
Usage
const result = await client.getContact("447123456789@c.us");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<Contact | null> |
| Contact | View fields |
Resolves to Contact \| null. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<Contact \| null>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | contacts |
| Action | read |
| Functionality | both |
| Positional parameter order | contactId |
| Aliases | contacts.get |
| Deprecated aliases | - |
| License | none |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/contacts/get | getContact | Active |
| Alias | GET | /api/getContact | getContact | Active |
getNumberProfile
Get profile of number
Signature client.getNumberProfile(contactId: string): Promise<NumberProfile>
Usage
import { SocketClient } from '@open-wa/socket-client';
const client = await SocketClient.connect('http://localhost:8080', 'YOUR_API_KEY');
const result = await client.getNumberProfile({
contactId: "447123456789@c.us",
});Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<NumberProfile> |
| NumberProfile | View fields |
Provisional number profile based on the public Contact fields. Fields are optional and additional provider fields are unknown. The licensed getNumberProfile payload has not been verified against this model.
This method is not declared on the in-process Client facade. Use the remote Node.js client or HTTP API. Provisional number profile based on the public Contact fields. Fields are optional and additional provider fields are unknown. The licensed getNumberProfile payload has not been verified against this model.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | contacts |
| Action | read |
| Functionality | both |
| Positional parameter order | contactId |
| Aliases | contacts.getNumberProfile |
| Deprecated aliases | - |
| License | insiders |
| WAPI override | - |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/contacts/getNumberProfile | getNumberProfile | Active |
| Alias | GET | /api/getNumberProfile | getNumberProfile | Active |
getProfilePicture
Get profile picture from server
Signature client.getProfilePicture(chatId: string): Promise<string>
Usage
const result = await client.getProfilePic("447123456789@c.us");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<string> |
Resolves to string. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<string \| null>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | contacts |
| Action | read |
| Functionality | both |
| Positional parameter order | chatId |
| Aliases | contacts.getProfilePicFromServer, contacts.getProfilePicture, getProfilePicFromServer |
| Deprecated aliases | contacts.getProfilePicFromServer, getProfilePicFromServer |
| License | none |
| WAPI override | getProfilePicFromServer |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | GET | /api/contacts/getProfilePicture | getProfilePicture | Active |
| Deprecated alias | GET | /api/contacts/getProfilePicFromServer | contacts.getProfilePicFromServer | Deprecated |
| Deprecated alias | GET | /api/getProfilePicFromServer | getProfilePicFromServer | Deprecated |
| Alias | GET | /api/getProfilePicture | getProfilePicture | Active |
unblockContact
Unblock a contact
Signature client.unblockContact(contactId: string): Promise<boolean>
Usage
const result = await client.unblockContact("447123456789@c.us");Parameters
Prop
Type
Returns
| Prop | Value |
|---|---|
| Return type | Promise<boolean> |
Resolves to boolean. A rejected Promise indicates input validation or dispatch failure.
In-process Client resolves to Promise<boolean>. The contract above is for the remote Node.js client; HTTP wraps that result in its data property.
Advanced method metadata
Overview
| Prop | Value |
|---|---|
| Namespace | contacts |
| Action | update |
| Functionality | both |
| Positional parameter order | contactId |
| Aliases | contacts.contactUnblock, contacts.unblock, contactUnblock |
| Deprecated aliases | contacts.contactUnblock, contactUnblock |
| License | none |
| WAPI override | contactUnblock |
| Deprecated | No |
Routes
| Type | Method | Path | Name | Status |
|---|---|---|---|---|
| Primary | PUT | /api/contacts/unblock | unblockContact | Active |
| Deprecated alias | PUT | /api/contacts/contactUnblock | contacts.contactUnblock | Deprecated |
| Deprecated alias | PUT | /api/contactUnblock | contactUnblock | Deprecated |
| Alias | PUT | /api/unblockContact | unblockContact | Active |
Was this helpful?
Your answer includes the page path and docs version.
