The Prime Infrastructure API attempts to return appropriate HTTP status codes for every request.
This table outlines the status codes returned by the Prime Infrastructure API.
| Code | Text | Description |
|---|---|---|
| 200 | OK | Success! |
| 400 | Bad Request | The request was invalid. An accompanying error message will explain why. |
| 401 | Unauthorized | Authentication credentials were missing or incorrect. |
| 403 | Forbidden | The request is understood, but it has been refused. An accompanying error message will explain why. |
| 404 | Not Found | The URI requested is invalid or the resource requested does not exist. |
| 500 | Internal Server Error | Something is broken. |
| 502 | Bad Gateway | The server is down or being upgraded. |
| 503 | Service Unavailable | The servers are up, but overloaded with requests. Try again later. This code is used when requests are being denied due to rate limiting. |
When the NBI API returns error messages, it does so in your requested format. For example, an error from a JSON method might look like this:
{"errorDocument":{"httpResponseCode":404,"httpMethod":"GET","message":"No such entity type as unkown.-PRS-102","id":"presentation.PRS-102","uriPath":"\/data\/unkown","queryParams":"{}"}}
The corresponding XML response would be:
<?xml version="1.0" encoding="UTF-8"?>
<errorDocument>
<httpResponseCode>404</httpResponseCode>
<httpMethod>GET</httpMethod>
<message>No such entity type as unkown.-PRS-102</message>
<id>presentation.PRS-102</id>
<uriPath>/data/unkown</uriPath>
<queryParams>{}</queryParams>
</errorDocument>