Create a record
NOTE
This request requires authentication.
Recommendation
Send an appropriate User-Agent header with your requests.
A new record can be created by sending a POST request to /data.
The body of the request should contain the record in JSON-LD format.
The following headers must be set:
Content-Typemust beapplication/ld+json.Authorizationmust contain an active and valid bearer token. Example:Bearer: hW3IHc9PexxxFP2IkAAbqKvjLbW4thQXL-Active-Sigelmust be a sigel that your OAuth client is linked to (e.g. Doro).
The API implements a number of validation steps, for example to prevent duplicate holdings records from being created. If any validation fails, the API responds with 400 Bad Request and an error message explaining the problem.
Note that a temporary @id must be specified in several places in the document you send:
- Temporary
@idin Record - Temporary
mainEntity.@idin Record - Temporary
@idin Thing ("the thing")
For example:
JSON-LD
{"@graph":[{"@id":"https://id.kb.se/TEMPID","@type":"Record","mainEntity":{"@id":"https://id.kb.se/TEMPID#it"}},{"@id":"https://id.kb.se/TEMPID#it","@type":"Person","familyName":"Testing"}]}
A successful request will result in a 201 Created response with the new record's URI set in the Location header.