Conventions
The PagePeek API is designed with a RESTful architecture, promoting a clear and structured interaction model between the client and the server. To ensure a consistent and understandable experience while working with our API, we adhere to certain conventions as outlined below:
HTTP Methods
HTTP Status Codes
We use standard HTTP status codes to indicate the success or failure of an API request.
Endpoint Naming
Endpoints are named logically based on the resources they represent. They are structured to be self-explanatory and straightforward.
Example:
/documents/upload
for uploading documents./documents/:document_id/summary
for retrieving a document summary.
URL structure
URLs are constructed in a clear and predictable manner, with resource identifiers and optional parameters to filter, search, or modify the request.
Example:
GET /documents/search?query=financial report 2022
JSON Conventions
The PagePeek API uses the JSON (JavaScript Object Notation) format for request and response bodies. Below are some conventions followed in our JSON structures:
Naming Conventions
Property names are written in
camelCase
.Boolean properties often have
is
orhas
prefixes for readability.
Example:
Date and Time
Dates and times are formatted as strings in ISO 8601 format.
Example:
Null Values
Properties with null
values are included in the response body, indicating that the property exists but has no value.
Example:
Error Objects
In case of an error, a JSON object is returned in the response body containing an error code, message, and additional details.
Examples
These conventions help ensure that the interaction with the PagePeek API is organized, predictable, and easily understandable, aiding developers in effectively utilizing the API to its full potential.
Last updated