Multiple properties in a single police or stats account

Quick Links:

Multiple properties in Police Account

When having a single police account with multiple properties, you can add each property / apartment / rental unit as a Housing, adding a police account with the same user & password for all, but setting the fields external_id and external_name on each one to identify the property. This values can be obtained from the police website, in some cases can be the address, and in others this parameter might be optional.

For example, a Housing connected with Italian State Police, having multiple apartments:

					

Apartment 1A
{
    "type": "HOU",
    "name": "Apartment 1A",
    "police_account": {
        "type": "ISP",
        "username": "police user",
        "password": "police password",
        "certificate_password": "other police password",
        "external_name": "Corso Umberto I 123 A",
        "external_id": "12",
    },
    "location": {
        "country": {
            "code": "IT",
        },
    },
 }
 
Apartment 1B
{
    "type": "HOU",
    "name": "Apartment 1B",
    "police_account": {
        "type": "ISP",
        "username": "police user",
        "password": "police password",
        "certificate_password": "other police password",
        "external_name": "Corso Umberto I 123 B",
        "external_id": "13",
    },
    "location": {
        "country": {
            "code": "IT",
        },
    },
 }

Multiple properties in Stats Account

When having a single police account with multiple properties, you can add each property / apartment / rental unit as a Housing, adding a stats account with the same user & password for all, but setting the fields external_housing_id on each one to identify the property. This values can be obtained from the statistics website.

For example, a Housing connected with policeand also connected with ISTAT in Veneto, having multiple apartments:

					

{
    "type": "HOU",
    "name": "Apartment 1A",
    "police_account": {
        "type": "ISP",
        "username": "police user",
        "password": "police password",
        "certificate_password": "other police password",
        "external_name": "Corso Umberto I 123 A",
        "external_id": "12",
    },
    "stat_account": {
        "type": "ITVE",
        "username": "istat user",
        "password": "istat password",
        "external_housing_id": "IP01234567890",
    },
 
    "location": {
        "country": {
            "code": "IT",
        },
    },
 }

Other extra fields in Italy ISTATs:

Some statistics centers in italy, i.e. Sardegna and Toscana, require extra parameters like city or province at stat account level.

For each city or province there is a code, and it needs to be set at “external_location_id” field in stats account:

					

"stat_account": {
    "type": "ITSA",
    "username": "istat user",
    "password": "istat password",
    "external_location_id": "iw_ca"
},

There is an endpoint to get the list of possible values for each istat region:

For example, to get provinces of Toscana:

					

GET https://a.chekin.io/api/v3/stat-type-locations/?stat_type=ITTO

Response:
[
    {
        "id": "Siena",
        "name": "Siena"
    },
    {
        "id": "Arezzo",
        "name": "Arezzo"
    },
    {
        "id": "Grosseto",
        "name": "Grosseto"
    },
    {
        "id": "Livorno",
        "name": "Livorno"
    },
    {
        "id": "Lucca",
        "name": "Lucca"
    },
    {
        "id": "Massa Carrara",
        "name": "Massa Carrara"
    },
    {
        "id": "Pisa",
        "name": "Pisa"
    }
]

Other example, to get cities of Sardegna:

					

GET https://a.chekin.io/api/v3/stat-type-locations/?stat_type=ITSA

Response:


[
    {
        "id": "iw_ca",
        "name": "Cagliari"
    },
    {
        "id": "iw_ci",
        "name": "Ministero degli Affari Esteri"
    },
    {
        "id": "iw_vs",
        "name": "Regione Autonoma Della Sardegna"
    },
    {
        "id": "iw_nu",
        "name": "Nuoro"
    },
    {
        "id": "iw_og",
        "name": "Ogliastra"
    },
    {
        "id": "iw_ot",
        "name": "Olbia Tempo"
    },
    {
        "id": "iw_or",
        "name": "Oristano"
    },
    {
        "id": "iw_ss",
        "name": "Sassari"
    }
]

Related Articles