Skip to content

Public API Guideline

michaelrangstrup edited this page Jul 11, 2024 · 12 revisions

Introduction

The Public API endpoint offers a number of public methods that do not require any form of authentication.

Function: Generate PDF Report with Soil Contamination Results for BFE Number or Array of Parcels

Initiates the async generation of a PDF report containing soil contamination reports for multiple parcels.

Examples:

It is also possible to send an array of Parcels instead or together with a BFE number using POST requests.

Example for TEST: curl --location 'https://jrd-test-report-fnc.azurewebsites.net/api/GetSoilPollutionReportPDFByBFE' \ --header 'Content-Type: application/json' \ --data '{"bfe": 9432804, "elavMat": [ {"elav": 380151, "matrnr": "10a"}, {"elav": 2006552, "matrnr": "7000df"} ]}'

Example for DEMO: curl --location 'https://jrd-demo-report-fnc.azurewebsites.net/api/GetSoilPollutionReportPDFByBFE' \ --header 'Content-Type: application/json' \ --data '{"bfe": 9432804, "elavMat": [ {"elav": 380151, "matrnr": "10a"}, {"elav": 2006552, "matrnr": "7000df"} ]}'

Example for PROD: curl --location 'https://jrd-prod-report-fnc.azurewebsites.net/api/GetSoilPollutionReportPDFByBFE' \ --header 'Content-Type: application/json' \ --data '{"bfe": 9432804, "elavMat": [ {"elav": 380151, "matrnr": "10a"}, {"elav": 2006552, "matrnr": "7000df"} ]}'

Below is an example of an output object.

{ "requestId": "2852527e-4c97-47f9-8595-1927337cad8a" }

You must use the returned requestID to get the status of report generation and link to the report. The process of generating a report may take a few minutes, depending on size and how busy the service is, so it is best if you implement also an async-friendly UX in the relying system. This could fx be sending the report to requestor by email when it is ready.

Function: Get Status of PDF Report with Soil Contamination Results

Use the requestId you got from the prior method to get the status of the report being generated. You will either be informed that the processing failed, is ongoing, or has completed. When it has completed processing, the response will include a URL from which the report can be downloaded. Please notice that the report will be deleted within one week.

Examples:

Below is an example of a Completed Processing output object.

{"requestId":"c6089b5f-c4a0-4c01-bc58-ad4aae96e5cd","status":"Success","elavMat":[{"cadastralDistrictIdentifier":"360151","landParcelIdentifier":"28e"},{"cadastralDistrictIdentifier":"360151","landParcelIdentifier":"28r"},{"cadastralDistrictIdentifier":"360451","landParcelIdentifier":"2a"},{"cadastralDistrictIdentifier":"360451","landParcelIdentifier":"2n"},{"cadastralDistrictIdentifier":"360451","landParcelIdentifier":"2o"},{"cadastralDistrictIdentifier":"360451","landParcelIdentifier":"2r"},{"cadastralDistrictIdentifier":"360457","landParcelIdentifier":"1ae"},{"cadastralDistrictIdentifier":"360457","landParcelIdentifier":"1z"}],"link":"https://jrdtestmediasto.blob.core.windows.net/pdfreports/c6089b5f-c4a0-4c01-bc58-ad4aae96e5cd.pdf?sv=2019-02-02&sr=b&sig=rJp207lIOlwESRQvOjGIClZDebC%2F4Y9GTmlf9Bsy2RM%3D&se=2024-07-11T04%3A51%3A56Z&sp=r","error":null}

Below is an example of a Failed output object:

{"requestId":"4b4f9bd5-333e-42bb-bd33-c266d9b3f49b","status":"Failed","elavMat":[],"link":null,"error":"BFE must contain at least 1 elav+matrnr"}

Below is an example of an Ongoing output object:

{"requestId":"f412eb82-8b5b-4860-bba8-e7e8ed035f76","status":"InProgress","elavMat":[{"cadastralDistrictIdentifier":"1020251","landParcelIdentifier":"14cu"}],"link":null,"error":null}

Function: Get Parcel Information

Retrieve soil contamination information for specific parcels.

Examples:

Configuration:

Input Object

