Get Arke Struct
The "Get Arke Struct" endpoint return the structure of parameters of specified Arke
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 Arke Struct"
GET
/api/lib/arke/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": []
}
Get All Arke
Code samples for "Get all Arke"
GET
/api/lib/arke/unit
curl --location 'https://arkehub.com/api/lib/arke/unit' \
-H "Arke-Project-Key: <YOUR_PROJECT_ID>" \
-H "Authorization: <ACCESS_TOKEN>" \
-H 'Content-Type: application/json' \
Response with Arke list
{
"content": {
"count": 25,
"items": [
{
"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": []
}
Get Arke
Code samples for "Get Arke"
GET
/api/lib/arke/unit/{arke_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 Arke
The "Create Arke" endpoint create an Arke 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 Arke"
POST
/api/lib/arke/unit
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 created
{
"content": {
{
"active": true,
"arke_id": "arke",
"id": "my_arke",
"inserted_at": "2023-09-14T10:03:48.000000Z",
"label": "My Arke",
"metadata": {},
"parameters": [],
"remote": false,
"type": "arke",
"updated_at": "2023-09-14T10:03:48.000000Z"
},
},
"messages": []
}
Edit Arke
The "Edit Arke" endpoint update the specified Arke 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 Arke"
PUT
/api/lib/arke/unit/{arke_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 updated
{
"content": {
{
"active": true,
"arke_id": "arke",
"id": "super_admin",
"inserted_at": "2023-09-14T10:03:48.000000Z",
"label": "Edited Super Admin Arke label",
"metadata": {},
"parameters": [],
"remote": false,
"type": "arke",
"updated_at": "2023-09-14T10:03:48.000000Z"
},
},
"messages": []
}
Delete Arke
Code samples for "Delete Arke"
DELETE
/api/lib/arke/unit/{arke_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 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}/function/{function_name}
curl --location 'https://arkehub.com/api/lib/{arke_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": []
}