Account object

Use the client.context() method to get information about the current account.

context
client.context();
returns
{  "account": {    "id": 1,    "domain": "your-domain",    "currency": "USD",    "timezone": "America/New_York",    "numberFormat": "us",    "timeFormat": "HH:mm",    "dateFormat": "DD/MM/YYYY",    "decimalSeparator": "."  }  // other properties}

Properties

account.id

The unique identifier of the account.

account.domain

Domain of the account.

account.currency

Currency of the account as the 3-character currency code in ISO4217 format.

account.timezone

Timezone of the account.

account.numberFormat

Number format used for the account.

account.timeFormat

Time format used for the account. Either 12-hour clock 12H or 24-hour clock 24H. Possible values: hh:mm A, HH:mm.

account.dateFormat

Date format used for the account.

account.decimalSeparator

Symbol used to separate the integer part from the fractional part of a number written in decimal form.

Current user object

Use the client.context() method to get information about the current user.

context
client.context();
returns
{  "currentUser": {    "id": 2,    "name": "John Doe",    "email": "[email protected]",    "status": "active",    "invited": true,    "confirmed": true,    "role": "user",    "roles": [      {        "id": 1,        "name": "Closer"      }    ],    "createdAt": "2019-09-25T13:38:48Z",    "updatedAt": "2021-02-16T17:24:11Z",    "deletedAt": null,    "phone": "508-778-6516",    "timezone": "Eastern Time (US & Canada)",    "reportsTo": 1,    "group": {      "id": 1,      "group": "Closers A Group"    },    "zendeskUserId": 1,    "locale": "en-US"  }  // other properties}

Properties

currentUser.id

The unique identifier of the account.

currentUser.name

Full name of the user.

currentUser.email

Email address of the user.

currentUser.status

Status of the user’s account. Usually active. Possible values: active, inactive.

currentUser.invited

Indicates whether an invitation has been sent to the user or not. Usually true.

currentUser.confirmed

Indicates whether the user’s account has been confirmed or not.

currentUser.role

Role of the user. Notice that this attribute has no connection with role based access control and permissions. It indicates whether the user is an admin or a regular user. Possible values: user, admin.

currentUser.roles

An array of roles assigned to the user. Each entry in the array includes a unique identifier of the role and it's name. You can expect unique values in the array.

currentUser.createdAt

Date and time of creation in UTC (ISO8601 format).

currentUser.updatedAt

Date and time of the last update in UTC (ISO8601 format).

currentUser.deletedAt

Date and time of deletion in UTC (ISO8601 format) in case the user has been deleted.

currentUser.phone

Contact phone number of the user.

currentUser.timezone

Timezone of the user. Fallbacks to the account's timezone if not set per user.

currentUser.reportsTo

Unique identifier of the manager of the user.

currentUser.group

Group the user belongs to. The group entry includes a unique identifier and a name.

currentUser.zendeskUserId

Unique identifier of the Zendesk user.

currentUser.locale

Defines the user's language preferences that the user wants to see in their user interface.

Events

In addition to the core events, the following event is available to all locations in the Sell product.

Telephony events

Available events:

EventMeaning
voice.dialoutAgent clicked to call a phone number
voice.dialout

The voice.dialout event fires when an agent clicks to call a phone number.

Arguments

  • number the selected phone number
  • resource_id the selected object's id
  • resource_type the selected object's type. Possible values: contact, lead
  • resource_name the selected object's name

Actions

The following actions are available in all locations in the Sell product:

formatDateAndTime

Formats a given date-time respecting the user's formatting and timezone settings.

The action takes two arguments:

You can set the timezone source to 'account' or 'local' to format the date-time using the account settings or the local timezone. The default is 'local'.

invoke
client.invoke("formatDateAndTime", new Date(), "account");
returns
{  "formatDateAndTime": "10/01/2019 04:22 PM"}

formatDate

Formats a given date respecting the user's formatting and timezone settings.

The action takes two arguments:

You can set the timezone source to 'account' or 'local' to format the date-time using the account settings or the local timezone. The default is 'local'.

invoke
client.invoke("formatDate", new Date(), "account");
returns
{  "formatDate": "10/01/2019"}

formatCurrency

Formats a given amount respecting the user's formatting settings.

The action takes two arguments:

  • an amount to format (string or a number)
  • a currency code (optional)

To specify a currency, use ISO 4217 currency codes such as 'USD' for US dollars or 'EUR' for Euros. See the Current currency & funds code list.

If you don't specify one, the currency defaults to the account's currency.

invoke
client.invoke("formatCurrency", "100.01");
returns
{  "formatCurrency": "$100.01"}