API - Description - Address - CP - Response

Support DQE
Support DQE
  • Updated

CP Response Success

The JSON response is a dictionary whose keys are the numbers from 1 to n and where each element is itself a dictionary containing the following keys :

  • If the postal code does not refer to a street or a company :

Request example :
https://{SERVER_ADDRESS}/CP/?CodePostal=75015&Alpha=True&Instance=0&Pays=FRA&Licence={LICENCE_CODE} 

KeyValueAlways in JSON?Format if in JSON response
Province

Region where the city is located. Type will depend on the country where the search is performed.

Ex for USA: State’s 2 letter code will be sent here

YesSTRING(50)
IDLocaliteUnique code for each city (INSEE code for France)YesSTRING(20)
PaysISO country codeYesSTRING(3)
InstanceNumber passed as a parameter during the call and returned in the responseYesSTRING(3)
CodePostalCity Zip CodeYesSTRING(10)
SousLocaliteAdditional information on cityYesSTRING(50)
LieuDitDependent locality if applicableYesSTRING(50)
LocaliteCity nameYesSTRING(50)
LatitudeLatitude code of the centre of the localityYesDECIMAL(18)
LongitudeLongitude code of the centre of the localityYesDECIMAL(18)
IDVoieUnique number to designate the street (if not empty it means that the postal code references a street)YesSTRING(20)
NbNumeroNumber of numbers in the streetYesSTRING(4)
VoieOnly if IDVoie is filledNoSTRING(50)
NumeroEmptyYesEmpty
ListeNumeroEmptyYesSTRING(1024)
TypeVoieEmptyYesEmpty
ComplementAdditional address informationYesSTRING(255)
EntrepriseCompany nameYesSTRING(255)
CedexIndicates whether it is a cedex or not (1 = CEDEX, 0 = not CEDEX)YesSTRING(1)

Example:

{
"1": {
   "Province": "IL",
   "IDLocalite": "60007",
   "NbNumero": "",
   "Pays": "USA",
   "IDVoie": "",
   "Cedex": "0",
   "Numero": "",
   "TypeVoie": "",
   "Instance": "",
   "ListeNumero": "",
   "CodePostal": "60007",
   "SousLocalite": "",
   "LieuDit": "",
   "Latitude": "",
   "Localite": "Elk Grove Village",
   "Longitude": "",
   "Complement": "",
   "Entreprise": ""
}
}

 

  • If the postal code refers to a street or a company :

Request example :
https://{SERVER_ADDRESS}/CP/?CodePostal=92390&Alpha=True&Instance=0&Pays=FRA&Licence={LICENCE_CODE} 

FieldMeaningAlways in JSON?Type / Format
ProvinceRegion/Province where the city is located (here *)YesSTRING(50)
IDLocaliteUnique code for the city (e.g. INSEE for France)YesSTRING(20)
PaysISO country codeYesSTRING(3)
InstanceParameter passed in request and returnedYesSTRING(3)
CodePostalZip / Postal codeYesSTRING(10)
SousLocaliteAdditional locality infoYesSTRING(50)
LieuDitDependent locality / place nameYesSTRING(50)
LocaliteCity name / labelYesSTRING(50)
LatitudeLatitude of locality centerYesDECIMAL(18) (often returned as STRING in your sample)
LongitudeLongitude of locality centerYesDECIMAL(18) (often returned as STRING in your sample)
IDVoieUnique identifier for the streetYesSTRING(20) (alphanumeric possible, e.g. W2503962)
VoieStreet nameConditional (only if IDVoie is not empty)STRING(50)
NbNumeroCount of house numbers on the streetYesSTRING(4) (numeric in practice)
ListeNumeroList of house numbers (semicolon-separated)YesSTRING(1024)
NumeroHouse number (empty in sample)YesSTRING (can be empty)
TypeVoieStreet type (empty in sample)YesSTRING (can be empty)
ComplementAdditional address detailsYesSTRING(255)
EntrepriseCompany nameYesSTRING(255)
CedexCedex flag (1 = CEDEX, 0 = not CEDEX)YesSTRING(1)

Example:

{
  "42": {
    "Province": "*",
    "IDLocalite": "92048",
    "NbNumero": "14",
    "Pays": "FRA",
    "IDVoie": "1750416",
    "Voie": "RUE DE LA PEPINIERE",
    "Cedex": "0",
    "Numero": "",
    "TypeVoie": "",
    "Instance": "0",
    "ListeNumero": "2;2B;3;4;5;6;7;8;10;12;14;16;18;20",
    "CodePostal": "92360",
    "SousLocalite": "",
    "LieuDit": "",
    "Latitude": "48.8130414978102",
    "Localite": "MEUDON (LD. MEUDON LA FORET)",
    "Longitude": "2.23855375105306",
    "Complement": "",
    "Entreprise": ""
  }
}

CP Response Error

Error typeRequestResponse type
Missing “Licence” parameterhttps://{SERVER_ADDRESS}/CP/?CodePostal=77777&Alpha=True&Instance=0&Pays=FRAEmpty response
Empty “Licence” parameterhttps://{SERVER_ADDRESS}/CP/?CodePostal=77777&Alpha=True&Instance=0&Pays=FRA&Licence=Empty response
Incorrect Licence number (expired, out of scope, nonexistent)https://{SERVER_ADDRESS}/CP/?CodePostal=77777&Alpha=True&Instance=0&Pays=FRA&Licence={INCORRECT_LICENCE_CODE}Empty response
Missing “CodePostal”parameterhttps://{SERVER_ADDRESS}/CP/?Alpha=True&Instance=0&Pays=FRA&Licence={LICENCE_CODE}400 Bad Request Error
Error on a parameterhttps://{SERVER_ADDRESS}/CP/?CdePostal=77777&Pays=FRA&Alpha=true&Licence={LICENCE_CODE}400 Bad Request Error

Related to

Was this article helpful?

0 out of 0 found this helpful