Attribute Type Description
CadastralDistrictIdentifier Int a unique value for a cadastral district. Search value must be exactly the same as data value for object to be returned.
LandParcelIdentifier String (a.k.a. matrikelnummer) a unique parcel value within the cadastral district. Search value must be exactly the same as data value for object to be returned.
LocationReference String Distinct Reference for a Location. Typical format e.g. {745-00084}. A Location is a Jord-specific term used to refer to a specific area within a Region. Search value must be exactly the same as data value for object to be returned.
RegionCodes List of Int An array of Region Codes. Allowed formats are {1081, 1082, 1083, 1084, 1085}.
MunicipalityCodes List of Int An array of Municipality Codes. Allowed formats are e.g. {101, 147, 151, 153, ...}. You can find all municipality codes here: https://danmarksadresser.dk/adressedata/kodelister/kommunekodeliste
PollutionStatus String Seaches by (as string) values referring to what the pollution status of the location is. E.g. '07' refers to "V1 kortlagt"
PollutionNuanceStatus List of String Search by values referring to what the pollution nuance status of the parcel is, e.g. {'01'} means you will get any parcel where nuance status is 'F0 Nuanceret'. If you set value to {'01','02'} you will get parcels where nuance status is set to both 'F0 Nuanceret' and 'F1 Nuanceret'.
ModifiedDateFrom String Makes sure to just return Parcels where the content of the Parcels were changed after the specified date. This parameter is useful when third parties want to keep the Parcels in DKJord in sync with Parcels in their own database. By using this date filter, they can make sure to just sync Parcels that were changed since last time the service was called.
RecalculationDateFrom String Allows sorting the results by any of the following enums (referencing the applicable output value): CadastralDistrictIdentifier, LandParcelIdentifier, RegionCode, MunicipalityCode, PollutionStatus, PollutionNuanceStatus
SortField String The position for Scale Bar, Default None is not attached(None, TopLeft, BottomLeft, TopRight, BottomRight)
SortByAscending Boolean Combines with the sortField to decide whether the results are returned by sorting or descending order. Set to TRUE for Ascending. Set to FALSE for Descending.
Skip Int Results are organized in an indexed order.Using the Skip function, the user can decide from which index to start the search.This parameter combined with the parameter 'take' enables use of paging
Take Int Species the number of (max) records to return. This parameter combined with the parameter 'skip' enables use of paging

Below is an example of an output object:

{
  "items": [
    {
      "id": "cc1e4ef2-9ef6-4ddb-af9e-afda00e2b66f",
      "cadastralDistrictIdentifier": 2005352,
      "landParcelIdentifier": "311",
      "housingStatementIndicator": false,
      "pollutionStatusCodeType": 1,
      "pollutionStatusCodeValue": "13",
      "pollutionNuanceStatus": [
        ""
      ],
      "recalculationDate": "2023-04-04T13:45:25.71",
      "regionCode": 1081,
      "municipalityCode": 851,
      "modifiedDate": "2023-04-04T13:45:26.177",
      "locations": [
        {
          "locationReference": "851-00047",
          "locationName": "Nedlagt svovlsyre og gødningsfabrik, Limfjordsvej"
        }
      ]
    }
  ],
  "total": 1
}

Function: Get Stancode1008

Retrieve the complete Stancode 1008 list containing parameter values used to qualify pollution components.

Examples:

Configuration:

Input Object

Attribute Type Description
ScCodes Array Array of Stancode values from Sc1008 list that you wish to retrieve detailed information for.
Take Int Max records to return in result.

Below is an example of an output object:

{
    "items": [
        {
            "scKode": 1,
            "beskrivelse": "Aske",
            "øvrigBeskrivelse": "",
            "stancodeGuidKey": "4f7a2d88-08ed-49af-8ba3-701574dc42c0",
            "kodehenvisning": 1,
            "henvisningsTypeNavn": "Valid",
            "caSnr": "",
            "sidstÆndretDato": "2017-04-24T00:00:00+00:00",
            "oprettelsesDato": "2011-06-03T00:00:00+00:00",
            "forældelsesDato": null,
            "ansøger": "Ej oplyst - ej oplyst"
        },
        {
            "scKode": 2,
            "beskrivelse": "Vand",
            "øvrigBeskrivelse": " ",
            "stancodeGuidKey": "c2150bdb-e7e4-4e44-9297-3c46d2c11e7f",
            "kodehenvisning": 2,
            "henvisningsTypeNavn": "Valid",
            "caSnr": "7732-18-5",
            "sidstÆndretDato": "2023-05-11T00:00:00+00:00",
            "oprettelsesDato": "2011-06-03T00:00:00+00:00",
            "forældelsesDato": null,
            "ansøger": "Ej oplyst - ej oplyst"
        }
    ],
    "total": 2
}

Function: Convert Standat to Stancode

Makes it possible to send a Standat value and get its mapped Stancode value returned based on a mapping file existing in the Jord database between the two systems.

Examples:

Configuration:

Input Object

Attribute Type Description
Standat string Standat value to be converted to a Stancode value

Below is an example of an output object:

{
    "stancode": 1
}

Notice: If 'stancode: -1', it means there are no corresponding Stancode mappings for the provided input.

Function: Convert Stancode to Standat

Makes it possible to send a Stancode value and get its mapped Standat value returned based on a mapping file existing in the Jord database between the two systems.

Examples:

Configuration:

Input Object

Attribute Type Description
Stancode Int Stancode value to be converted to a Standat value

Below is an example of an output object:

{
    "standat": "8"
}

Notice: If 'standat: -1', it means there are no corresponding Standat mappings for the provided input.