Check that every receipt still says what it said when it was written
const url = 'http://localhost:11044/api/v1/receipts/verify';const options = {method: 'GET', headers: {'X-Embabel-Api-Key': '<X-Embabel-Api-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:11044/api/v1/receipts/verify \ --header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>'Walks the chain: each receipt must follow the one before it and hash to what it says it does.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”How many receipts, whether the chain is intact, and where it first breaks
Whether the signed-in user’s receipt chain still says what it said when written, and where it first breaks; answered by GET /receipts/verify. It shows an edit, not that the record is complete
object
The seq of the first receipt that breaks the chain; null when intact
True when every receipt follows the one before it and hashes to what it says
How many receipts the owner’s chain holds
Why the chain breaks there: the receipt does not follow the one before it, or it was changed after it was written. Null when intact
Example generated
{ "brokenAt": 1, "intact": true, "receipts": 1, "why": "example"}No authenticated principal
A refusal with a machine-readable code and a plain-language message. ApiErrorAdvice answers it for a failed validation, a missing resource or a conflicting state, and some controllers answer it directly
object
Machine-readable key to branch on, such as validation_failed, unknown_field, not_found or conflict. Open: a surface may answer codes of its own
Extra context where there is some, such as the fields a body may carry; null otherwise
A plain-language explanation, written to be shown. Never carries an exception message
The body the servlet error dispatch answers for a status raised by an exception rather than written by the endpoint. Every failure except 404, which answers the not-found HTML page
object
The status’s standard reason phrase, such as Bad Request or Forbidden
The request path that failed
The HTTP status code, repeated from the status line
Example generated
{ "code": "example", "detail": "example", "message": "example"}
