# System Service Interface Invocation
# 1. System provides API interface
The system provides some commonly used API interfaces, such as: ground query, postal code query, express query, etc., for developers to use free. For example: telephone number query this intention, you need to call the API interface. First by slot recognition, Get the user's question, and then call the API of the telephone number query service, Give a clear response. Here is an example of use:
- First, select the required system API at [Reply Type], such as [Telephone Number Query Service].
- Click [Interface Configuration] on the right side to match the input parameters with the semantic slot to ensure the delivery of the semantic slot.
The output parameters here do not need to be configured by the developer, and the system will automatically slot them and associate them with the interface backfill dictionary. If you want to change, you can also delete the semantic slot name filled by the system and redefine the new semantic slot name. After clicking OK, the name of the semantic slot corresponding to the output parameter will be displayed in the semantic slot settings.
- Developers can also debug interfaces in [Interface Configuration] - [API Configuration] to see if the API is in effect. Enter the height and weight values in the debug page to see the status of the results returned.
- After the configuration is complete, the developer can configure the corresponding response results for each query state returned.
# 2. Custom API interface
If the system API does not meet the needs of skill development, the platform also supports developers to upload custom APIs. Click on the Custom API Create a custom interface, fill in the interface name, URL, input/Output parameters, return the status can be
Input parameters, "parameters" are the parameters passed to the API The name of the parameter is used to indicate the meaning of the parameter, "Required" checks whether the parameter has a value when the interface is invoked, and "Input Suggestions" gives suggestions in the interface debugging interface.
In the output parameter, the parameter is API The name of the parameter returned. "Name" is used to indicate the meaning of this parameter. In the return state, the "status code" should be the same as the API Able to return. err_code A one-to-one correspondence, and the "name" indicates the meaning of the status code.
When you click Save, you can see the newly created API, and can be modified, delete operations. In the header of the drop-down options to the right of the service interface call, you can see the API。
# 3. API configuration method
In the drop-down options to the right of the service interface call, select the API, click on the right side of the interface configuration to configure.
for API Requires a semantic slot corresponding to each input parameter of the. (The alternative list is the semantic slot already configured for that intent.) The content of the semantic slot is called as the value of the parameter API, so you need to build a semantic slot in the semantic slot settings section, and set the way to fill the slot. The default value can be set to fill in when no value is provided, and the required parameter can be set to ask for words (otherwise the default ask for words will be used).
for API The system will automatically create a semantic slot with the same name and set its dictionary to The sys. interface backfill, which can be used in the answer to display the returned information.
Interface debug tab, you can set the value of each parameter, click the debug button below, will be from OpenAI The backend tries to call the interface and shows the returned JSON Response. In addition, below the service interface call, you will see the label for each status code, OpenAI When the corresponding status code is obtained, it will jump to the response label for subsequent operations, including reply results, service interface calls, semantic slot information questioning, robot questioning, etc. The semantic slots that have been filled with the returned information are also available in subsequent steps. The same semantic slot can be overwritten and filled in subsequent steps
# 4. Configure user authentication
We provide solutions to help developers identify user authentication information.
When developers use custom interfaces, they can define similar user interfaces as they need._The parameter name of the id, and customize the desired slot. Finally, just associate this slot with the system dictionary: sys..
(1) Add custom interface - define user authentication parameters
(2) Configure Semantic Slots
(3) Associated Systems Dictionary sys.
By configuring it as above, you can bind the user ID as authentication through a dialogue.