Class: Contact
Represents a contact.Constructors
new Contact()
new Contact(Creates a new Contact instance.params
):Contact
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:34Properties
addresses?
optional
addresses:object
[]
Source
packages/wapi.js/src/structures/contact/index.ts:20birthday?
optional
birthday:string
Source
packages/wapi.js/src/structures/contact/index.ts:24emails?
optional
emails:object
[]
Source
packages/wapi.js/src/structures/contact/index.ts:22name
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:26org?
optional
org:object
company?
optional
company:string
department?
optional
department:string
title?
optional
title:string
Source
packages/wapi.js/src/structures/contact/index.ts:25phones?
optional
phones:object
[]
Source
packages/wapi.js/src/structures/contact/index.ts:23urls?
optional
urls:object
[]
Source
packages/wapi.js/src/structures/contact/index.ts:21Methods
addAddress()
addAddress(Adds an address to the contact.address
):void
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:90addEmail()
addEmail(Adds an email to the contact.void
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:106addPhone()
addPhone(Adds a phone number to the contact.phone
):void
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:114addUrl()
addUrl(Adds a URL to the contact.url
):void
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:98setBirthday()
setBirthday(Sets the birthday of the contact.date
):void
Parameters
• date:string
The birthday of the contact.
Returns
void
Source
packages/wapi.js/src/structures/contact/index.ts:122setFirstName()
setFirstName(Sets the first name of the contact.firstName
):void
Parameters
• firstName:string
The first name of the contact.
Returns
void
Source
packages/wapi.js/src/structures/contact/index.ts:50setLastName()
setLastName(Sets the last name of the contact.lastName
):void
Parameters
• lastName:string
The last name of the contact.
Returns
void
Source
packages/wapi.js/src/structures/contact/index.ts:42setMiddleName()
setMiddleName(Sets the middle name of the contact.middleName
):void
Parameters
• middleName:string
The middle name of the contact.
Returns
void
Source
packages/wapi.js/src/structures/contact/index.ts:58setNamePrefix()
setNamePrefix(Sets the prefix of the contact’s name.prefix
):void
Parameters
• prefix:string
The prefix of the contact’s name.
Returns
void
Source
packages/wapi.js/src/structures/contact/index.ts:74setNameSuffix()
setNameSuffix(Sets the suffix of the contact’s name.suffix
):void
Parameters
• suffix:string
The suffix of the contact’s name.
Returns
void
Source
packages/wapi.js/src/structures/contact/index.ts:66setOrg()
setOrg(Sets the organization of the contact.org
):void
Parameters
• org The organization of the contact. • org.company?:string
= undefined
• org.department?: string
= undefined
• org.title?: string
= undefined
Returns
void