This documents describes how to integrate with chat service APIs.
GET
http://[host]:[port]/[endpoint]/chat
https://api.rsvp.ai/sandbox/chat?botid=999001&token=rsvpai&uid=123459&q=howdy
Key | Type | Note | Default |
---|---|---|---|
Parameters | |||
uid | String | [REQUIRED], user id, e.g.:123456, contains user and session information | |
q | String | [REQUIRED], question for the chatbot, e.g. "Hi" | |
token | String | [REQUIRED], credentials for using the service, do not share it with others. | |
lang | String | [OPTIONAL], language for the current bot/skill, suports "cn" (for Chinese) and "en" (for English) | en |
botid | String | [OPTIONAL], ID of the bot. | |
skillid | String | [OPTIONAL], ID of the skill your want to use. | |
stage | String | [REQUIRED], in which stage (test/release) you want to use your bot | test |
Content-Type: application/json;charset=utf-8
{"params":{"skillId":"1003064","tid":"981b05d6-d0d4-4ce4-a007-1fee5c573290"},"stage": [{"message": "YOUR ANSWER""props": {"faq_info": {"candidates": [{"score": 1,"gid": "144617","groupBusinessId":"","question": "YOUR QUESTION","answer": "YOUR ANSWER","skillname":"faq_business","labels": ["1"]},{"score": 0.9668123,"gid": "144618","question": "YOUR OTHER QUESTION","answer": "YOUR OTHER ANSWER","skillname":"faq_business","labels": ["2"]}],"skillname":"faq_business","gid": "144617","groupBusinessId":"","labels": ["1"]}},}],"status": 0,"topic": "faq"}
{"params":{"skillId":"1001815","intentSlots":{"location":[{"slotType":"system_location","value":[["0","Beijing","Beijing","China","Asia"]],"key":"Beijing"}]},"intentName":"Weather Forecast","nluSkillId":"402881436cdddd17016cdde307b105a9","intentCandidates":[{"sentence":"Beijing's Good","skillid":"402881436cdddd17016cdde307b105a9","score":1.0,"skilllevel":"open_m","originalSkillid":"1001815","name":"Weather Forecast","intentid":"402881436cdddd17016cdde307da05af","fulfillment":false,"done":true,"slotProperties":{"location":[{"slotType":"system_location","value":[["0","Beijing","Beijing","China","Asia"]],"key":"Beijing"}]}}{[OTHER RESPONSES]}],"tid":"4f9a2671-2de8-469d-a12f-86509ab5f9f5"},"stage":[{"message":"Beijing's Good"}],"status":0,"topic":"nlu_skill"}
Key | Type | Note |
---|---|---|
status | int | Response status.(0 for success, -1 for failure) |
topic | String | Catagory of the result. |
stage | JSONArray | A list of responses |
DialogStage Objects
Name | Type | Note |
---|---|---|
message | String | Response message |
url | String | URL for media streams |
image | String | URL for images |
props | Map | [OPTIONAL] Contains FaqInfo when topic is "faq" |
action | String | Instruction for robot (that are in hardware forms) |
FaqInfo Objects
Name | Type | Note |
---|---|---|
gid | String | Answer's group id |
skillname | String | Name of the skill |
candidates | JSONArray | Candiates of all possible other outcomes |
Candidate Objects
Name | Type | Note |
---|---|---|
gid | String | Answer's group id |
skillname | String | Name of the skill |
score | Double | A score indicating how likely the response is correct |
question | String | Question asked |
answer | String | Returned answer |
Version Number | Date | Update |
---|---|---|
1.0 | 2019-12-12 | Translated version. |