Responses
Every endpoint returns a JSON object with the same three keys:
| Key |
Contents |
meta |
Information about the request and response (see below). |
service |
The About record: which moalmanac-db release the API is serving. |
data |
The results. For /about, a single object; for every other endpoint, a list of records. Each endpoint's page links to the schema of its records. |
| Field |
Type |
Required |
Description |
data_length |
integer |
yes |
Number of records in data, or 1 for a single object. |
message |
string |
yes |
Human-readable status message. |
request_url |
string or null |
yes |
The full URL of the request. |
status |
one of success, error |
yes |
|
status_code |
integer |
yes |
|
timestamp_elapsed |
number |
yes |
Seconds between receiving the request and returning it. |
timestamp_received |
string format date-time |
yes |
When the request was received, in UTC. |
timestamp_returned |
string format date-time |
yes |
When the response was returned, in UTC. |
trace_id |
string format uuid |
yes |
Unique id for this response. |
Search results
/search returns Proposition records, each with an added aggregates object summarizing the statements made about it:
| Field |
Type |
Required |
Description |
statement_count |
integer |
yes |
|
by_direction |
array of objects |
yes |
|
by_direction[].direction |
string or null |
yes |
|
by_direction[].count |
integer |
yes |
|
by_document |
array of objects |
yes |
|
by_document[].id |
string |
yes |
Document id. |
by_document[].count |
integer |
yes |
|
by_agent |
array of objects |
yes |
|
by_agent[].id |
string |
yes |
Agent id. |
by_agent[].count |
integer |
yes |
|
by_strength |
array of objects |
yes |
|
by_strength[].id |
string |
yes |
Strength id. |
by_strength[].count |
integer |
yes |
|
Contribution records
With include_records=true, each Contribution from /contributions gains an extension named records listing what it contributed:
| Field |
Type |
Required |
Description |
name |
always records |
yes |
|
value |
array of objects |
yes |
Indications and statements this contribution was made to. |
value[].id |
string |
yes |
|
value[].type |
one of Indication, Statement |
yes |
|
value[].name |
string or null |
yes |
|
value[].description |
string or null |
yes |
|
description |
string |
yes |
|
Empty results and errors
- A request whose filters match nothing returns status 200 with an empty
data list.
- Parameters an endpoint doesn't accept are ignored.
- A parameter value of the wrong type (for example
include_deprecated=maybe) returns status 422, with a detail list describing each problem.