curl -X DELETE " https://api.playground.try.be/customers/customers/00000000-0000-0000-0000-000000000000/labels " \
-H " Authorization: Bearer YOUR_API_KEY " \
-H " Accept: application/json " \
-H " Content-Type: application/json " \
-d ' {
"labels": [
"000000-000000-000000-000000"
]
} ' const response = await fetch ( ' https://api.playground.try.be/customers/customers/00000000-0000-0000-0000-000000000000/labels ' , {
method : ' DELETE ' ,
headers : {
Authorization : ' Bearer YOUR_API_KEY ' ,
' Content-Type ' : ' application/json ' ,
Accept : ' application/json ' ,
},
body : JSON . stringify ( {
" labels " : [
" 000000-000000-000000-000000 "
]
} ) ,
} )
if ( ! response . ok ) {
throw new Error ( ` Trybe API ${ response . status } : ${ await response . text () }` )
}
const data = await response . json () import httpx
response = httpx . delete (
" https://api.playground.try.be/customers/customers/00000000-0000-0000-0000-000000000000/labels " ,
headers = {
" Authorization " : " Bearer YOUR_API_KEY " ,
" Accept " : " application/json " ,
" Content-Type " : " application/json " ,
},
json = {
" labels " : [
" 000000-000000-000000-000000 "
]
},
)
response . raise_for_status ()
data = response . json () <? php
$ client = new \ GuzzleHttp \ Client ();
$ response = $ client -> request ( ' DELETE ' , ' https://api.playground.try.be/customers/customers/00000000-0000-0000-0000-000000000000/labels ' , [
' headers ' => [
' Authorization ' => ' Bearer YOUR_API_KEY ' ,
' Accept ' => ' application/json ' ,
' Content-Type ' => ' application/json ' ,
],
' json ' => [
' labels ' => [
' 000000-000000-000000-000000 '
]
],
]);
$ data = json_decode ($ response -> getBody (), true ); package main
import (
" bytes "
" encoding/json "
" net/http "
)
func main () {
payload , _ := json . Marshal ( map [ string ] interface {}{
" labels " : [] interface {}{
" 000000-000000-000000-000000 " ,
},
})
req , _ := http . NewRequest ( " DELETE " , " https://api.playground.try.be/customers/customers/00000000-0000-0000-0000-000000000000/labels " , bytes . NewBuffer ( payload ))
req . Header . Set ( " Authorization " , " Bearer YOUR_API_KEY " )
req . Header . Set ( " Accept " , " application/json " )
req . Header . Set ( " Content-Type " , " application/json " )
resp , err := http . DefaultClient . Do ( req )
if err != nil {
panic ( err )
}
defer resp . Body . Close ()
var data map [ string ] interface {}
json . NewDecoder ( resp . Body ). Decode ( & data )
} 200 401 403 404 422
The customer's labels were successfully retrieved
{
" data " : [
{
" id " : " 00000000-0000-0000-0000-000000000000 " ,
" value " : " VIP " ,
" colour " : " ff6634 "
}
]
} {
" message " : " Unauthenticated "
} {
" message " : " This action is unauthorized. "
} {
" message " : " The requested resource could not be found "
} {
" errors " : {},
" message " : " The request didn't pass validation "
}