ARPIA API
ARPIA API Documentation
This document explains the use of the ARPIA API, with practical examples. The API enables you to query and add information to the resources within your ARPIA account.
Resource Concepts
The Kube resources consumed through the API are as follows:
Type | Description |
---|---|
Kubes of Reports | Generated reports in Kubes. Only GET actions are supported for this resource. |
Charts of Kubes Store | Charts created in the Kubes Store repository. Allows GET and PUT actions. |
Data Workshop Projects | Projects with execution flows for machine learning or data operations. |
Data Workshop project Objects | Objects specifically runnable within Workshop projects. |
Authorization Required
Each resource requires authorization via access tokens for secure access.
Token Management
Tokens are the access keys used to consume resources in your Kube account. You can create tokens in the Security / API Tokens section, where you can configure the following values:
Configuration | Description |
---|---|
IP Access | Define the IPs allowed to access the API using the Token. |
Kubes Resources | Specify the Kube Reports resources. Note that only GET actions are allowed for this type. |
Kubes Store Resources | Define the chart resources in your Kubes Store. Supports GET and PUT actions. |
Access Type | Determines the types of actions that the Token can perform on assigned resources. |
You can create multiple Tokens to manage access to various resources.
API Endpoint
Access the API at the following URL:
<https://api.arpia.ai>
GET: Obtain Data from Kube
Example Usage in PHP and cURL
Use the following example to authenticate via POST Payload.
curl --location --request POST 'https://api.arpia.ai' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-raw '{
"a": "9c1acab8433828973a8c4a86ea166345-werw-isqycvrn",
"k": "7c34083fefa8e201cd90e0f509ae69d6",
"type": "GET",
"results": 1,
"filters": [{"field": "Date", "type": ">=", "value": "2020-01-01"}, {"field": "Date", "type": "<=", "value": "2020-01-01"}],
"orderby": [{"field": "Date", "type": "<ASC/DESC>"}]
}'
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.arpia.ai/kube/v2/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => '{
"a": "9c1acab8433828973a8c4a86ea166345-werw-isqycvrn",
"k": "7c34083fefa8e201cd90e0f509ae69d6",
"type": "GET",
"results": 1,
"filters": [{"field": "Date", "type": ">=", "value": "2020-01-01"}]
}',
CURLOPT_HTTPHEADER => array(
"Content-Type: application/x-www-form-urlencoded"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
Direct URL Authentication Model
Safety Alert
This integration model is considered less secure. IP restrictions are recommended.
curl --location --request GET 'https://api.datakubes.com/?a=9c1acab8433828973a8c4a86ea166345-werw-isqycvrn&k=974f80d4160def16dd86e38bac5079d5&type=GET&results=10&filters[0][field]=Date&filters[0][type]=>=&filters[0][value]=2020-01-01'
Parameter Descriptions
Variable | Description | Required |
---|---|---|
a | Authorization token created in Security / API Tokens. | βοΈ |
k | Token for the Kube resource, either Reports or Charts from the Kube Store. | βοΈ |
type | To obtain data, use GET ; for write actions, use PUT . | βοΈ |
results | Number of records to obtain. Default is 100 if not specified. | β |
page | Page number of results (for example, results=5&page=3 will start from the 11th record). | β |
filters | JSON array with filters to apply. Example format: {"field":"Date","type":">=","value":"2020-01-01"} . | β |
orderby | JSON array specifying fields to sort by, e.g., {"field":"Date","type":"ASC"} . | β |
POST: Send Data to Resources in ARPIA Repositories
You can send data to charts in the ARPIA repository for real-time analytics.
curl --location --request POST 'https://api.arpia.ai' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-raw '{
"a": "9c1acab8433828973a8c4a86ea166345-werw-isqycvrn",
"k": "7c34083fefa8e201cd90e0f509ae69d6",
"type": "POST",
"payload": [
{"field_1": "value_1", "field_2": "value_1", "field_3": "value_2"}
]
}'
Batch Processing
Multiple records can be sent in a single payload.
Field | Description | Required |
---|---|---|
a | Authorization token from Security / API Tokens. | βοΈ |
k | Kube resource token, such as Reports or Charts from the Kube Store. | βοΈ |
type | Use POST to send data. | βοΈ |
payload | JSON array of records to insert. | βοΈ |
WebHook Relays - Middleware Model (Beta)
This feature enables the platform to forward records entered via API to other URLs, allowing Kubes to function as middleware.
Execution of Projects and Items in Data Workshop
To run a project or specific items within a Data Workshop project, use the following API endpoint:
curl --location --request POST 'https://api.arpia.ai' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-raw '{
"a": "9c1acab8433828973a8c4a86ea166345-werw-isqycvrn",
"k": "7c34083fefa8e201cd90e0f509ae69d6",
"type": "POST",
"payload": [
{"field_1": "row_1", "field_2": "row_1", "field_3": "row_1"}
]
}'
Use this documentation to securely manage and interact with your ARPIA resources.
Updated about 1 month ago