Address Fit

Fits a street address into a country-specific maximum length.

Fits a single street address line into the requested maximum length for the given country. The street is progressively abbreviated using country-specific abbreviation rules (e.g. "Street" -> "St", "Apartment" -> "Apt") until it fits, or until no further abbreviation is possible.

The result.status field indicates the outcome:

  • OK — the processed street fits within maxLength. warnings is omitted.
  • WARN — the street could not be shortened enough to fit within maxLength, so the best-effort abbreviated street is returned along with a non-empty warnings list.

If the request itself is invalid (missing/blank street, unsupported or unrecognised countryCode, out-of-range maxLength, malformed JSON, etc.) no result is returned; instead a 4xx/5xx response with a non-empty errors list is returned. See the Error Codes table above for the full list.

post/v1/address-fit

Request

  • Base URL: https://api.cloud.precisely.com
  • URL: https://api.cloud.precisely.com/v1/address-fit
  • Auth: one of:
    • HTTP bearer
    • API key in header Authorization

Headers

X-Request-Idstring

Optional client-supplied correlation id, echoed back in logs to help trace a single request end-to-end. If omitted, the request is still processed normally.

Request body

streetstring required

The street address line to fit. Must be non-blank and at most 500 characters.

countryCodestring required

Country code identifying which country-specific abbreviation rules to apply. Must resolve to a valid ISO 3166-1 alpha-3 code (e.g. "GBR", "USA"); values that cannot be resolved to a supported alpha-3 code, or that resolve to a country not yet supported by this API, are rejected (see DIS-LI-1016 in the Error Codes table above).

maxLengthinteger

Maximum allowed length (in characters) for the processed street. If omitted, the country's default maximum length is used.

Example request

{
  "street": "123 Main Street Apartment",
  "countryCode": "USA",
  "maxLength": 15
}

Response

Street address fitted successfully (see result.status for OK/WARN)

Example response

{
  "response": {
    "status": "OK",
    "result": {
      "countryCode": "GBR",
      "maxLength": 16,
      "originalStreet": "123 Some Long Street Name",
      "processedStreet": "123 Some Long St",
      "originalLength": 25,
      "finalLength": 16,
      "warnings": [
        "Not able to achieve desired max length"
      ]
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.