In third party skills, connect with a personal server or other systems, which can be used to return custom responses to the client.
The response service is allowed to use third party skills. In the default case, the response service should be deactivated. When the response service is activated, requests and other information will be sent to the API address filled in the response service.
The following figure shows the process of the response service
If there are no skills yet, a dialog skill through bot or my skill needs to be created.
Active response service through the left side bar. Click the switch button and fill in the API server address field.
When the response service is activated, the platform will send an HTTP GET request to the server. This GET request will take client question(s).
Example:
Assume the API URL filled in is http://my.domain.com/services/endpoint?q=
When the client says hello
, the platform will send following request
http://my.domain.com/services/endpoint?q=hello
The service should respond based on the search request. The service can ask other third party API and return the result to the client. information such as image, video, card, etc. can also be added.
The service response should fix the format for DialogAnswer. For example, for questions about the response data types, visit the rich response doc.
{"stage":[{"text":{"text":["Hello, is there anything I can help you with?"]}},{"image": {"title": "Image Title","url": "http://www.example.org/Costco-Waterloo-Ontario-Gas-Station.jpg","alt": "Some image."}}]}
In order to present error, please add status, error message and exception to response or output.
name | type | required | description |
---|---|---|---|
status | String | false | If value is “failed”, then operation failed |
errorMsg | String | false | Message is sent back to the client |
errorMsgFull | String | false | Full view of error message. Can be used to debug |
Example:
{"status":"failed","errorMsg":"java.lang.NullPointerException.","errorMsgFull":"Exception in thread main java.lang.NullPointerException at Entity.<init>(Entity.java:24) at Main.<init>(Main.java:22) at Main.main(Main.java:18)"}