JSON API » analytics » analytics/create

Creates a new analytics report.

Input parameters

Requires authentication and the administrator privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
nameStringReport name.Yes
typeStringReport type, one of "table", "linechart", "barchart", "stacked", or "piechart".YesNone
ownerIntegerID number of owning user, or 0 for none.No0
recursiveInteger1 to include sub-customers recursive, 0 not to.No0
piesourceStringID string of source for pie chart data, 0 for none.NoEmpty string
periodInteger0 to report per destination. 60, 300, 900, 1800, 3600, 10800, 21600, 43200, 86400, 604800 to report in increments of that many seconds. -1800 to report on the half hour of the day, -3600 to report on the hour of the day, and -604800 to report on the day of the week.No0
startdayInteger-31, -30, etc through to -1 for that many days ago, 0 for today, 1 to use specific date as per "startdate", 2 for first day of last month, 3 for first day of this month, 4 for tomorrow.No0
startdateIntegerStart date as unix timestamp, does not include time of day. Only used if "startday" is 1.No0
starttimeIntegerStart time as offset from midnight in seconds. Only used if "startday" is 1.No0
enddayInteger-31, -30, etc through to -1 for that many days ago, 0 for today, 1 to use specific date as per "startdate", 2 for first day of last month, 3 for first day of this month, 4 for tomorrow.No0
enddateIntegerEnd date as unix timestamp, does not include time of day. Only used if "endday" is 1.No0
endtimeIntegerEnd time as offset from midnight in seconds. Only used if "endday" is 1.No0
slatimeIntegerMaximum number of seconds that call must be answered within to be counted in the "SLA ok" metric.No0
shorttimeIntegerMaximum number of seconds that call must be abandoned within to be counted as "short abandon", otherwise will be counted as "abandoned".No0
phonetitleStringHow to display telephone names; "name" for full telephone line number, "description" for description, "internal" for internal callerid, "name_description" for number and description, "internal_description" for internal callerid and description, "description_name" for description and number, "description_internal" for description and internal callerid.Noname
scheduledInteger0 to never email report, -1 to email on first day of month, 1 for Mondays, 2 for Tuesdays, 4 for Wednesdays, 8 for Thursdays, 16 for Fridays, 32 for Saturdays, 64 for Sundays, 127 for every day of the week.No0
emailtimeIntegerTime of day to email report, as number of hours from midnight.No0
emailStringEmail address(es) to send report to, separated by spaces.NoEmpty string
totalcallsInteger1 to show the "Total calls" metric, 0 not to.No0
answercallsInteger1 to show the "Answered" metric, 0 not to.No0
noanswercallsInteger1 to show the "Not answered" metric, 0 not to.No0
slaokInteger1 to show the "SLA ok" metric, 0 not to.No0
incallsInteger1 to show the "Inbound calls" metric, 0 not to.No0
inanswerInteger1 to show the "Inbound answered" metric, 0 not to.No0
innoanswerInteger1 to show the "Inbound no answer" metric, 0 not to.No0
internalcallsInteger1 to show the "Internal calls" metric, 0 not to.No0
internalanswerInteger1 to show the "Internal answered" metric, 0 not to.No0
internalnoanswerInteger1 to show the "Internal no answer" metric, 0 not to.No0
outcallsInteger1 to show the "Outbound calls" metric, 0 not to.No0
outanswerInteger1 to show the "Outbound answered" metric, 0 not to.No0
outnoanswerInteger1 to show the "Outbound no answer" metric, 0 not to.No0
holdminInteger1 to show the "Hold time minimum" metric, 0 not to.No0
holdavgInteger1 to show the "Hold time average" metric, 0 not to.No0
holdmaxInteger1 to show the "Hold time maximum" metric, 0 not to.No0
holdtotalInteger1 to show the "Hold time total" metric, 0 not to.No0
talkminInteger1 to show the "Talk time minimum" metric, 0 not to.No0
talkavgInteger1 to show the "Talk time average" metric, 0 not to.No0
talkmaxInteger1 to show the "Talk time maximum" metric, 0 not to.No0
talktotalInteger1 to show the "Talk time total" metric, 0 not to.No0
totalminInteger1 to show the "Total time minimum" metric, 0 not to.No0
totalavgInteger1 to show the "Total time average" metric, 0 not to.No0
totalmaxInteger1 to show the "Total time maximum" metric, 0 not to.No0
totaltotalInteger1 to show the "Total time total" metric, 0 not to.No0
abandonInteger1 to show the "Abandoned by caller" metric (> short abandon time), 0 not to.No0
shortabandonInteger1 to show the "Short abandon by caller" metric (<= short abandon time), 0 not to.No0
noagentInteger1 to show the "No agents available" metric, 0 not to.No0
timeoutInteger1 to show the "Time-out in queue" metric, 0 not to.No0
keypressInteger1 to show the "Key press by caller" metric, 0 not to.No0
agentInteger1 to show the "Agent completed" metric, 0 not to.No0
callerInteger1 to show the "Caller completed" metric, 0 not to.No0
transferInteger1 to show the "Transfer by agent" metric, 0 not to.No0
logintimeInteger1 to show the "Available time" metric, 0 not to.No0
unavailableInteger1 to show the "Unavailable time" metric, 0 not to.No0
allcallsInteger1 to show the "All calls" destination, 0 not to.No0
inboundInteger1 to show the "External callers" destination, 0 not to.No0
internalInteger1 to show the "Internal call legs" destination, 0 not to.No0
outboundInteger1 to show the "External destinations" destination, 0 not to.No0
numbersInteger"all" to report on all numbers and feature codes, "use_control_panel" to report those with "Show in control panel" enabled, "use_include" to select individually, "none" for none.No0
numbersincludeIntegerThe numbers or feature codes (as a multi-value parameter) to include if "numbers" is set to "use_include".No0
queuesInteger"all" to report on all queues, "use_control_panel" to report those with "Show in control panel" enabled, "use_include" to select individually, "none" for none.No0
queuesincludeIntegerThe queue ID numbers (as a multi-value parameter) to include if "queues" is set to "use_include".No0
agentsInteger"all" to report on all queue destinations, "queues" to report destinations in the displayed queues, "queues_available" to report destinations in displayed queues which are available in the queue, "use_control_panel" to report those with "Show in control panel" enabled, "use_include" to select individually, "none" for none.No0
agentsincludeIntegerThe queue destinations (as a multi-value parameter) to include if "agents" is set to "use_include". Each agent must be in the format dtype_dnumber, for example phone_1234567.No0
phonesInteger"all" to report on all telephone lines, "use_control_panel" to report those with "Show in control panel" enabled, "use_include" to select individually, "none" for none.No0
phonesincludeIntegerThe telephone lines (as a multi-value parameter) to include if "phones" is set to "use_include".No0
totalrowInteger1 to show the "Total" destination, 0 not to.No0

Responses

CodeDescription
200Success.
201Input passed validation. Only returned if validation=1.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.

Data returned

The ID of the created report.

Example: With required parameters

http://enswitch.example.com/api/json/analytics/create/?auth_username=user;auth_password=password;server=example;name=Test;type=table

{ "responses":[ { "code":"200", "key":"", "message":"OK" } ], "data":{ "id":123 } }

Change history

VersionChanges
4.3Function added.