Custom API for address collection
This document explains how to configure a custom API for the Interactive Parameter Collection feature to gather address information and how to verify the configuration.
Overview
The Interactive Parameter Collection feature allows a bot to gather a complete and accurate address from a user through a multi-turn conversation. If a user provides only a partial address, the bot prompts the user for the missing information, such as the place name, street address, city, or district. This step-by-step confirmation process reduces address inaccuracies and regional ambiguity.
API specification
The custom API only supports GET requests.
Input parameters
Parameter | Type | Required | Description | Example |
keywords | String | Yes | Keywords or partial addresses that the user provides during the conversation. | Wangjing SOHO / Near Beijing South Railway Station |
Output parameters
The response must contain status information and an address tip list. The bot uses the fields in the address tip list for address confirmation and completion, and for use in subsequent business logic.
Top-level response fields
Field | Type | Required | Description | Purpose |
status | String | Yes | Response status. Typically, | Indicates whether the API call was successful. |
info | String | Yes | A description of the response status. | Identifies the cause of a failure or provides a success message. |
count | String / Number | Yes | The total number of results. | Indicates if the response contains any usable address tips. |
tips | Array | Yes | The address tip list. | Contains detailed results for address confirmation and completion. |
Fields in the tips list
tips is a list of tip messages. Each tip must contain the following fields.
Field | Type | Required | Description | Purpose |
name | String | Yes | The name of the suggested location. | Confirms the location mentioned by the user. |
city | String | Yes | The name of the city. | Identifies the city. |
district | String | Yes | The administrative region, which typically includes the province, city, and district. | Identifies the region and validates address completeness. |
address | String | Yes | The detailed street address. | Used to complete the full address information. |
adcode | String | Yes | The administrative region code. | Enables regional matching and subsequent business logic. |
Example response
{
"status": "1",
"info": "Success",
"count": "1",
"tips": [
{
"name": "Wangjing SOHO",
"city": "Beijing",
"district": "Chaoyang District, Beijing",
"address": "Futong East Street, Wangjing, Chaoyang District, Beijing",
"adcode": "110105"
}
]
}