AddressBook API class for managing Webex Contact Center address book entries. Provides functionality to fetch address book entries using the entry API.

AddressBook

Example

import Webex from 'webex';

const webex = new Webex({ credentials: 'YOUR_ACCESS_TOKEN' });
const cc = webex.cc;

// Register and login first
await cc.register();
await cc.stationLogin({ teamId: 'team123', loginOption: 'BROWSER' });

// Get AddressBook API instance from ContactCenter
const addressBookAPI = cc.addressBook;

// Get entries from agent's default address book
const entries = await addressBookAPI.getEntries();

// Get entries from a specific address book with pagination
const entries = await addressBookAPI.getEntries({
addressBookId: 'addressBookId123',
page: 0,
pageSize: 50
});

// Search for specific entries
const searchResults = await addressBook.getEntries({
search: 'john',
filter: 'name=="John Doe"'
});

Constructors

  • Creates an instance of AddressBook

    Parameters

    • webex: WebexSDK

      The Webex SDK instance

    • getAddressBookId: (() => string)

      Function to get the addressBookId from agent profile

        • (): string
        • Returns string

    Returns AddressBook

Properties

getAddressBookId: (() => string)

Type declaration

    • (): string
    • Returns string

metricsManager: default
pageCache: PageCache<AddressBookEntry>
webex: WebexSDK
webexRequest: WebexRequest

Methods

  • Fetches address book entries for a specific address book using the entry API

    Parameters

    Returns Promise<AddressBookEntriesResponse>

    Promise resolving to address book entries

    Throws

    If the API call fails

    Example

    // Get entries from agent's default address book
    const response = await addressBookAPI.getEntries();

    // Get entries from a specific address book with pagination
    const response = await addressBookAPI.getEntries({
    addressBookId: 'addressBookId123',
    page: 0,
    pageSize: 25
    });