Revisoradgang Data API Developers Version 1.7.0 Help First call

Concepts

Errors

Each error response has the same format:

{
  "error": {
    "code": "validation_error",
    "message": "The request is not valid. body.cvrs: Field required",
    "request_id": "0f6d1c0a4b5e4c7f9a3e2d1c0b9a8f7e",
    "limit": null
  }
}
Field Content
code A stable code. Use it in your program. A code does not change in /v1
message One or two sentences for a developer. The text can change; do not parse it
request_id The id of the request. It is also in the response header X-Request-Id
limit For 429 rate_limited: the limit that your firm reached. null for each other error. See Limits and quotas

Each response, also a successful one, has the header X-Request-Id. Give this id to support when you report a problem.

A message never repeats the values that you sent. A registration number or a chassis number is never in a message.

Codes

Status Code Cause What to do
400 bad_request The request is not valid HTTP for this route Correct the request
401 invalid_token The header Authorization: Bearer <token> is missing, or the token is not correct, revoked or expired. The answer is the same for each cause Check the token and its expiry date. Write to support@revisoradgang.dk for a new token
403 origin_not_allowed The request did not come through the public address of the service Use https://data.revisoradgang.dk, or https://data-test.revisoradgang.dk for the test environment
403 ip_not_allowed The IP address of the request is not in the IP list of the token Send the request from an address in your list, or send your new IP ranges to support@revisoradgang.dk
403 client_suspended We suspended the client Write to support@revisoradgang.dk
403 dataset_not_enabled The client does not have a dataset that the request needs, or the terms of the dataset are not signed. The message names the dataset Write to support@revisoradgang.dk to get the dataset
404 not_found The route does not exist Check the path and the version (/v1)
404 job_not_found Jobs: your firm has no job with this id, or the job is older than 7 days Check the id. Create a new job
404 key_not_found Jobs: the job does not have this key Use a key from the status of the job
404 item_not_found Jobs: the job has no item with this id Use result_path of a key in the status of the job
404 no_partial_result Jobs: the key is complete, or the service has nothing for it Use partial_path of a key in the status of the job
404 document_not_available Tinglysning: no result of your firm from the last 7 days has this document id Use a document_id of a result that is not older than 7 days
404 pdf_not_available Tinglysning: the source has no PDF of the document, for example for a paper deed Do not send the request again
404 cvr_not_found CVR companies: the register has no company with this CVR number. Tinglysning: the source gave no result for the number, and the CVR register does not have it. It is also an error of a key of a job Check the number. Do not send the request again
405 method_not_allowed The route does not accept this method. The header Allow lists the methods Use a method from Allow
422 validation_error A parameter or the body is missing or not valid. The message gives the location and the rule Correct the field
409 result_not_ready Jobs: the look-up of the key is not complete. The header Retry-After gives a wait in seconds Ask again later
409 lookup_failed Jobs: the look-up of the key failed Read error of the key in the status of the job. Create a new job for the key
422 invalid_cvr CVR companies and Tinglysning: a CVR number does not have 8 digits. For a look-up, the message gives the positions in the list Correct the number
422 too_many_cvrs CVR companies and Tinglysning: a look-up has more than 500 CVR numbers Divide the numbers into more calls
422 invalid_cursor Jobs: cursor is not a next_cursor of this job Start again without cursor
422 unknown_register Tinglysning: registers has a name that the dataset does not have Use personbog, bilbog or tingbog
422 invalid_document_id Tinglysning: the document id is not a UUID Use document_id of a result
422 vehicle_number_required Vehicles (DMR) and Tinglysning: the body has no registration number and no chassis number Send one of the two numbers in the body
422 invalid_registration_number Vehicles (DMR) and Tinglysning: the registration number has more than 20 characters. The message does not have the number Correct the number
422 invalid_chassis_number Vehicles (DMR): the chassis number has more than 30 characters. Tinglysning: the chassis number does not have 6 to 25 letters and digits. The message does not have the number Correct the number
429 rate_limited The client is at its limit for the dataset: requests in the minute, or look-up keys in the day. Also: a PDF download while the client has a PDF download in work. The field limit of the error names the limit. The header Retry-After gives the wait in seconds Wait, then send the request again
429 source_rate_limited The source register is at its call limit. The header Retry-After gives the wait in seconds Wait, then send the request again
500 internal_error A fault in the service Send the request again later. Report the request_id if the fault continues: see Help and contact
502 source_unavailable The source register did not answer, or its answer was not correct Send the request again later
503 record_unavailable The service records each call (Records of calls) and cannot do it now. It thus gives no data of Tinglysning Send the request again later
503 database_unavailable Only /ready: the database of the service does not answer No action for clients

A status without a code in this table gets the code http_<status>, for example http_418.

Sequence of the access checks

The service checks each request in this sequence. The first check that fails gives the error.

# Check Error
1 The request came through the public address 403 origin_not_allowed
2 The token 401 invalid_token
3 The IP address 403 ip_not_allowed
4 The status of the client 403 client_suspended
5 The dataset of the client. For a route of a job: the job (404 job_not_found), then the dataset of the job 403 dataset_not_enabled
6 The limits of the client for the dataset 429 rate_limited

A look-up of the Bilbog by registration number needs two datasets: tinglysning and dmr. Check 5 is then done for tinglysning, then for dmr. Check 6 is then done for the two datasets in the same sequence.

Which errors to send again

Status Send the same request again
429 Yes, after the time in the header Retry-After
500, 502, 503 Yes, later. Wait longer after each failure
409 result_not_ready Yes, after the time in the header Retry-After
401, 403, 404, 409 lookup_failed, 422 No. Correct the cause first

The limits of your firm are on the page Limits and quotas. The token and the access checks are on the page Authentication.