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?
optionaladdresses:object[]
Source
packages/wapi.js/src/structures/contact/index.ts:20birthday?
optionalbirthday:string
Source
packages/wapi.js/src/structures/contact/index.ts:24emails?
optionalemails:object[]
Source
packages/wapi.js/src/structures/contact/index.ts:22name
name: object
first_name?
optionalfirst_name:string
formatted_name
formatted_name: string
last_name?
optionallast_name:string
middle_name?
optionalmiddle_name:string
prefix?
optionalprefix:string
suffix?
optionalsuffix:string
Source
packages/wapi.js/src/structures/contact/index.ts:26org?
optionalorg:object
company?
optionalcompany:string
department?
optionaldepartment:string
title?
optionaltitle:string
Source
packages/wapi.js/src/structures/contact/index.ts:25phones?
optionalphones:object[]
Source
packages/wapi.js/src/structures/contact/index.ts:23urls?
optionalurls: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