Create Search algorithm

Create Search algorithm

POST https://api.ocamba.com/v2/adex/search-algos
Creates a new algorithm object

Request schema

body
curl -X POST \
 "https://api.ocamba.com/v2/adex/search-algos" \
  -H "Authorization: Bearer {TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "example algorithm",
  "description": "this goes description",
  "metadata": {
    "key1": "value1",
    "key2": "value2",
    "key3": "value3"
  }
}'
const url = 'https://api.ocamba.com/v2/adex/search-algos';
const options = {
  method: 'POST',
  headers: {
    Authorization: "Bearer {TOKEN}",
    'Content-Type': "application/json"
  },
  body: JSON.stringify(
    {
      "name": "example algorithm",
      "description": "this goes description",
      "metadata": {
        "key1": "value1",
        "key2": "value2",
        "key3": "value3"
      }
    }
  )
};

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/search-algos");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  "Authorization: Bearer {TOKEN}",
  "Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(
  [
    "name" => "example algorithm",
    "description" => "this goes description",
    "metadata" => [
      "key1" => "value1",
      "key2" => "value2",
      "key3" => "value3"
    ]
  ]
));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

Responses

201 Created

{
  "id": "1000251",
  "company_id": "1331131",
  "name": "example algorithm",
  "type": "custom",
  "description": "this goes description"
  "metadata": {
    "key1": "value1",
    "key2": "value2",
    "key3": "value3"
  }   
}
Responses