Create Macro
Create Macro
POST
https://api.ocamba.com/v1/hood/macros
Creates a new Macro object
Rate limits:
Burst: 10/s
Steady: 150/m
Request schema
bodyPOST https://api.ocamba.com/v1/hood/macros HTTP/1.1
Host: api.ocamba.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
{
"description": null,
"value": "this_is_a_value",
"fields": [
[
"partner_id",
"campaign_id",
"country_code"
]
],
"records": [
{}
]
}
curl -X POST "https://api.ocamba.com/v1/hood/macros" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"description":null,"value":"this_is_a_value","fields":[["partner_id","campaign_id","country_code"]],"records":[{}]}'
fetch("https://api.ocamba.com/v1/hood/macros", {
method: "POST",
headers: { Authorization: `Bearer ${TOKEN}`, "Content-Type": "application/json" },
body: JSON.stringify(
{
"description": null,
"value": "this_is_a_value",
"fields": [
[
"partner_id",
"campaign_id",
"country_code"
]
],
"records": [
{}
]
}
)
}).then(r => r.json());
$ch = curl_init("https://api.ocamba.com/v1/hood/macros");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Bearer $token",
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
[
"description" => null,
"value" => "this_is_a_value",
"fields" => [
[
"partner_id",
"campaign_id",
"country_code"
]
],
"records" => [
[]
]
]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
Responses
201 Created
HTTP/1.1 201 Created
Content-Type: application/json
Responses