Replace the opportunity's strategy-list memberships (multi-list)
curl --request PUT \
--url https://core.cognizo.ai/api/v2/brands/{brand_id}/opportunities/{id}/lists \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"list_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://core.cognizo.ai/api/v2/brands/{brand_id}/opportunities/{id}/lists"
payload = { "list_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"] }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({list_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']})
};
fetch('https://core.cognizo.ai/api/v2/brands/{brand_id}/opportunities/{id}/lists', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://core.cognizo.ai/api/v2/brands/{brand_id}/opportunities/{id}/lists",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'list_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://core.cognizo.ai/api/v2/brands/{brand_id}/opportunities/{id}/lists"
payload := strings.NewReader("{\n \"list_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://core.cognizo.ai/api/v2/brands/{brand_id}/opportunities/{id}/lists")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"list_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.cognizo.ai/api/v2/brands/{brand_id}/opportunities/{id}/lists")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"list_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "context_hint",
"intent": "C",
"difficulty": 123,
"cpc_micros": 123,
"est_volume": 123,
"est_volume_unit": "runs_per_week",
"reasoning_tags": [
"<string>"
],
"final_score": 123,
"scores": {},
"computed_at": "2023-11-07T05:31:56Z",
"volume_range": "<10",
"rationale": "<string>",
"source": {
"kind": "context_hint",
"text": "<string>",
"description": "<string>",
"prompt_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"prompts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>"
}
]
},
"matched_prompt": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>"
},
"list_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}Opportunities
Replace the opportunity's strategy-list memberships (multi-list)
PUT
/
api
/
v2
/
brands
/
{brand_id}
/
opportunities
/
{id}
/
lists
Replace the opportunity's strategy-list memberships (multi-list)
curl --request PUT \
--url https://core.cognizo.ai/api/v2/brands/{brand_id}/opportunities/{id}/lists \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"list_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
'import requests
url = "https://core.cognizo.ai/api/v2/brands/{brand_id}/opportunities/{id}/lists"
payload = { "list_ids": ["3c90c3cc-0d44-4b50-8888-8dd25736052a"] }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({list_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a']})
};
fetch('https://core.cognizo.ai/api/v2/brands/{brand_id}/opportunities/{id}/lists', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://core.cognizo.ai/api/v2/brands/{brand_id}/opportunities/{id}/lists",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'list_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://core.cognizo.ai/api/v2/brands/{brand_id}/opportunities/{id}/lists"
payload := strings.NewReader("{\n \"list_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://core.cognizo.ai/api/v2/brands/{brand_id}/opportunities/{id}/lists")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"list_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://core.cognizo.ai/api/v2/brands/{brand_id}/opportunities/{id}/lists")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"list_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "context_hint",
"intent": "C",
"difficulty": 123,
"cpc_micros": 123,
"est_volume": 123,
"est_volume_unit": "runs_per_week",
"reasoning_tags": [
"<string>"
],
"final_score": 123,
"scores": {},
"computed_at": "2023-11-07T05:31:56Z",
"volume_range": "<10",
"rationale": "<string>",
"source": {
"kind": "context_hint",
"text": "<string>",
"description": "<string>",
"prompt_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"prompts": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>"
}
]
},
"matched_prompt": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"text": "<string>"
},
"list_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"field": "<string>",
"code": "<string>",
"message": "<string>"
}
]
}
}
