Address Analyzer

Error messages

The table below shows all error messages the API can return in the message field:

ParameterMessageDescription
zipcode / labelThe zipcode field must contain exactly 8 digitsThe ZIP code was not sent, neither in the zipcode parameter nor in the label, or it does not have exactly 8 digits after the hyphen is removed.
roadsize must be between 0 and 150The road has more than 150 characters.
labelStructure error on label fieldAt least one of the five separating commas is missing in the label. This error takes precedence over ZIP code format errors.
AllRequest body cannot be emptyNone of the parameters road, number, zipcode, district, city or label was filled.

Example with the label format

In the example below, the label has only four commas, because the separator between the street and the number is missing:

{
  "label": "av paulista 1578,bela vista,01310200,sao paulo,SP"
}

The request is rejected with the response below:

{
  "title": "Constraint Violation",
  "status": 400,
  "violations": [
    {
      "field": "analyze.request.label",
      "message": "Structure error on label field"
    }
  ]
}

Examples with the structured format

ZIP code with fewer than 8 digits

In the example below, the zipcode has only 7 digits after the hyphen is removed:

{
  "road": "r da cantarera 306 box 12",
  "number": "",
  "zipcode": "01024-00",
  "district": "centro",
  "city": "sao paulo",
  "state": "SP"
}

The request is rejected with the response below:

{
  "title": "Constraint Violation",
  "status": 400,
  "violations": [
    {
      "field": "analyze.request.zipcode",
      "message": "The zipcode field must contain exactly 8 digits"
    }
  ]
}

Street above the character limit

In the example below, the road has more than 150 characters:

{
  "road": "rua da cantareira 306 box 12 mercado municipal de sao paulo entrada pela porta lateral proximo ao estacionamento falar com o responsavel pelo recebimento no horario comercial",
  "number": "",
  "zipcode": "01024-000",
  "district": "centro",
  "city": "sao paulo",
  "state": "SP"
}

The request is rejected with the response below:

{
  "title": "Constraint Violation",
  "status": 400,
  "violations": [
    {
      "field": "analyze.request.road",
      "message": "size must be between 0 and 150"
    }
  ]
}