Skip to main content

API Reference

The x-bees-connect Client offers a variety of functions and methods to interact with the x-bees platform seamlessly. Explore the API reference below to understand the capabilities of this SDK.

Initialization

ready()

Sends the signal to x-bees that the iFrame is ready to be shown. This should be sent when the application starts and is ready.

isAuthorized: (payload: string) => Promise<ResponseFromChannel>

Sends a message to x-bees indicating that the user is authorized and no further actions are required.

isNotAuthorized: (payload: string) => Promise<ResponseFromChannel>

Sends a message to x-bees indicating that user actions are required.

onSuggestContacts: ((query: string, resolve: Resolve, reject: Reject) => void) => RemoveEventListener

Starts listening for events of searching contacts and handles autosuggestion with the provided callback.

Client.getInstance().onSuggestContacts(async (query, resolve) => {
try {
const contacts = await fetchContacts(query);
resolve(contacts);
} catch (error) {
console.log('catch', error);
}
});

onLookupAndMatchContact: ((query: ContactQuery, resolve: Resolve, reject: Reject) => void) => RemoveEventListener

Starts listening for events of searching contact info and handles matching with the provided callback.

Client.getInstance().onLookupAndMatchContact(async (query, resolve) => {
try {
const contact = await fetchContactAndMatch(query);
resolve(contact);
} catch (error) {
console.log('catch', error);
}
});

Context

getContext(): Promise<Response>

Retrieves current x-bees context data. The data may vary depending on the context.

getCurrentContact(): Promise<Response>

Retrieves contact data currently opened in x-bees.

...

Other

version(): string

Retrieves the version of xBeesConnect.

startCall(phoneNumber: string)

Sends a request to x-bees to start a call with a specified number.

...

Explore the various functions and methods provided by the x-bees-connect Client to enhance your integration with the x-bees platform. Continue to the Context section to learn about retrieving context data from x-bees.