Monitoring APIs

Batch

Batch API is for the insert, update and delete register items

Only Population Register Centre data is available through APIs. Use of APIs requires a permission issued by Population Register Centre.

In order to use the API you must have the valid environment-specific username and password. Before any API requests, you need to obtain an API KEY. You will get a valid API KEY (it's called a ticket) by using the ticket API (please, read how to use ticket API).

The API KEY must be sent in the request custom header element (named ticket or x-api-key). If the API KEY value is valid then API request will be successful (http status code 200), otherwise it will fail (http status code 401). All API requests must be made over HTTPS.

SWAGGER - Developer REST API documentation - read more »

Endpoints

  • https://api.bisnode.fi/people/register-monitor/v2/register/{REGISTER ID}/batch - production environment
  • https://api-test.bisnode.fi/people/register-monitor/v2/register/{REGISTER ID}/batch - test environment

Request parameters

ParameterDescription 
id Register ID M
operations

Body is an array of operations. Each operation is a JSON object that have one mandatory parameter _op (operation type).

Currently there are two kind of operation (_op - attribute):

· Upsert (insert or update)
· Delete

Other required parameters depends on the type. E.g. Delete operation requires only reference key, and Upsert operations requires field you want to insert to the your register.

If array contains JSON-object that does not have _op attribute, the objects are simply ignored. If array contains other JSON elements than object you endpoint returns Bad Request HTTP error.

M

Request and response example

curl 'https://api-test.bisnode.fi/people/register-monitor/v2/register/371/batch' -X POST -d 
'[
    {
        "_op":  "Upsert",
        "referenceKey":  "050535-905F",
        "firstName":  "Olavi Janne",
        "lastName":  "Meikalainen",
        "streetAddress":  "Franzéninkatu 3 E 45",
        "postCode":  "00500",
        "postOffice":  "Helsinki"
    },
    {
        "_op":  "Upsert",
        "referenceKey":  "FI2101010969661",
        "firstName":  "Aino Minna",
        "lastName":  "Meikäläinen",
        "streetAddress":  "Aholammentie 562",
        "postCode":  "99600",
        "postOffice":  "SODANKYLÄ"
    }    
]' 
-H 'x-api-key: ABC1234567890' -H 'Content-Type: application/json'

Successful API request returns results in JSON format.

{
    "operationResults": [
        {
            "type": "OperationDone",
            "op": "Upsert",
            "referenceKey": "050535-905F",
            "message": null
        },
        {
            "type": "OperationDone",
            "op": "Upsert",
            "referenceKey": "FI2101010969661",
            "message": null
        }
    ]
}

More detailed implementation guide for the API - read more »