Interface for Contacts Module. This encompasses a set of APIs that enable the fetching, creation, and updating of contacts and groups. These APIs return promises that resolve to a ContactResponse object, which contains a status code, data, and message. The data field within this response object holds the contacts and groups object.

Example - ContactResponse

{
statusCode: 200,
data: {
contacts: Contact[],
groups: ContactGroup[],
},
message: null
}

Hierarchy

  • IContacts

Implemented by

Properties

getSDKConnector: (() => ISDKConnector)

Type declaration

    • (): ISDKConnector
    • Returns ISDKConnector

Methods

  • This API is used to fetch the list of contacts and groups for a user.

    Example

    const contactsResponse = await contactClient.getContacts();
    

    The ContactsResponse object contains a comprehensive list of both contacts and groups for the user. Each Contact object within this list is defined by the properties detailed in the Contact. Each ContactGroup adheres to the properties specified in the ContactGroup.

    Returns Promise<ContactResponse>

  • This API is used to create a contact group with the given display name.

    Example

    const contactGroup = await contactClient.createContactGroup(displayName, encryptionKeyUrl, groupType);
    

    The ContactGroup object for the given display name will be created and returned as a response with the properties of ContactGroup.

    Parameters

    • displayName: string
    • Optional encryptionKeyUrl: string
    • Optional groupType: GroupType

    Returns Promise<ContactResponse>

  • This API is used to delete a contact group whose groupId is received.

    Example

    const response = await contactClient.deleteContactGroup(groupId);
    

    The received response includes a status code and a message that reflect the success or failure of the API call

    Parameters

    • groupId: string

    Returns Promise<ContactResponse>

  • This API is responsible for creating a new contact.

    Example

    const contact = await contactClient.createContact(contactInfo);
    

    Parameters

    Returns Promise<ContactResponse>

  • This API is responsible for deleting an existing contact for the given contactId.

    Example

    const response = await contactClient.deleteContact(contactId);
    

    The received response includes a status code and a message that reflect the success or failure of the API call

    Parameters

    • contactId: string

    Returns Promise<ContactResponse>