function telecoms.dayparting.list

See also:

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.

Arguments:

argrequired?syntaxinfo
daypartingIDNlist:posintOptional filter. If supplied, restricts results to daypartings with this ID/these IDs.
desc.startsNstringOptional filter. Filter by descriptions that start with this string.
routeplanIDNlist:posintOptional filter. If supplied, restricts results to daypartings using these routeplans.
mailboxIDNlist:posintOptional filter. If supplied, restricts results to daypartings using these voicemail mailboxes.
edit_time.minNisotimeOptional filter. Limit results to daypartings that were created or last edited no earlier than this.
edit_time.maxNisotimeOptional filter. Limit results to daypartings that were created or last edited no later than this.
optfieldsNset:in_use|edit_timeAdditional information to fetch about each dayparting listed in the returned data.
optNset:briefChanges the behaviour of the function depending on which keywords are supplied.
limitNposintLimit the results to no more than this many daypartings.
custIDNposintcustID 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.

Further argument information

daypartingID

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.

desc.starts

A string. If supplied, only daypartings whose desc starts with this string will be returned.

routeplanID

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.

mailboxID

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.

edit_time.min

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.

edit_time.max

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.

optfields

A set of strings as a CSV string or array. Supply values from this list:

opt

A set of strings as a CSV string or array, though the only currently supported valus is:

limit

If specified, this will limit the maximum number of daypartings returned.

Example 1

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.

Example 2

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
}

Example 3

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
}

Example 4

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
}

Example 5

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.