Skip to main content
@smokeballdev/smokeball-client-sdk

Interface: Api

Entry point for contacts to Smokeball.

Methods

create()

create(request): Promise<Contact>
Create a new contact and returns the contact. Currently only Person and Company contacts are supported.

Parameters

request
CreateContactRequest the create request.

Returns

Promise<Contact>

Example


get()

get(contactId): Promise<Contact>
Gets the contact associated to the specified contact id.

Parameters

contactId
string the contact to retrieve.

Returns

Promise<Contact> the specified contact.

Example


observe()

observe(callback): void
Creates a subscription for all contacts. Check against the contact you are interested in within your registered callback. To prevent doubling up of changes, notifications triggered by the contact update call will not be notified here. Only one subscription will be made per session. Regardless of how many times this function is called, the last registered callback will be used.

Parameters

callback
(contact) => void the function to execute when a change is made to contact(s) in Smokeball.

Returns

void

Example


open()

open(contactId): void
Opens the contact associated to the specified contact id.

Parameters

contactId
string

Returns

void

Example


update()

update(request): Promise<Contact>
Updates the contact associated to the specified contact id and returns the contact. Currently only Person and Company contacts are supported.

Parameters

request
UpdateContactRequest the update request.

Returns

Promise<Contact>

Example