Try out GetReply APIs via platform
Open the Open Platform
Click the "OPEN API" on the toolbar at the top left of this page, select Service APIs, to open the open platform on a new page.
Ways to call commonly used APIs
Create a new user
- Select Mutate Channel Users
/chatbot/v1alpha1/agents/{agentId}/channels/{channelId}/users/mutate
ofChannelUserService
- Click "Try it out" and fill in all configuration items.
- For details in finding robot ID and channel ID, see Create users and replies via APIs
- The following is an example of the body section:
{
"operations": [
{
"create": {
"username": "username here",
"nickname": "nickname here",
"avatarUrl": "https://newtestchatbot.wul.ai/help/zh/img/logo_large.png"
}
}
]
}
- Click "Execute", you can find the new user created through API on the "Analyze - Message Log - By User" page.
Get reply
You need to create a skill first before calling this API. For ways to create a skill, see Build the First Agent.
- Select GetReply
/chatbot/v1alpha1/agents/{agentId}/channels/{channelId}/environments/{environment}/getReply
ofChannelRepyService
- Click "Try it out" and fill in all configuration items.
- For details in finding robot ID and channel ID, see Create users and replies via APIs
- If the current version has not been published, you can set the "environment" as "sketch". Otherwise, set it as "product".
The following is an example of the body section:
{
"username": "username here",
"query": {
"text": {
"content": "hi"
}
}
}
- Click " Execute", and you can see the preset response given by the agent in the "Response body" section below.
- At the same time, a new log can be found on the relevant page of "Analyze - Message Log".
note
The agent can also give a preset response even though you call this API without a pre-created user, but the data can not be written to the log.