open-wa
DocsAPI reference

Contacts Client API

Generated client method reference for the contacts namespace.

Contacts Client API

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

PropValue
Return typePromise<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

PropValue
Namespacecontacts
Actionupdate
Functionalityboth
Positional parameter ordercontactId
AliasescontactBlock, contacts.block, contacts.contactBlock
Deprecated aliasescontactBlock, contacts.contactBlock
Licensenone
WAPI overridecontactBlock
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/contacts/blockblockContactActive
AliasPUT/api/blockContactblockContactActive
Deprecated aliasPUT/api/contactBlockcontactBlockDeprecated
Deprecated aliasPUT/api/contacts/contactBlockcontacts.contactBlockDeprecated
Insiders

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

PropValue
Return typePromise<NumberCheck>
NumberCheckView 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

PropValue
Namespacecontacts
Actionread
Functionalityboth
Positional parameter ordercontactId
Aliasescontacts.checkNumberStatus
Deprecated aliases-
Licenseinsiders
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/contacts/checkNumberStatuscheckNumberStatusActive
AliasGET/api/checkNumberStatuscheckNumberStatusActive

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

PropValue
Return typePromise<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

PropValue
Namespacecontacts
Actionread
Functionalityboth
Positional parameter ordercontactId
Aliasescontacts.checkReadReceipts, contacts.getReadReceipts, getReadReceipts
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/contacts/checkReadReceiptscheckReadReceiptsActive
AliasGET/api/checkReadReceiptscheckReadReceiptsActive
AliasGET/api/contacts/getReadReceiptscontacts.getReadReceiptsActive
AliasGET/api/getReadReceiptsgetReadReceiptsActive

getAllContacts

Retrieves all contacts

Signature client.getAllContacts(): Promise<Contact[]>

Usage

const result = await client.getAllContacts();

Parameters

This method does not define input parameters.

Returns

PropValue
Return typePromise<Contact[]>
ContactView 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

PropValue
Namespacecontacts
Actionread
Functionalityboth
Positional parameter order-
Aliasescontacts.all, contacts.getAll, contacts.list, listContacts
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/contacts/getAllgetAllContactsActive
AliasGET/api/contacts/allcontacts.allActive
AliasGET/api/contacts/listcontacts.listActive
AliasGET/api/getAllContactsgetAllContactsActive
AliasGET/api/listContactslistContactsActive

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

PropValue
Return typePromise<ContactId[] | false>
ContactIdView 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

PropValue
Namespacecontacts
Actionread
Functionalityboth
Positional parameter order-
Aliasescontacts.getBlockedIds
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/contacts/getBlockedIdsgetBlockedIdsActive
AliasGET/api/getBlockedIdsgetBlockedIdsActive

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

PropValue
Return typePromise<CommonGroup[] | false>
CommonGroupView 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

PropValue
Namespacecontacts
Actionread
Functionalityboth
Positional parameter ordercontactId
Aliasescontacts.getCommonGroups
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/contacts/getCommonGroupsgetCommonGroupsActive
AliasGET/api/getCommonGroupsgetCommonGroupsActive

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

PropValue
Return typePromise<Contact | null>
ContactView 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

PropValue
Namespacecontacts
Actionread
Functionalityboth
Positional parameter ordercontactId
Aliasescontacts.get
Deprecated aliases-
Licensenone
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/contacts/getgetContactActive
AliasGET/api/getContactgetContactActive
Insiders

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

PropValue
Return typePromise<NumberProfile>
NumberProfileView 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

PropValue
Namespacecontacts
Actionread
Functionalityboth
Positional parameter ordercontactId
Aliasescontacts.getNumberProfile
Deprecated aliases-
Licenseinsiders
WAPI override-
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/contacts/getNumberProfilegetNumberProfileActive
AliasGET/api/getNumberProfilegetNumberProfileActive

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

PropValue
Return typePromise<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

PropValue
Namespacecontacts
Actionread
Functionalityboth
Positional parameter orderchatId
Aliasescontacts.getProfilePicFromServer, contacts.getProfilePicture, getProfilePicFromServer
Deprecated aliasescontacts.getProfilePicFromServer, getProfilePicFromServer
Licensenone
WAPI overridegetProfilePicFromServer
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryGET/api/contacts/getProfilePicturegetProfilePictureActive
Deprecated aliasGET/api/contacts/getProfilePicFromServercontacts.getProfilePicFromServerDeprecated
Deprecated aliasGET/api/getProfilePicFromServergetProfilePicFromServerDeprecated
AliasGET/api/getProfilePicturegetProfilePictureActive

unblockContact

Unblock a contact

Signature client.unblockContact(contactId: string): Promise<boolean>

Usage

const result = await client.unblockContact("447123456789@c.us");

Parameters

Prop

Type

Returns

PropValue
Return typePromise<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

PropValue
Namespacecontacts
Actionupdate
Functionalityboth
Positional parameter ordercontactId
Aliasescontacts.contactUnblock, contacts.unblock, contactUnblock
Deprecated aliasescontacts.contactUnblock, contactUnblock
Licensenone
WAPI overridecontactUnblock
DeprecatedNo

Routes

TypeMethodPathNameStatus
PrimaryPUT/api/contacts/unblockunblockContactActive
Deprecated aliasPUT/api/contacts/contactUnblockcontacts.contactUnblockDeprecated
Deprecated aliasPUT/api/contactUnblockcontactUnblockDeprecated
AliasPUT/api/unblockContactunblockContactActive

Was this helpful?

Your answer includes the page path and docs version.

On this page