Create a Data Key Target
curl --request POST \
--url https://api.hakumedia.ai/v2/data-key-targets \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example Data Key Target",
"target": "[\"OR\", {\"my_number\": {\"=\": \"5\"}}, {\"my_string\": {\"=\": \"test\"}}]"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Example Data Key Target',
target: '["OR", {"my_number": {"=": "5"}}, {"my_string": {"=": "test"}}]'
})
};
fetch('https://api.hakumedia.ai/v2/data-key-targets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hakumedia.ai/v2/data-key-targets"
payload = {
"name": "Example Data Key Target",
"target": "[\"OR\", {\"my_number\": {\"=\": \"5\"}}, {\"my_string\": {\"=\": \"test\"}}]"
}
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-key-targets",
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' => 'Example Data Key Target',
'target' => '["OR", {"my_number": {"=": "5"}}, {"my_string": {"=": "test"}}]'
]),
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;
}{
"name": "Example Data Key Target",
"target": "[\"OR\", {\"my_number\": {\"=\": \"5\"}}, {\"my_string\": {\"=\": \"test\"}}]",
"object": "data_key",
"self": "/v2/data-keys/1234",
"id": 1234
}Data Key Targets
Create a Data Key Target
POST
/
data-key-targets
Create a Data Key Target
curl --request POST \
--url https://api.hakumedia.ai/v2/data-key-targets \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Example Data Key Target",
"target": "[\"OR\", {\"my_number\": {\"=\": \"5\"}}, {\"my_string\": {\"=\": \"test\"}}]"
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Example Data Key Target',
target: '["OR", {"my_number": {"=": "5"}}, {"my_string": {"=": "test"}}]'
})
};
fetch('https://api.hakumedia.ai/v2/data-key-targets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.hakumedia.ai/v2/data-key-targets"
payload = {
"name": "Example Data Key Target",
"target": "[\"OR\", {\"my_number\": {\"=\": \"5\"}}, {\"my_string\": {\"=\": \"test\"}}]"
}
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-key-targets",
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' => 'Example Data Key Target',
'target' => '["OR", {"my_number": {"=": "5"}}, {"my_string": {"=": "test"}}]'
]),
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;
}{
"name": "Example Data Key Target",
"target": "[\"OR\", {\"my_number\": {\"=\": \"5\"}}, {\"my_string\": {\"=\": \"test\"}}]",
"object": "data_key",
"self": "/v2/data-keys/1234",
"id": 1234
}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
The name of the data key target.
Example:
"Example Data Key Target"
The JSON formatted target logic.
Example:
"[\"OR\", {\"my_number\": {\"=\": \"5\"}}, {\"my_string\": {\"=\": \"test\"}}]"
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