Overview
Features of Orangepill RESTful API.
Idempotency
The HTTP idempotency-key
request header field can be used to carry idempotency key in order to make non-idempotent HTTP methods such as POST
or PATCH
fault-tolerant
Client can make the same request repeatedly because of network error, timeout etc.. but the same operation will not be executed twice. If Client repeats the same request by sending the same Idempotency Key value in request headers, and the request will be responded with the same response as the original request.
Name of the request header is idempotency-key
.
Usage of Idempotency is optional.
Security
x-api-key
The HTTP x-api-key
request header field must be used to identify Realm.
Authorization
Add Authorization
request header with x-api-key: base64encode(realm.key:username:password)
value.
Ownership
Each created entity is flagged with owner: authenticated_user.id
thus enabling automatic scope filtering and ownership.
Roles
User can have different roles in a realm.
Scopes
User is limited in it's scope to access data.
User scopes:
Cumulative Permissions
API scopes
When calling API you can apply following scopes on entities.
Soft delete
Entities are never physically deleted, hence soft delete mechanism is applied. When DELETE
method is invoked on REST API interface, Orangepill middleware will flag the entity as deleted: true
, and timestamped as deleted_at: Date.now()
. Entities marked as deleted are filtered out from scopes all
and own
. To view deleted entities either disable scopes by adding ?scope=false
to URL query or choose ?scope=deleted
if exists for specific endpoint.
RESTful
Orangepill API is completely RESTful thus being interface for buidling frontend and backend apps.
find
Find entities
find
Find entitiesFind entitites by query.
Parameters
REST endpoint
Results
list
List entities
list
List entitiesList entities with pagination. It returns also the total number of rows.
Parameters
REST endpoint
Results
count
Count entities
count
Count entitiesGet the number of entities by query.
Parameters
REST endpoint
Results
get
Get an entity by ID
get
Get an entity by IDGet an entity by ID.
Parameters
REST endpoint
Results
Last updated