Remove a tag from a conversation
Take a tag off a conversation. The tag stays in your account and on every other conversation that has it.
Endpoint
DELETE https://api.p.2chat.io/open/tags/<tag-uuid>/sessions/<session-key>
<tag-uuid>is the UUID of the tag, e.g.TAGd37f22fa-fe01-4a90-b57d-7e83ccc6a05a.<session-key>is thesession_keyof the conversation, e.g.WA-WAN8fd3442f-e111-4fed-9323-1824fd7546c9-14085550176. See where to get it.
Authentication
Include your API key in the X-User-API-Key header. Learn more about authentication.
Invocation
- cURL
- Python
- JavaScript
- PHP
curl --location --request DELETE 'https://api.p.2chat.io/open/tags/TAGd37f22fa-fe01-4a90-b57d-7e83ccc6a05a/sessions/WA-WAN8fd3442f-e111-4fed-9323-1824fd7546c9-14085550176' \
--header 'X-User-API-Key: your_api_key_here'
import requests
tag_uuid = "TAGd37f22fa-fe01-4a90-b57d-7e83ccc6a05a"
session_key = "WA-WAN8fd3442f-e111-4fed-9323-1824fd7546c9-14085550176"
url = f"https://api.p.2chat.io/open/tags/{tag_uuid}/sessions/{session_key}"
headers = {
"X-User-API-Key": "your_api_key_here"
}
response = requests.delete(url, headers=headers)
print(response.json())
const axios = require('axios');
const tagUuid = 'TAGd37f22fa-fe01-4a90-b57d-7e83ccc6a05a';
const sessionKey = 'WA-WAN8fd3442f-e111-4fed-9323-1824fd7546c9-14085550176';
const response = await axios.delete(`https://api.p.2chat.io/open/tags/${tagUuid}/sessions/${sessionKey}`, {
headers: {
'X-User-API-Key': 'your_api_key_here'
}
});
console.log(response.data);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.p.2chat.io/open/tags/TAGd37f22fa-fe01-4a90-b57d-7e83ccc6a05a/sessions/WA-WAN8fd3442f-e111-4fed-9323-1824fd7546c9-14085550176',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'DELETE',
CURLOPT_HTTPHEADER => array(
'X-User-API-Key: your_api_key_here'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response
Success (HTTP 200 OK)
{
"success": true
}
Error (HTTP 404 Not Found)
There is no tag with that UUID in your account, or the conversation doesn't have the tag.
{
"success": false,
"error": true,
"error_message": "Resource Not Found"
}