Skip to main content
Version: 1.10.0

Custom Chat API

This chapter will introduce: how to use the Custom Chat API channel to interact with the agent.

Channel Config

  1. Click the "Config" button" to check the channel ID. Channel ID is used to make API calls. channel-id

Usage of OpenAPIs

Preparation

  1. The "OPEN API" section in the toolbar at the top of this documentation contains all the details of the server-side APIs and the engine layer APIs. The server-side APIs support quick calls. For more details, see Guides.

  2. To ensure the security, you need to authenticate the usage of APIs through the service account. For more details, see Service Account.

Create users and replies via APIs

  1. Platform provides Mutate Channel Users API. To call this API, you need the following 2 parameters:
Parameter NameDescriptionsWhere to find
agentIdAgent ID, generated when the agent is createdFront-end URL, or agent settings
channelIdChannel ID, generated when the channel is createdChannel config
  1. Platform provides GetReply API. To call this API, you need the following 3 parameters:
Parameter NameDescriptionsWhere to find
agentIdAgent ID, generated when the agent is createdFront-end URL or agent settings
channelIdChannel ID, generated when the channel is createdChannel config
environmentassign env type-SKETCH or PRODUCTSelect based on whether it is a test channel or product channel
  • Non-created user can be requested and get normal reply, but will not be counted in the message log.
  • Channel_ ID field support -, user can get normal reply, but will not be counted in the message log.

Add user attributes via APIs

  1. User attributes and metadata can be used in flows for the agent to give more customized responses. For more details, see Attributes.

  2. The platform offers Mutate User Attribute Value API. To call this API, you need the following 3 parameters:

Parameter NameDescriptionsWhere to find
agentIdAgent ID, generated when the agent is createdFront-end URL or agent settings
channelIdChannel ID, generated when the channel is createdChannel config
usernameUsername, generated when the user is created-
  1. The GetReply API also supports metadata upload. For metadata shares the same name with that of user attribute, it will override the value of user attribute.