This section describes how to call Address Autocomplete Postalcode-City Service. You may want to try it out with a FreeTrial Account
- HTTP Request
- URL Composition
- BaseURL: https://api.cloud.precisely.com
- Postalcode-City:v1/autocomplete/postal-city
- SupportedMethods: POST only
- Rate Limit (Transactions per second): 120
- Input Fields : Each request to the API service requires a few parameters, all of which are listed below. All requests require a Bearer token, that can be generated using your account's key-secret. To produce a bearer token for an API request, the generated key-secret combinations are used. The generated token is valid for 3600sec (1 hour) and then it needs to be regenerated.
- URL Composition
Parameter |
Description | Example Value |
|---|---|---|
preferences |
Options supported by the Postalcode-City Service which includes a variety of settings for more information such as maxResults, return all metadata information. |
|
address |
Postcode and City/Postcode only/ City only autocompleteto be processed. |
Requestedpostcode or city information, based on the country's postal standard. Single-linerequest: "10downingstreetlondonSW1A2AA" Multi-linerequest: "10DOWNING STREET", "LONDON, SW1A 2AA" |
{
"preferences": {
"maxResults": 10,
"returnAllInfo": true,
"factoryDescription": {
"label": "",
"featureSpecific": {}
},
"clientLocale": "",
"clientCoordSysName": "",
"distance": {
"value": 150,
"distanceUnit": "METER"
},
"streetOffset": {
"value": 7,
"distanceUnit": "METER"
},
"cornerOffset": {
"value": 7,
"distanceUnit": "METER"
},
"fallbackToGeographic": false,
"fallbackToPostal": false,
"matchMode": "",
"returnOfAdditionalFields": false,
"originXY": [],
"customPreferences": {}
},
"address": {
"type": "POSTAL",
"postAddress": "12180",
"country": "USA"
}
}Preferences
|
Option |
Type |
Description |
|---|---|---|
|
maxResults |
Integer | The maximum number of candidates to return. Default = 1. |
|
returnAllInfo |
Boolean |
Specifies whether to return all available information for each candidate. true Return all available information for each candidate. falseDo not return all available information for each candidate. Default. |
|
customPreferences |
Object |
For use against any country dataset, defines custom preferences to control additional functionality. |
Request Parameters
|
Parameter |
Type | Description |
|---|---|---|
| country | String | Values are based on the ISO 3166-1 standardfor country codes (returned in alpha-2, alpha-3, or numeric format). |
| city | String | Specifies a city or town name.
|
| postalCode | String | Main postal code. "80125" |
|
X-Request-Id (header) |
String | The X-Request-Id header is optional but incredibly useful for developers. It serves as a unique identifier for requests within our system. When you encounter any problems with your requests, providing us with the X-Request-Id will enable us to pinpoint the specific request in question without the need for extensive manual searching. This means faster and more efficient troubleshooting. |
| X-Transaction-Id (header) |
String |
By utilizing the X-Transaction-Id, you can logically group multiple related requests together, ensuring they are treated as a single unit of work from our perspective. This means that you won't be charged separately for each request within the same transaction. Instead, you will be billed for the entire transaction as a whole. Using the X-Transaction-Id is straightforward; simply include it in the header of your initial request to begin a new transaction. Then, include the same transaction id in subsequent requests that are part of that transaction. |