Starting an import process

The Import API specifications can be find at Import API description

The import API has the following mandatory headers:

  • X-DATASOURCE' : the UUID of the data publisher
  • X-PUBLISHER: the UUID of the publisher the data should be inserted
  • x-api-key for authentication and authorisation

🚧

The POST method is deprecated, please use PUT (Upsert)

Instead of POST (insert) and PUT (combined with the instance's id) we recommend to use the upsert functionality, which is the HTTP PUT methoud without specifying an ID as a URL parameter.

This will make sure that in case an instance does not exist, it will be created and in case an instance exists it will be updated.

To import your data, send a HTTP POST request to the API ts/v1/kg/things/imports

Import our running example

curl --location --request PUT 'https://proxy.opendatagermany.io/api/ts/v1/kg/things/imports' \
--header 'Content-Type: application/ld+json' \
--header 'X-PUBLISHER: $PUBLISHER_UUID' \
--header 'X-DATASOURCE: $DATASOURCE_UUID' \
--header 'x-api-key: $API_KEY' \
--data-raw '{
  "@type": "https://schema.org/Event",
  "https://schema.org/description":"This is the running example event description",
  "https://schema.org/name":"Running example",
  "https://schema.org/startDate": "2023-05-16T18:00:00+02:00",
  "https://schema.org/url": "http://example.com/exampleEvent",
  "https://vocab.sti2.at/ds/compliesWith": {
    "@id": "https://semantify.it/ds/mhpmBCJJt"
  }
}'

A successful started import should return the response code 202 ACCEPTED with the following response:

{
    "message": "IMPORT_PROCESS_ID"
}

What’s Next

Check the status of an import process