Page 1 of 1

API for Agent Screen

PostPosted: Sun May 01, 2016 11:42 am
by antuan
Hello!!!!

I would like you to tell me if there exist api wich I can see lead_id or phone_number that has come to agent from the predictive dialer?

Thankssssss

Re: API for Agent Screen

PostPosted: Sun May 01, 2016 3:17 pm
by antuan
My problem should be solved by this fuction

st_get_agent_active_lead
http://192.168.1.100/agc/api.php?
source=api_admin&user=6666&pass=123qwe456&function=st_get_agent_active_lead&value=876543&vendor_id=207

my question is whats means value=876543 and vendor_id=207 and where i can find them.

Re: API for Agent Screen

PostPosted: Sun May 01, 2016 3:42 pm
by mflorell
You are actually looking for the Non-agent API, since this does not affect the logged-in agent screen,
http://vicidial.org/docs/NON-AGENT_API.txt

Here's the function you want:

--------------------------------------------------------------------------------
agent_status - real-time status of one agent user

NOTE: api user for this function must have user_level set to 7 or higher and "view reports" enabled

REQUIRED FIELDS-
source - description of what originated the API call (maximum 20 characters)
agent_user - 2-20 characters, use only for one agent status

SETTINGS FIELDS-
stage - the format of the exported data: csv, tab, pipe(default)
header - include a header(YES) or not(NO). This is optional, default is not to include a header

Example URL strings for API calls:
http://server/vicidial/non_agent_api.ph ... header=YES

Example responses:
ERROR: agent_status USER DOES NOT HAVE PERMISSION TO GET AGENT INFO - 6666|0
ERROR: agent_status INVALID SEARCH PARAMETERS - 6666||
ERROR: agent_status AGENT NOT FOUND - 6666||
ERROR: agent_status AGENT NOT LOGGED IN - 6666||

A SUCCESS response will not show "SUCCESS", but instead will just print the results in the following format:
status,call_id,lead_id,campaign_id,calls_today,full_name,user_group,user_level,pause_code,real_time_sub_status,phone_number,vendor_lead_code,session_id
INCALL,M4050908070000012345,12345,TESTCAMP,1,Test Agent,AGENTS,3,LOGIN,,7275551212,123456,8600051
INCALL|M4181606420000000104|104|TESTBLND|1|Admin|ADMIN|9|BRK2|DEAD|3125551212|123457|8600051
PAUSED||105|TESTBLND|1|Admin|ADMIN|9||PREVIEW|9545551212|123458|8600052

NOTE: real_time_sub_status field can consist of: DEAD, DISPO, 3-WAY, PARK, RING, PREVIEW or it can be empty

Re: API for Agent Screen

PostPosted: Sun May 01, 2016 5:03 pm
by antuan
mflorell thanksssssssssssss!!!!!!!

Re: API for Agent Screen

PostPosted: Mon May 02, 2016 4:38 am
by antuan
Does the API agent_status exist in sql query?

I run the query

SELECT extension,vicidial_live_agents.user,conf_exten,vicidial_live_agents.status,vicidial_live_agents.server_ip,UNIX_TIMESTAMP(last_call_time),UNIX_TIMESTAMP(last_call_finish),call_server_ip,vicidial_live_agents.campaign_id,vicidial_users.user_group,vicidial_users.full_name,vicidial_live_agents.comments,vicidial_live_agents.calls_today,vicidial_live_agents.callerid,lead_id,UNIX_TIMESTAMP(last_state_change),on_hook_agent,ring_callerid,agent_log_id from vicidial_live_agents,vicidial_users where vicidial_live_agents.user=vicidial_users.user and vicidial_users.user_hide_realtime='0' and vicidial_live_agents.campaign_id IN('500','') order by full_name desc,status desc,last_call_time desc;

but it did not show the line is DEAD or DISPO...

Can you help me to find the right query.

The API agent_status you have got has nice informations!!!!!
status,callerid,lead_id,campaign_id,calls_today,full_name,user_group,user_level
INCALL,M5021300530000000082,82,500,38,Stadar User,AGENTS,1,ANDIAL,DEAD,XXXXXXXXXX,XXXXXXXXX,8600051

Please i want it SQL QUERY
I would apretiate if you could help me

Thanksssssssssss :)

Re: API for Agent Screen

PostPosted: Mon May 02, 2016 5:43 am
by mflorell
It's all there in the code, and it's not a single SQL query that provides that information, it's multiple SQL queries based upon what other values are.