api icon indicating copy to clipboard operation
api copied to clipboard

Return 404 response for related service specific relationship where no related documents are available

Open jonquandt opened this issue 9 months ago • 3 comments

Requests to the API related service for a relationship to a specific accessid for a specific collection are returning the standard error message, but with a 200 HTTP status code instead of the appropriate 404 code.

For example, https://api.govinfo.gov/related/BILLSTATUS-118hr99999/BILLS?api_key=DEMO_KEY will return the correct error message, but it will return with a 200 error code. This should return 404 instead.

{
  "message": "There are either no related documents available for this resource at this time, or the relationship has not been defined yet. If you know there are related documents that should be available for this resource,check again later or please check the https://www.github.com/usgpo/api repository to see the status of available relationships and submit an issue request as appropriate.",
  "relatedId": "BILLSTATUS-118hr99999"
}

jonquandt avatar May 08 '24 14:05 jonquandt