All Products
  • 14 Jul 2022
  • 1 Minute to read
  • Dark
    Light

All Products

  • Dark
    Light

Article Summary

Introduction

The following objects will be shared in all supported app products. You can get the corresponding information according to the API provided for each object.

First of all, you must understand the methods provided by the SDK. Click here for the corresponding document.

Objects

Basic Data Structure

Agent

NameTypeDescription
idstringAgent id
namestringAgent name
emailstringAgent email
permissionsarrayCurrent agent permission list. If current agent is admin, permission field return a empty array.
statusstringThe status of agent, this property is only available for Agent Console
chatsnumberOngoing chats, this property is only available for Agent Console
isAdminbooleanThe role of current agent
avatarstringThe avatar of current agent
languagestringThe language set by the site which the agent belongs to
timeZonestringTime zone set by agent
datetimeFormatstringTime format set by agent

Permission

NameTypeDescription
idnumberIt is permission Id
descriptionstringIt raw html, describe the scope of this permission
moduleIdstringModule name to which the permission belongs
parentIdnumberThe current permission belongs to which parent permission

Agent

Agent refers to the currently logged-in agents. The Agent object supports the Agent Console and Control Panel modules.

Actions

  1. Get Current Agent Information

Get information of current logged-in agent.

Parameters: No parameters.

Scripts

const client = APPClient.init();
const currentAgent = await client.get("currentAgent");
  1. Change status for current agent
    This API only supports in Agent Console.

Parameters:

NameTypeDescription
labelstringThe label of status switch to. System label: online, offline and away

Scripts:

const client = APPClient.init();
client.set("currentAgent.status", label);

App

Actions

  1. Get the settings of app

Parameters: no parameters

Scripts:

const client = APPClient.init();
client.get("app.settings")
.then(function(settings) {
// do stuff
});

  1. Store the settings of app

Parameters:

NameTypeDescription
settingsobjectNeeds to be stored data for your app

Scripts:

const client = APPClient.init();
client.set("app.settings", settings);


Was this article helpful?