Get All Units

The "Get All Units" endpoint return the list of all available units of specified arke

Headers

KeyValue
arke-project-key<YOUR_PROJECT_ID>
AuthorizationBearer <ACCESS_TOKEN>
content-typeapplication/json

HTTP Response status

Status codeDescription
200OK
401Unauthorized
403Forbidden
500Internal server error
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

The "Get Unit" endpoint return details of the specified arke

Headers

KeyValue
arke-project-key<YOUR_PROJECT_ID>
AuthorizationBearer <ACCESS_TOKEN>
content-typeapplication/json

HTTP Response status

Status codeDescription
200OK
401Unauthorized
403Forbidden
500Internal server error
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

KeyValue
arke-project-key<YOUR_PROJECT_ID>
AuthorizationBearer <ACCESS_TOKEN>
content-typeapplication/json

Body

KeyValue
<PARAMETER_ID><VALUE>
<PARAMETER_ID_2><VALUE>
<PARAMETER_ID_3><VALUE>

HTTP Response status

Status codeDescription
200OK
401Unauthorized
403Forbidden
500Internal 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

KeyValue
arke-project-key<YOUR_PROJECT_ID>
AuthorizationBearer <ACCESS_TOKEN>
content-typeapplication/json

Body

KeyValue
<PARAMETER_ID><NEW_VALUE>

HTTP Response status

Status codeDescription
200OK
401Unauthorized
403Forbidden
500Internal 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

The "Delete Unit" endpoint delete the specified unit

Headers

KeyValue
arke-project-key<YOUR_PROJECT_ID>
AuthorizationBearer <ACCESS_TOKEN>
content-typeapplication/json

Body

KeyValue
<PARAMETER_ID><NEW_VALUE>

HTTP Response status

Status codeDescription
204OK
401Unauthorized
500Internal server error
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

KeyValue
arke-project-key<YOUR_PROJECT_ID>
AuthorizationBearer <ACCESS_TOKEN>
content-typeapplication/json

Body

KeyValue
<CUSTOM_PARAMETER>You can pass custom parameters required by the function

HTTP Response status

Status codeDescription
200OK
401Unauthorized
403Forbidden
500Internal 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

KeyValue
arke-project-key<YOUR_PROJECT_ID>
AuthorizationBearer <ACCESS_TOKEN>
content-typeapplication/json

Params

KeyValueDetail
offsetStart offset for paginationDiscover more
limitCount limit for paginationDiscover more
orderSorting definition ex. asc;updated_atDiscover more
filterFilter response with condition ex. eq(name,test)Discover more
load_linksLoad links dataDiscover more
depthDefine depth of load_linksDiscover more

HTTP Response status

Status codeDescription
200OK
401Unauthorized
403Forbidden
500Internal 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": []
}