Create a Data Key
curl --request POST \
--url https://api.hakumedia.ai/v2/data-keys \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my_string",
"type": "STRING"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'my_string', type: 'STRING'})
};
fetch('https://api.hakumedia.ai/v2/data-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hakumedia.ai/v2/data-keys"
payload = {
"name": "my_string",
"type": "STRING"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hakumedia.ai/v2/data-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'my_string',
'type' => 'STRING'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"object": "data_key",
"self": "/v2/data-keys/1234",
"id": 1234,
"name": "my_string",
"type": "STRING",
"in_use": true
}Data Keys
Create a Data Key
POST
/
data-keys
Create a Data Key
curl --request POST \
--url https://api.hakumedia.ai/v2/data-keys \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my_string",
"type": "STRING"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({name: 'my_string', type: 'STRING'})
};
fetch('https://api.hakumedia.ai/v2/data-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hakumedia.ai/v2/data-keys"
payload = {
"name": "my_string",
"type": "STRING"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hakumedia.ai/v2/data-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'my_string',
'type' => 'STRING'
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"object": "data_key",
"self": "/v2/data-keys/1234",
"id": 1234,
"name": "my_string",
"type": "STRING",
"in_use": true
}Authorizations
API key en el header Authorization: Basic TU_API_KEY. La key va tal cual, sin codificar en base64. Las credenciales se entregan al comenzar la integración.
Body
application/json
Response
default - application/json
successful operation
A string denoting the current resource being requested or affected.
Example:
"data_key"
The relative URL of the current resource being requested or affected.
Example:
"/v2/data-keys/1234"
The current resource identifier (ID).
Example:
1234
The name of the data key. Must be unique. Names must be no longer than 32 characters.
Example:
"my_string"
The type of key (STRING, NUMBER, DATE, DATETIME, TIME).
Example:
"STRING"
Whether or not the data key is being used by a data key target. If the key is being used it cannot be modified or deleted.
Example:
true