API
टैग
Activities को व्यवस्थित करने के लिए टैग बनाएँ और संभालें
# टैग > Activities को व्यवस्थित करने के लिए टैग बनाएँ और संभालें - पेज: https://tbit.app/hi/docs/api/tags - Base URL: `https://rest-api.tbit.app/v1` - ऑथेंटिकेशन: हर request में आपकी key के साथ `X-API-Key` header (उदाहरण इसे `TBIT_API_KEY` environment variable से पढ़ते हैं) ## परिचय टैग से आप activities को कैटेगरी में बाँट और व्यवस्थित कर सकते हैं। हर टैग का एक नाम, एक वैकल्पिक रंग और एक वैकल्पिक विवरण होता है। टैग आपके एजेंट से जुड़े होते हैं। ## Endpoints | Method | Path | विवरण | | --- | --- | --- | | `GET` | `/v1/tags` | List all tags | | `POST` | `/v1/tags` | Create a new tag | | `PATCH` | `/v1/tags/:id` | Update a tag | | `DELETE` | `/v1/tags/:id` | Delete a tag | ## टैग की लिस्ट `GET /v1/tags` ```bash curl "https://rest-api.tbit.app/v1/tags" \ -H "X-API-Key: $TBIT_API_KEY" ``` ## टैग बनाएँ `POST /v1/tags` ```bash curl -X POST "https://rest-api.tbit.app/v1/tags" \ -H "X-API-Key: $TBIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "VIP", "color": "#ef4444", "description": "High-priority customers" }' ``` ## टैग अपडेट करें `PATCH /v1/tags/tag_id_1` ```bash curl -X PATCH "https://rest-api.tbit.app/v1/tags/tag_id_1" \ -H "X-API-Key: $TBIT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Premium", "color": "#8b5cf6" }' ``` ## टैग डिलीट करें `DELETE /v1/tags/tag_id_1` ```bash curl -X DELETE "https://rest-api.tbit.app/v1/tags/tag_id_1" \ -H "X-API-Key: $TBIT_API_KEY" ``` ## Response फ़ॉर्मेट एक टैग ऑब्जेक्ट: ```json { "data": [ { "id": "tag_id_1", "name": "VIP", "color": "#ef4444", "description": "High-priority customers", "created_at": "2024-09-01T12:00:00Z", "updated_at": "2024-09-01T12:00:00Z" }, { "id": "tag_id_2", "name": "New Lead", "color": "#3b82f6", "description": null, "created_at": "2024-09-02T08:00:00Z", "updated_at": "2024-09-02T08:00:00Z" } ] } ```टैग से आप activities को कैटेगरी में बाँट और व्यवस्थित कर सकते हैं। हर टैग का एक नाम, एक वैकल्पिक रंग और एक वैकल्पिक विवरण होता है। टैग आपके एजेंट से जुड़े होते हैं।
| Method | Path | विवरण |
|---|---|---|
| GET | /v1/tags | List all tags |
| POST | /v1/tags | Create a new tag |
| PATCH | /v1/tags/:id | Update a tag |
| DELETE | /v1/tags/:id | Delete a tag |
/v1/tagscurl "https://rest-api.tbit.app/v1/tags" \
-H "X-API-Key: $TBIT_API_KEY"const response = await fetch('https://rest-api.tbit.app/v1/tags', {
headers: {
'X-API-Key': process.env.TBIT_API_KEY,
},
});
const data = await response.json();import axios from 'axios';
const { data } = await axios.get(
'https://rest-api.tbit.app/v1/tags',
{
headers: {
'X-API-Key': process.env.TBIT_API_KEY,
},
},
);import os
import requests
response = requests.get(
'https://rest-api.tbit.app/v1/tags',
headers={'X-API-Key': os.environ['TBIT_API_KEY']},
)
data = response.json()<?php
$ch = curl_init('https://rest-api.tbit.app/v1/tags');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: ' . getenv('TBIT_API_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);/v1/tagscurl -X POST "https://rest-api.tbit.app/v1/tags" \
-H "X-API-Key: $TBIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "VIP",
"color": "#ef4444",
"description": "High-priority customers"
}'const response = await fetch('https://rest-api.tbit.app/v1/tags', {
method: 'POST',
headers: {
'X-API-Key': process.env.TBIT_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'VIP',
color: '#ef4444',
description: 'High-priority customers',
}),
});
const data = await response.json();import axios from 'axios';
const { data } = await axios.post(
'https://rest-api.tbit.app/v1/tags',
{
name: 'VIP',
color: '#ef4444',
description: 'High-priority customers',
},
{
headers: {
'X-API-Key': process.env.TBIT_API_KEY,
},
},
);import os
import requests
response = requests.post(
'https://rest-api.tbit.app/v1/tags',
headers={'X-API-Key': os.environ['TBIT_API_KEY']},
json={
'name': 'VIP',
'color': '#ef4444',
'description': 'High-priority customers',
},
)
data = response.json()<?php
$ch = curl_init('https://rest-api.tbit.app/v1/tags');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: ' . getenv('TBIT_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'VIP',
'color' => '#ef4444',
'description' => 'High-priority customers',
]),
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);/v1/tags/tag_id_1curl -X PATCH "https://rest-api.tbit.app/v1/tags/tag_id_1" \
-H "X-API-Key: $TBIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Premium",
"color": "#8b5cf6"
}'const response = await fetch('https://rest-api.tbit.app/v1/tags/tag_id_1', {
method: 'PATCH',
headers: {
'X-API-Key': process.env.TBIT_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Premium',
color: '#8b5cf6',
}),
});
const data = await response.json();import axios from 'axios';
const { data } = await axios.patch(
'https://rest-api.tbit.app/v1/tags/tag_id_1',
{
name: 'Premium',
color: '#8b5cf6',
},
{
headers: {
'X-API-Key': process.env.TBIT_API_KEY,
},
},
);import os
import requests
response = requests.patch(
'https://rest-api.tbit.app/v1/tags/tag_id_1',
headers={'X-API-Key': os.environ['TBIT_API_KEY']},
json={
'name': 'Premium',
'color': '#8b5cf6',
},
)
data = response.json()<?php
$ch = curl_init('https://rest-api.tbit.app/v1/tags/tag_id_1');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'PATCH',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: ' . getenv('TBIT_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Premium',
'color' => '#8b5cf6',
]),
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);/v1/tags/tag_id_1curl -X DELETE "https://rest-api.tbit.app/v1/tags/tag_id_1" \
-H "X-API-Key: $TBIT_API_KEY"const response = await fetch('https://rest-api.tbit.app/v1/tags/tag_id_1', {
method: 'DELETE',
headers: {
'X-API-Key': process.env.TBIT_API_KEY,
},
});
const data = await response.json();import axios from 'axios';
const { data } = await axios.delete(
'https://rest-api.tbit.app/v1/tags/tag_id_1',
{
headers: {
'X-API-Key': process.env.TBIT_API_KEY,
},
},
);import os
import requests
response = requests.delete(
'https://rest-api.tbit.app/v1/tags/tag_id_1',
headers={'X-API-Key': os.environ['TBIT_API_KEY']},
)
data = response.json()<?php
$ch = curl_init('https://rest-api.tbit.app/v1/tags/tag_id_1');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'X-API-Key: ' . getenv('TBIT_API_KEY'),
],
]);
$data = json_decode(curl_exec($ch), true);
curl_close($ch);एक टैग ऑब्जेक्ट:
{
"data": [
{
"id": "tag_id_1",
"name": "VIP",
"color": "#ef4444",
"description": "High-priority customers",
"created_at": "2024-09-01T12:00:00Z",
"updated_at": "2024-09-01T12:00:00Z"
},
{
"id": "tag_id_2",
"name": "New Lead",
"color": "#3b82f6",
"description": null,
"created_at": "2024-09-02T08:00:00Z",
"updated_at": "2024-09-02T08:00:00Z"
}
]
}