Status Codes
The GetFTR API supports response and entitleement-level status codes. Response status codes are standard HTTP status codes, while entitlement status codes indicate the status for a particular entitlement within a larger response.
Consider the following response:
{
"entitlements": [
{
"doi": "10.10/does.not-exist",
"statusCode": 404
},
{
"doi": "10.10/4512",
"statusCode": 504
},
{
"doi": "10.10/1234",
"statusCode": 200,
"entitled": "yes",
"accessType": "paid",
"source": "service_request",
"document": "https://link-to-content-on-your-platform.com",
"org": {
"ipv4": "1.2.3.4"
},
"vor": [
{
"contentType": "application/pdf",
"url": "https://link-to-content-on-your-platform.com"
}
],
"av": [],
"updates": []
}
]
}
- The response status code is
200
, as the request has been handled successfully. - The first entitltment object has a status code of
404
, indicating that the DOI10.10/does.not-exist
has not been found at the Publisher. - The second entitlement object has a status code of
504
, indicating that the check timed out.
Response Status Codes
Response status codes should be as per the HTTP Specification. The following status codes are supported:
Code | Definition | Scenario |
---|---|---|
200 | OK | The request has succeeded |
400 | Bad request |
|
401 | Unauthorized |
|
403 | Forbidden |
|
404 | Not Found | The endpoint is not known |
405 | Method Not Allowed | HTTP method is not known |
429 | Too Many Requests | Request quota exceeded |
500 | Internal Server Error | The Entitlement API has thrown an error |
504 | Gateway Timeout | Upstream services timed out |
Entitlement Status Codes
Code | Definition | Scenario |
---|---|---|
200 | OK | Entitlement determined |
404 | Not Found | Unknown DOI |
504 | Timeout | Entitlement check timed out |
Last updated on