Configure Algorithm distribution

Configure Algorithm distribution

POST https://api.ocamba.com/v2/adex/zones/{zone_id}/distribute-search-algos
Configures the distribution for Algorithms

Tip
If you don’t know the zone id, list the zones to find it. If you don’t know the search algorithm id, list the search algorithm to find it.
Note
Sum of distribution rates across all active algorithms must be 100.

Path parameters

parameters

Request schema

body

Response schemas

204
No Content
curl -X POST \
 "https://api.ocamba.com/v2/adex/zones/{zone_id}/distribute-search-algos" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '"{\n  \"distribute\": 1,\n  \"search_algos\": [\n    {\n      \"id\": \"1000248\",\n      \"rate\": 23,\n      \"status\": \"active\",\n    },\n    {\n      \"id\": \"1000249\",\n      \"rate\": 77,\n      \"status\": \"active\"\n    }\n  ]\n}"'
const url = 'https://api.ocamba.com/v2/adex/zones/{zone_id}/distribute-search-algos';
const options = {
  method: 'POST',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    "{\n  \"distribute\": 1,\n  \"search_algos\": [\n    {\n      \"id\": \"1000248\",\n      \"rate\": 23,\n      \"status\": \"active\",\n    },\n    {\n      \"id\": \"1000249\",\n      \"rate\": 77,\n      \"status\": \"active\"\n    }\n  ]\n}"
  )
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
$ch = curl_init("https://api.ocamba.com/v2/adex/zones/{zone_id}/distribute-search-algos");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  "[\n  \"distribute\" => 1,\n  \"search_algos\" => [\n    [\n      \"id\" => \"1000248\",\n      \"rate\" => 23,\n      \"status\" => \"active\",\n    ],\n    [\n      \"id\" => \"1000249\",\n      \"rate\" => 77,\n      \"status\" => \"active\"\n    ]\n  ]\n]"
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

204 No Content

Responses