Errors

Conventional HTTP response codes are used to indicate the success or failure of an API request. In general:

  • Codes in the 2xx range indicate success.
  • Codes in the 4xx range indicate an error with the request: e.g., a required parameter was omitted.
  • Codes in the 5xx range indicate an error with APNIC’s servers.

Additional information about the failure will be provided in the response body using the HTTP Problem Details format. For example:

{
   "type" : "https://example.net/error-type"
   "title" : "Invalid request",
   "detail" : "Missing required field in request"
}

The standard members of a HTTP Problem Details response are:

  • type
  • title
  • status
  • detail
  • instance

Not all members are mandatory, but this API will include the type, title and detail members in all such responses. The type field will be a URI pointing to documentation about the error type. That documentation will also include details on any extension members in use for that specific error type.

Asynchronous Requests

In the case of asynchronous requests where the current status of the request can be queried via a /tasks/{id} resource, this additional information will be provided in the /tasks/{id} resource response body. For example:

{
  "id": 87,
  "taskStatus": "FAILED",
  "response": {
    "type": "https://registry-testbed.apnic.net/nir-api/errors/failed-to-delegate",
    "title": "Failed to delegate resources.",
    "error": [
      "NIR maximum transaction size (32) exceeded on IPv6"
    ]
  },
  "_links": {
    "self": {
      "href": "https://registry-testbed.apnic.net/nir-api/tasks/87"
    }
  }
}

Additional Information

The Failed Type

The Failed problem type is used when there isn’t a more-specific problem type is applicable. In these instances the HTTP Problem Details formatted response will have the extended member error that will contain the majority of the information as an array of strings. Over time we hope to introduce more helpful types.

Can't find what you're looking for? Please contact the Software team.