See also:
telecoms.dayparting functions
Returns a list of your daypartings. There are optional arguments that can be used to limit or filter the returned list.
If you wish to list daypartings that belong to a sub-account, you must specifiy their custID in the custID argument.
Only basic information on each dayparting is returned. To fetch the full detail of a specific dayparting, identify the daypartingID
from the returned data and then use that with telecoms.dayparting.get.
| arg | required? | syntax | info |
|---|---|---|---|
daypartingID | N | list:posint | Optional filter. If supplied, restricts results to daypartings with this ID/these IDs. |
desc.starts | N | string | Optional filter. Filter by descriptions that start with this string. |
routeplanID | N | list:posint | Optional filter. If supplied, restricts results to daypartings using these routeplans. |
mailboxID | N | list:posint | Optional filter. If supplied, restricts results to daypartings using these voicemail mailboxes. |
edit_time.min | N | isotime | Optional filter. Limit results to daypartings that were created or last edited no earlier than this. |
edit_time.max | N | isotime | Optional filter. Limit results to daypartings that were created or last edited no later than this. |
optfields | N | set:in_use|edit_time | Additional information to fetch about each dayparting listed in the returned data. |
opt | N | set:brief | Changes the behaviour of the function depending on which keywords are supplied. |
limit | N | posint | Limit the results to no more than this many daypartings. |
custID | N | posint | custID of the account which owns the daypartings you wish to list (defaults to current account). You only need to specify this if you are listing daypartings on a sub-account. |
Takes a list of one or more daypartingID values. Can be an array or a CSV string (no spaces).
If supplied, only daypartings whose daypartingID are in this list will be returned.
A string. If supplied, only daypartings whose desc starts with this string will be returned.
Takes a list of one or more routeplanID values. Can be an array or a CSV string (no spaces).
If supplied, only daypartings whose destinations include at least one of these routeplans will be returned.
Takes a list of one or more mailboxID values. Can be an array or a CSV string (no spaces).
If supplied, only daypartings whose destinations include at least one of these voicemail mailboxes will be returned.
A datetime value in YYYY-MM-DD HH:MM:SS format. If specified, only daypartings created or
last modifed on or since this time will be returned.
A datetime value in YYYY-MM-DD HH:MM:SS format. If specified, only daypartings created or
last modifed on or before this time will be returned.
A set of strings as a CSV string or array. Supply values from this list:
in_use - includes a field in the returned data that indicates whether any other objects
(eg phone numbers, IVR menus) are currently referencing this dayparting. The telecoms.dayparting.delete
function will not allow you to delete a dayparting that is in use. The returned value will be 0 (indicating that
the dayparting is not in use) or 1 (indicating that something else is referencing this dayparting).
edit_time - returns a datetime string indicating when the dayparting was created or last edited,
whichever is more recent.
A set of strings as a CSV string or array, though the only currently supported valus is:
brief - causes this function to return minimal data, just containing the daypartingID
and desc fields. This can be useful if you just want these fields and you have many daypartings and so you want
to limit the size of the data that is returned.
If specified, this will limit the maximum number of daypartings returned.
Fetching a list of your first 3 daypartings. Set the limit argument to 3 in order to limit the results
to this many.
JSON example request:
POST https://live.apicontrol.co.uk/1/json
{
"auth" : {
"username" : "YOURUSERNAME",
"password" : "YOURPASSWORD",
},
"func" : "telecoms.dayparting.list",
"args" : {
"limit" : 3
}
}
JSON example response:
{
"results" : {
"data" : [
{
"created" : "2021-10-12 11:34:57",
"custID" : 16526,
"daypartingID" : 2854,
"desc" : "Accounts team"
},
{
"created" : "2021-08-25 16:08:43",
"custID" : 16526,
"daypartingID" : 2822,
"desc" : "BDW Test"
},
{
"created" : "2021-10-12 10:16:23",
"custID" : 16526,
"daypartingID" : 2850,
"desc" : "DP test"
}
],
"more_rows" : 1
},
"success" : 1
}
The list of daypartings is shown in the data sub-array. The more_rows field indicates whether there are
more daypartings that would have been returned had the limit argument not been supplied.
Fetching a list of your first 3 daypartings but also requesting edit_time and in_use
JSON example request:
POST https://live.apicontrol.co.uk/1/json
{
"auth" : {
"username" : "YOURUSERNAME",
"password" : "YOURPASSWORD",
},
"func" : "telecoms.dayparting.list",
"args" : {
"limit" : 3,
"optfields" : "in_use,edit_time"
}
}
JSON example response:
{
"results" : {
"data" : [
{
"created" : "2021-09-29 15:08:05",
"custID" : 16526,
"daypartingID" : 2814,
"desc" : "API-test",
"edit_time" : "2021-09-29 15:08:05",
"in_use" : 1
},
{
"created" : "2018-11-14 14:26:43",
"custID" : 16526,
"daypartingID" : 2477,
"desc" : "bangbang",
"edit_time" : "2021-09-28 15:33:55",
"in_use" : 1
},
{
"created" : "2021-10-08 11:35:40",
"custID" : 16526,
"daypartingID" : 2858,
"desc" : "BDW Testing",
"edit_time" : "2021-10-08 11:46:15",
"in_use" : 0
}
],
"more_rows" : 1
},
"success" : 1
}
Requesting a "brief" formatted list.
JSON example request:
POST https://live.apicontrol.co.uk/1/json
{
"auth" : {
"username" : "YOURUSERNAME",
"password" : "YOURPASSWORD",
},
"func" : "telecoms.dayparting.list",
"args" : {
"opt" : "brief"
}
}
JSON example response:
{
"results" : {
"data" : [
{
"daypartingID" : 2854,
"desc" : "Accounts team"
},
{
"daypartingID" : 2822,
"desc" : "BDW Test"
},
{
"daypartingID" : 2850,
"desc" : "DP test"
},
{
"daypartingID" : 1,
"desc" : "Londis Head Office"
},
{
"daypartingID" : 2848,
"desc" : "London Office"
},
{
"daypartingID" : 2762,
"desc" : "Roger Fedley"
},
{
"daypartingID" : 2852,
"desc" : "Sales team"
},
{
"daypartingID" : 2842,
"desc" : "Saltaire Brewery"
},
{
"daypartingID" : 2373,
"desc" : "Voicemail Test"
}
],
"more_rows" : 0
},
"success" : 1
}
Requesting a "brief" formatted list of all daypartings whose description starts with "sal" whilst also requesting
the in_use field to be returned with the data.
JSON example request:
POST https://live.apicontrol.co.uk/1/json
{
"auth" : {
"username" : "YOURUSERNAME",
"password" : "YOURPASSWORD",
},
"func" : "telecoms.dayparting.list",
"args" : {
"desc.starts" : "sal",
"opt" : "brief",
"optfields" : "in_use"
}
}
JSON example response:
{
"results" : {
"data" : [
{
"daypartingID" : 2852,
"desc" : "Sales team",
"in_use" : 0
},
{
"daypartingID" : 2842,
"desc" : "Saltaire Brewery",
"in_use" : 0
}
],
"more_rows" : 0
},
"success" : 1
}
Requesting a "brief" formatted list of daypartings from a specific list of daypartingIDs.
JSON example request:
POST https://live.apicontrol.co.uk/1/json
{
"auth" : {
"username" : "YOURUSERNAME",
"password" : "YOURPASSWORD",
},
"func" : "telecoms.dayparting.list",
"args" : {
"daypartingID" : [ 2854, 2848, 999, 9999, 99999, 999999 ],
"opt" : "brief"
}
}
JSON example response:
{
"results" : {
"data" : [
{
"daypartingID" : 2854,
"desc" : "Accounts team"
},
{
"daypartingID" : 2848,
"desc" : "London Office"
}
],
"more_rows" : 0
},
"success" : 1
}
Only the matching daypartings were returned. Not all of the supplied daypartingIDs matched daypartings on the account
which is why only two were returned despite more being requested.