Create Label
curl --request POST \
--url https://{projectID}.texterchat.com/server/api/v2/labels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "important",
"name": "Important!"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: 'important', name: 'Important!'})
};
fetch('https://{projectID}.texterchat.com/server/api/v2/labels', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{projectID}.texterchat.com/server/api/v2/labels"
payload = {
"id": "important",
"name": "Important!"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "important",
"name": "Important!",
"color": "#a83236"
}Labels
Create Label
Create a new label in Texter.
POST
https://{projectID}.texterchat.com/server/api/v2
/
labels
Create Label
curl --request POST \
--url https://{projectID}.texterchat.com/server/api/v2/labels \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "important",
"name": "Important!"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: 'important', name: 'Important!'})
};
fetch('https://{projectID}.texterchat.com/server/api/v2/labels', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://{projectID}.texterchat.com/server/api/v2/labels"
payload = {
"id": "important",
"name": "Important!"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "important",
"name": "Important!",
"color": "#a83236"
}Required token scopes:
Manage labelsהרשאות
גוף
application/json
תגובה
The newly created label. Field-by-field reference: The Label object
A label defined in Texter