API calls

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

API calls

Postby 0x1337 » Fri Mar 08, 2019 3:34 am

Hi there i am using the latest version of vicibox and although i can get a lot of info via the api i would like to know if i can get the today calls for a agent that has done and the status of the dispositions of them.
Thank you in advance
0x1337
 
Posts: 9
Joined: Wed Mar 06, 2019 5:45 am

Re: API calls

Postby mflorell » Fri Mar 08, 2019 6:23 am

The only Non-Agent API function I can think of that is close to this is "agent_stats_export", which doesn't have per-dispo counts. If you need those you'll have to gather them from one of the standard reports, or a direct database query of the vicidial_agent_log table.
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: API calls

Postby 0x1337 » Tue Mar 12, 2019 8:29 am

Thank you for the reply.
So i need to query the report page and handle the response?
0x1337
 
Posts: 9
Joined: Wed Mar 06, 2019 5:45 am

Re: API calls

Postby mflorell » Tue Mar 12, 2019 9:20 am

There are DOWNLOAD link options for most of the reports, like on the User Stats report, that show individual calls and the agent dispo. You can easily grab those with a simple web call using only a URL.
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: API calls

Postby 0x1337 » Wed Mar 13, 2019 3:31 am

http://xxx.xxx.xxx.xxx/vicidial/AST_tea ... 9:59&group[]=1000&group[]=10000&group[]=11000&group[]=12000&group[]=13000&group[]=14000&group[]=2000&group[]=3000&group[]=4000&group[]=5000&group[]=6000&group[]=7000&group[]=9000&user_group[]=ADMIN&user_group[]=Agents&user_group[]=QCOK&user_group[]=VAdmin&call_status[]=A&call_status[]=AA&call_status[]=AB&call_status[]=ADC&call_status[]=ADCT&call_status[]=AFAX&call_status[]=AFTHRS&call_status[]=AL&call_status[]=AM&call_status[]=B&call_status[]=CALLBK&call_status[]=CBHOLD&call_status[]=DC&call_status[]=DEC&call_status[]=DNC&call_status[]=DNCC&call_status[]=DNCL&call_status[]=DROP&call_status[]=ERI&call_status[]=INCALL&call_status[]=IVRXFR&call_status[]=LRERR&call_status[]=LSMERG&call_status[]=MAXCAL&call_status[]=MLINAT&call_status[]=N&call_status[]=NA&call_status[]=NANQUE&call_status[]=NEW&call_status[]=NI&call_status[]=nieerr&call_status[]=NP&call_status[]=PDROP&call_status[]=PM&call_status[]=PU&call_status[]=QCFAIL&call_status[]=QUEUE&call_status[]=QVMAIL&call_status[]=RQXFER&call_status[]=SVYCLM&call_status[]=SVYEXT&call_status[]=SVYHU&call_status[]=SVYREC&call_status[]=SVYVM&call_status[]=TIMEOT&call_status[]=XDROP&call_status[]=XFER&call_status[]=Zualt&file_download=1&search_archived_data=&SUBMIT=SUBMIT

how should i add the user that i want to be logged on this request? running it like that returns = Login incorrect, please try again: |||BAD|
0x1337
 
Posts: 9
Joined: Wed Mar 06, 2019 5:45 am

Re: API calls

Postby mflorell » Wed Mar 13, 2019 4:59 am

If you are using an application like 'wget' you will need to use an authorized user's credentials to be able to run the report. Something like this will work:
Code: Select all
`/usr/bin/wget --auth-no-challenge --http-user=$http_user --http-password=$http_pass --output-document=/tmp/X$HTMLfile --output-file=/tmp/Y$HTMLfileLOG $REPORT_URL`;
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: API calls

Postby 0x1337 » Wed Mar 13, 2019 5:47 am

what if wanna call it from an another server?
i mean i using golang to gather up the stats from my servers so i need to call that from other ips!
0x1337
 
Posts: 9
Joined: Wed Mar 06, 2019 5:45 am

Re: API calls

Postby mflorell » Wed Mar 13, 2019 6:40 am

The above wget line would work from any server in the world, providing your VICIdial system is accessible to the internet.
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: API calls

Postby 0x1337 » Wed Mar 13, 2019 7:26 am

thank you very much :)
0x1337
 
Posts: 9
Joined: Wed Mar 06, 2019 5:45 am

Re: API calls

Postby 0x1337 » Wed Apr 03, 2019 3:27 am

Hi again is there anyway to get json back from that?via the api?
0x1337
 
Posts: 9
Joined: Wed Mar 06, 2019 5:45 am

Re: API calls

Postby mflorell » Wed Apr 03, 2019 5:16 am

VICIdial APIs do not use JSON in any way.
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: API calls

Postby 0x1337 » Wed Apr 03, 2019 6:57 am

parsing the html file is a real pain, is there a way to get something else returned there?
thank you in advance
0x1337
 
Posts: 9
Joined: Wed Mar 06, 2019 5:45 am

Re: API calls

Postby mflorell » Wed Apr 03, 2019 9:01 am

By default, the APIs return data as pipe-delimited, not HTML. As for reports, most of them have a DOWNLOAD option that returns CSV or Tab-delimited data.

What exactly are you looking for?
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: API calls

Postby 0x1337 » Wed Apr 03, 2019 9:24 am

wget serverIP --auth-no-challenge --http-user=Username --http-password=Password --output-document=log1.csv --output-file=log1.csv http://ServerIP/vicidial/AST_agent_status_detail.php\?DB\=\&query_date\=2019-02-01\&end_date\=2019-02-05\&group[]=1000&group[]=10000&group[]=11000&group[]=12000&group[]=13000&group[]=14000&group[]=16000&group[]=17000&group[]=18000&group[]=2000&group[]=3000&group[]=4000&group[]=5000&group[]=6000&group[]=7000&group[]=9000&user_group[]=ADMIN&user_group[]=Agents&user_group[]=QCOK&user_group[]=VAdmin&shift=ALL&search_archived_data=&show_defunct_users=&report_display_type=TEXT&DB=&stage=&file_download=1

i am trying like this but the data looks a bit wierd
i wanna get agent status view in csv
0x1337
 
Posts: 9
Joined: Wed Mar 06, 2019 5:45 am

Re: API calls

Postby mflorell » Wed Apr 03, 2019 6:20 pm

Try the DOWNLOAD link option, just add "&file_download=1" to the end of your URL
mflorell
Site Admin
 
Posts: 18335
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Re: API calls

Postby 0x1337 » Thu Apr 04, 2019 4:25 am

yeah i got it thank you so much for the help
0x1337
 
Posts: 9
Joined: Wed Mar 06, 2019 5:45 am


Return to Support

Who is online

Users browsing this forum: Google [Bot] and 91 guests