Tag Add
Dodanie nowego tagu
POST /custom_tag
Body
{
"crm_id": "649575b7cd16c03466fb75a9"
"name": "Example Tag"
"color_hex": "#fff"
}
Nazwa | Rodzaj | Opis | Zasób |
---|---|---|---|
name | <STRING> |
Nowa nazwa Tagu | |
color_hex | <STRING> |
Kolor Tagu | |
position | <INT> |
Pozycja na liście | |
type | <STRING> |
Typ Tagu | |
crm_id | <STRING> |
Identyfikator CRM |
Response Body
{
"data": <Custom Tag>
}
Response Code
Status | Opis |
---|---|
200 | Żądanie przyjęte do realizacji |
403 | Nie można wykonać takiej akcji |
404 | Nie znaleziono zasobu |
Example
curl -X POST \
$CONPEEK_URL/custom_tag \
-H 'Authorization: '$CONPEEK_KEY \
-H 'Content-Type: application/json' \
-d '{
"name": "Lead",
"type": "TICKETING"
}'
import requests
import json
import os
from urllib import parse
url = parse.urljoin(os.environ["CONPEEK_URL"], "/custom_tag")
payload = {
"name": "Lead",
"type": "TICKETING"
}
headers = {
'Content-Type': "application/json",
'Authorization': os.environ["CONPEEK_KEY"]
}
response = requests.request("POST", url, data=json.dumps(payload), headers=headers)
print(response.text)
<?php
$curl = curl_init();
$payload = array(
"name" => "Lead",
"type" => "TICKETING"
);
curl_setopt_array($curl, array(
CURLOPT_URL => getenv("CONPEEK_URL")."/custom_tag",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($payload),
CURLOPT_HTTPHEADER => array(
"Authorization: ".getenv("CONPEEK_KEY"),
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}