REST API CRUD Services
Create, read, update, delete (CRUD) services are provides by the /rest/v2/
endpoints. They allow you to perform operations on entities and properties inside accesses.
On this page
Overview
Basic create/read/update/delete (CRUD) operations on entity instances and their properties stored in deployed accesses are provided by /rest/v2/
. This API is divided into 2 endpoints: /rest/v2/entities/
and /rest/v2/properties/
, respectively grouping requests related to entities and entity properties.
Below is an overview of all the services that /rest/v2/
API offers:
Endpoint and URL | GET | POST | PUT | DELETE | PATCH |
---|---|---|---|---|---|
/rest/v2/entities/ {accessId}/ {typeSignature} | Entity search | Entity creation | Entity update or creation | Entity deletion | Entity update |
/rest/v2/entities/ {accessId}/ {typeSignature}/ {id}/ ({partition}) | Entity return | Entity update | Entity update or creation | Entity deletion | Entity update |
/rest/v2/properties/ {accessId}/ {typeSignature}/ {id}/ ({partition})/ {property} | Property value return | Addition or removal collection elements Only works on collection properties | Property value update | Property value reset to default int, long, double, float, BigDecimal = 0 Boolean = false enums, entities, objects = null maps, lists, sets = empty collection | Property value update |
For each REST API call to
/rest/v2
, theentity.TypeSignature
part may be replaced by the simple name (for exampleUser
instead ofcom.braintribe.model.user.User
), but only when this simple name is unique in a given access (there are no other entities with the same simple name).
For more information and specific examples, see REST v2 /rest/v2/entities and REST v2 /rest/v2/properties.
Authentication
Send a POST call to /api/v1/authenticate
for authentication. Make sure to provide your credentials in the body of the request:
Item | Description |
---|---|
Method and Link | POST host:port/tribefire-services/api/v1/authenticate |
Body | { "user": "cortex", "password": "cortex" } |
Headers | Content-Type: application/json |
You have to include the session ID in every REST call. You can include it in the following:
- URL parameter:
sessionId=yourSessionId
- header parameter:
gm-session-id
You cannot include the session ID in the body of the request!
If you are not logged in (there is no valid session) and you paste a GET
call in your browser, you will be redirected to a login screen. After logging in, you will see the result
of your GET
call.
The redirect does not happen for the
/api/v1/authenticate
call.
Try it Out
If you want to experiment with the API for yourself, use our integrated Swagger UI.
For more information, see Using Swagger UI.