See also:
telecoms.dayparting functionsDeletes a dayparting from the system.
If the dayparting is in use, ie being referenced by another object (eg a number is routed to this dayparting or it is the destination of an IVR menu option) then the API will refuse to delete it, but will instead return an error.
See the in_use option for the optfields argument in telecoms.dayparting.list:optfields to learn how to see which daypartings are in use and therefore cannot be deleted.
| arg | required? | syntax | info |
|---|---|---|---|
daypartingID | Y | posint | The daypartingID of the dayparting you wish to delete |
custID | N | posint | custID of the account which owns the dayparting you wish to delete (defaults to current account). You only need to specify this if you are delete a dayparting from a sub-account. |
Delete the dayparting with daypartingID 2373
JSON example request:
POST https://live.apicontrol.co.uk/1/json
{
"auth" : {
"username" : "YOURUSERNAME",
"password" : "YOURPASSWORD",
},
"func" : "telecoms.dayparting.list",
"args" : {
"daypartingID" : 2373
}
}
JSON example response:
{
"results" : {
"numdeleted" : 1
},
"success" : 1
}
Repeating the above action now returns an error saying that the dayparting is not found within your accounnt (because it's already been deleted in the previous example):
JSON example request:
POST https://live.apicontrol.co.uk/1/json
{
"auth" : {
"username" : "YOURUSERNAME",
"password" : "YOURPASSWORD",
},
"func" : "telecoms.dayparting.list",
"args" : {
"daypartingID" : 2373
}
}
JSON example response:
{
"error" : "daypartingID not found within account",
"errordiags" : {
"child_arg" : "daypartingID",
"child_val" : 2373,
"errclass" : "illegal",
"errtype" : "perm",
"parent_account_arg" : "custID",
"parent_account_val" : 16526
},
"errornum" : "5.2.18",
"results" : {},
"success" : 0
}