Wapi.js Docs / Contact

Class: Contact

Represents a contact.

Constructors

new Contact()

new Contact(params): Contact

Creates a new Contact instance.

Parameters

params

The parameters for creating a Contact instance.

params.name

The name of the contact.

params.name.first_name?: string= undefined

params.name.formatted_name: string= undefined

params.name.last_name?: string= undefined

params.name.middle_name?: string= undefined

params.name.prefix?: string= undefined

params.name.suffix?: string= undefined

Returns

Contact

Source

packages/wapi.js/src/structures/contact/index.ts:34

Properties

addresses?

optional addresses: object[]

Source

packages/wapi.js/src/structures/contact/index.ts:20


birthday?

optional birthday: string

Source

packages/wapi.js/src/structures/contact/index.ts:24


emails?

optional emails: object[]

Source

packages/wapi.js/src/structures/contact/index.ts:22


name

name: object

first_name?

optional first_name: string

formatted_name

formatted_name: string

last_name?

optional last_name: string

middle_name?

optional middle_name: string

prefix?

optional prefix: string

suffix?

optional suffix: string

Source

packages/wapi.js/src/structures/contact/index.ts:26


org?

optional org: object

company?

optional company: string

department?

optional department: string

title?

optional title: string

Source

packages/wapi.js/src/structures/contact/index.ts:25


phones?

optional phones: object[]

Source

packages/wapi.js/src/structures/contact/index.ts:23


urls?

optional urls: object[]

Source

packages/wapi.js/src/structures/contact/index.ts:21

Methods

addAddress()

addAddress(address): void

Adds an address to the contact.

Parameters

address

The address to add to the contact.

address.city?: string= undefined

address.country?: string= undefined

address.country_code?: string= undefined

address.state?: string= undefined

address.street?: string= undefined

address.type: "HOME" | "WORK"= undefined

Returns

void

Source

packages/wapi.js/src/structures/contact/index.ts:90


addEmail()

addEmail(email): void

Adds an email to the contact.

Parameters

email

The email to add to the contact.

email.email?: string= undefined

email.type: "HOME" | "WORK"= undefined

Returns

void

Source

packages/wapi.js/src/structures/contact/index.ts:106


addPhone()

addPhone(phone): void

Adds a phone number to the contact.

Parameters

phone

The phone number to add to the contact.

phone.phone?: string= undefined

phone.type?: "HOME" | "WORK" | "CELL" | "MAIN" | "IPHONE"= undefined

phone.wa_id?: string= undefined

Returns

void

Source

packages/wapi.js/src/structures/contact/index.ts:114


addUrl()

addUrl(url): void

Adds a URL to the contact.

Parameters

url

The URL to add to the contact.

url.type: "HOME" | "WORK"= undefined

url.url: string= undefined

Returns

void

Source

packages/wapi.js/src/structures/contact/index.ts:98


setBirthday()

setBirthday(date): void

Sets the birthday of the contact.

Parameters

date: string

The birthday of the contact.

Returns

void

Source

packages/wapi.js/src/structures/contact/index.ts:122


setFirstName()

setFirstName(firstName): void

Sets the first name of the contact.

Parameters

firstName: string

The first name of the contact.

Returns

void

Source

packages/wapi.js/src/structures/contact/index.ts:50


setLastName()

setLastName(lastName): void

Sets the last name of the contact.

Parameters

lastName: string

The last name of the contact.

Returns

void

Source

packages/wapi.js/src/structures/contact/index.ts:42


setMiddleName()

setMiddleName(middleName): void

Sets the middle name of the contact.

Parameters

middleName: string

The middle name of the contact.

Returns

void

Source

packages/wapi.js/src/structures/contact/index.ts:58


setNamePrefix()

setNamePrefix(prefix): void

Sets the prefix of the contact’s name.

Parameters

prefix: string

The prefix of the contact’s name.

Returns

void

Source

packages/wapi.js/src/structures/contact/index.ts:74


setNameSuffix()

setNameSuffix(suffix): void

Sets the suffix of the contact’s name.

Parameters

suffix: string

The suffix of the contact’s name.

Returns

void

Source

packages/wapi.js/src/structures/contact/index.ts:66


setOrg()

setOrg(org): void

Sets the organization of the contact.

Parameters

org

The organization of the contact.

org.company?: string= undefined

org.department?: string= undefined

org.title?: string= undefined

Returns

void

Source

packages/wapi.js/src/structures/contact/index.ts:82