API specification (1.0)

Specification with examples for the official PDT Norge API.

We would like to hear your input for improvements, send this to ......
Updated: 28.08.2023 16:57

End­point­s

Test systems are reset with data from production every Sunday night

System

End point (URL)

Test system

https://test-portal.pdtnorge.no/API/1.0/.....

Production system

https://portal.pdtnorge.no/API/1.0/.....


Swag­ger

In swagger you will find an overview of available versions of the API and further details about what functions are in these.
NOTE! Always use the latest version of the API. Older versions of the API may eventually be discontinued, but this will be notified on an ongoing basis.

Swagger has been added to the following addresses:

IMPORTANT! Log in with your API user to access the swagger pages on the pages first.

Solution

URL

Production system

https://portal.pdtnorge.no/swagger


De­fini­tio­n of terms

The API builds on top of the Entity Attribute Value model of the data dictionary in

Meta data concepts:

Term

Description

Entity

An entity is a description of a type of an item. Or a schema definition of an item/object type.
An example is the "Product Data Template" entity.

Attribute

Attributes are a part of entities. A schema field if you like for the entity.
An example is "Name" for the entity "Property".

Data concepts:

Term

Description

Item

An item is an actual object instance from a specific entity.
An example is an item of entity "Property".

Value

A stored value for an item referencing one of the attributes of the entity of the item.
An example is the value "tensile strength" for attribute "Name" for an item of the entity "Property".

Full diagram of all entities and attributes:


Aut­hen­tic­ation

Authentication is done until further notice with BASIC authentication. Security and encryption here are taken care of by the transport layer (HTTPS).

Example:

Select all
Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l

NOTE! PDT Norge will create API users who are given special access to the system with which you must use to log in to the API.


Er­ror co­des

In the event of a validation error in the API, HTTP result code 422 is returned, with the following JSON structure:

Eksempel:

Select all
{
    "Error" : "descriptive error message here",
    "Code" : 123
}
  • Error - Error message

  • Code - Error message code


See Swagger for updated documentation on all features of the API.

Th­rott­lin­g

All API users are encouraged to run at night between 02:00 and 06:00 (Norwegian time). The throttling will then have a less restrictive setup.

NOTE! In case of error code 429 - then the API calls must wait and run again. See further information in the headers.

Endpoints with throttling transmitter with headers with info about this:

Select all
x-rate-limit-limit: 1s
x-rate-limit-remaining: 4
x-rate-limit-reset: 2020-06-08T13:58:10.7711830Z

If API throttles then sent with header:

Select all
retry-after: 1