Create Variable
Create Variable
POST
https://api.ocamba.com/v1/hood/variables
Creates a new Variable object
Rate limits:
Burst: 10/s
Steady: 150/m
Request schema
bodyPOST https://api.ocamba.com/v1/hood/variables HTTP/1.1
Host: api.ocamba.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
{
"name": "Variable Example",
"group_type": "navigation",
"type": "referrer",
"settings": {},
"formatting": {},
"description": "This is an example of description."
}
curl -X POST "https://api.ocamba.com/v1/hood/variables" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"name":"Variable Example","group_type":"navigation","type":"referrer","settings":{},"formatting":{},"description":"This is an example of description."}'
fetch("https://api.ocamba.com/v1/hood/variables", {
method: "POST",
headers: { Authorization: `Bearer ${TOKEN}`, "Content-Type": "application/json" },
body: JSON.stringify(
{
"name": "Variable Example",
"group_type": "navigation",
"type": "referrer",
"settings": {},
"formatting": {},
"description": "This is an example of description."
}
)
}).then(r => r.json());
$ch = curl_init("https://api.ocamba.com/v1/hood/variables");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer $token",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
[
"name" => "Variable Example",
"group_type" => "navigation",
"type" => "referrer",
"settings" => [],
"formatting" => [],
"description" => "This is an example of description."
]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
Responses
201 Created
HTTP/1.1 201 Created
Content-Type: application/json
Responses
Note
1
The navigation group_type includes the types url and referrer.
2
The page_elements group_type includes the types dom-element and element-visibility.
3
The page_variables group_type includes the types 1st-party-cookie, data-layer-variable, and custom-js.
4
The utilities group_type includes the type custom-event.