Get All Units
Code samples for "Get all Units"
GET
/api/lib/{arke_id}/unit
curl --location 'https://arkehub.com/api/lib/{arke_id}/unit' \
-H "Arke-Project-Key: <YOUR_PROJECT_ID>" \
-H "Authorization: <ACCESS_TOKEN>" \
-H 'Content-Type: application/json' \
Response with Units list of arke "super_admin"
{
"content": {
"count": 5,
"items": [
{
"arke_id": "super_admin",
"business_name": "Arke",
"city": "Milan",
"email": "superadmin@arkehub.com",
...
},
...
]
},
"messages": []
}
Get Unit
Code samples for "Get Units"
GET
/api/lib/{arke_id}/unit/{unit_id}
curl --location 'https://arkehub.com/api/lib/arke/unit/{arke_id}' \
-H "Arke-Project-Key: <YOUR_PROJECT_ID>" \
-H "Authorization: <ACCESS_TOKEN>" \
-H 'Content-Type: application/json' \
Response with Arke details
{
"content": {
{
"active": true,
"arke_id": "arke",
"id": "super_admin",
"inserted_at": "2023-09-14T10:03:48.000000Z",
"label": "Super Admin",
"metadata": {},
"parameters": [],
"remote": false,
"type": "arke",
"updated_at": "2023-09-14T10:03:48.000000Z"
},
},
"messages": []
}
Create Unit
The "Create Unit" endpoint create a Unit with the specified information
Headers
Key | Value |
arke-project-key | <YOUR_PROJECT_ID> |
Authorization | Bearer <ACCESS_TOKEN> |
content-type | application/json |
Body
Key | Value |
<PARAMETER_ID> | <VALUE> |
<PARAMETER_ID_2> | <VALUE> |
<PARAMETER_ID_3> | <VALUE> |
HTTP Response status
Status code | Description |
200 | OK |
401 | Unauthorized |
403 | Forbidden |
500 | Internal server error |
Code samples for "Create Unit"
POST
/api/lib/{arke_id}/unit
curl --location 'https://arkehub.com/api/lib/{arke_id}/unit/{unit_id}' \
-H "Arke-Project-Key: <YOUR_PROJECT_ID>" \
-H "Authorization: <ACCESS_TOKEN>" \
-H 'Content-Type: application/json' \
Response with Unit details created
{
"content": {
{
"active": true,
"arke_id": "arke",
"id": "docs_super_admin",
"inserted_at": "2023-09-14T10:03:48.000000Z",
"label": "New Super Admin",
"metadata": {},
"parameters": [],
"remote": false,
"type": "arke",
"updated_at": "2023-09-14T10:03:48.000000Z"
},
},
"messages": []
}
Edit Unit
The "Edit Unit" endpoint update the specified unit information
Headers
Key | Value |
arke-project-key | <YOUR_PROJECT_ID> |
Authorization | Bearer <ACCESS_TOKEN> |
content-type | application/json |
Body
Key | Value |
<PARAMETER_ID> | <NEW_VALUE> |
HTTP Response status
Status code | Description |
200 | OK |
401 | Unauthorized |
403 | Forbidden |
500 | Internal server error |
Code samples for "Edit Unit"
PUT
/api/lib/{arke_id}/unit/{unit_id}
curl --location 'https://arkehub.com/api/lib/{arke_id}/unit/{unit_id}' \
-H "Arke-Project-Key: <YOUR_PROJECT_ID>" \
-H "Authorization: <ACCESS_TOKEN>" \
-H 'Content-Type: application/json' \
Response with Unit details updated
{
"content": {
{
"active": true,
"arke_id": "arke",
"id": "docs_super_admin",
"inserted_at": "2023-09-14T10:03:48.000000Z",
"label": "Edit Super Admin",
"metadata": {},
"parameters": [],
"remote": false,
"type": "arke",
"updated_at": "2023-09-14T10:03:48.000000Z"
},
},
"messages": []
}
Delete Unit
Code samples for "Delete Unit"
DELETE
/api/lib/{arke_id}/unit/{unit_id}
curl --location 'https://arkehub.com/api/lib/{arke_id}/unit/{unit_id}' \
-H "Arke-Project-Key: <YOUR_PROJECT_ID>" \
-H "Authorization: <ACCESS_TOKEN>" \
-H 'Content-Type: application/json' \
Response with no content
{
"content": null,
"messages": []
}
Custom functions
The "Custom function" endpoint allows you to invoke a custom function directly from your backend.
On your arke backend you can create an elixir function in your /backend/<ARKE>.ex
file, calling this endpoint
you'll receive a response directly from this function.
Headers
Key | Value |
arke-project-key | <YOUR_PROJECT_ID> |
Authorization | Bearer <ACCESS_TOKEN> |
content-type | application/json |
Body
Key | Value |
<CUSTOM_PARAMETER> | You can pass custom parameters required by the function |
HTTP Response status
Status code | Description |
200 | OK |
401 | Unauthorized |
403 | Forbidden |
500 | Internal server error |
Code samples for "Custom functions"
GET
POST
/api/lib/{arke_id}/unit/{unit_id}/function/{function_name}
curl --location 'https://arkehub.com/api/lib/{arke_id}/unit/{unit_id}/{function_name}' \
-H "Arke-Project-Key: <YOUR_PROJECT_ID>" \
-H "Authorization: <ACCESS_TOKEN>" \
-H 'Content-Type: application/json' \
Response of function
{
"content": {
// Custom data response
},
"messages": []
}
Get Unit Struct
The "Get Unit Struct" endpoint return the structure of parameters of specified Unit
Headers
Key | Value |
arke-project-key | <YOUR_PROJECT_ID> |
Authorization | Bearer <ACCESS_TOKEN> |
content-type | application/json |
Params
Key | Value | Detail |
offset | Start offset for pagination | Discover more |
limit | Count limit for pagination | Discover more |
order | Sorting definition ex. asc;updated_at | Discover more |
filter | Filter response with condition ex. eq(name,test) | Discover more |
load_links | Load links data | Discover more |
depth | Define depth of load_links | Discover more |
HTTP Response status
Status code | Description |
200 | OK |
401 | Unauthorized |
403 | Forbidden |
500 | Internal server error |
Code samples for "Get Unit Struct"
GET
/api/lib/{arke_id}/unit/{unit_id}/struct
curl --location 'https://arkehub.com/api/lib/arke/struct' \
-H "Arke-Project-Key: <YOUR_PROJECT_ID>" \
-H "Authorization: <ACCESS_TOKEN>" \
-H 'Content-Type: application/json' \
Response with Arke struct
{
"content": {
"label": "Arke",
"parameters": [
{
"default": "arke",
"helper_text": "Type",
"id": "type",
"label": "Type",
"max_length": null,
"min_length": 2,
"multiple": false,
"required": true,
"strip": true,
"type": "string",
"values": null
},{
"default": false,
"helper_text": "Remote",
"id": "remote",
"label": "Remote",
"required": true,
"type": "boolean"
},
...
]
},
"messages": []
}