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! |
302 | Found | Redirects the request. Usually redirects to the UI login page due to authentication failure because credentials were missing or incorrect. |
400 | Bad Request | The request was invalid. An accompanying error message will explain why. If there is no error message, please ensure that you are percent-encoding characters not valid in URLs, like double quotes. |
401 | Unauthorized | If you unexpectedly start receiving 401 errors after successful API requests, please check that you aren't using persistent connections. |
403 | Forbidden | The request is understood, but it has been refused. Usually due to the user being successfully authenticated but not authorized to access the requested resource. |
404 | Not Found | The URI and method combination requested is invalid or does not exist. Check that the URI is correct. Also check the HTTP method; make sure you're not trying to POST to a PUT resource. |
406 | Not Acceptable | The Accept header sent in the request does not match a supported type. |
415 | Unsupported Media Type | The Content-Type header sent in the request does not match a supported type. |
500 | Internal Server Error | An error has occured during the API invocation. |
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>