How to integrate vicidial non agent api in php

2.1k Views Asked by At

I can't integrate vicidial non agent api in php .

require 'vicidialAgentAPI.php';

try {
    $vicidialAPI = new VicidialAgentAPI("127.0.0.1", "VicidialAPI", "6666", "1234",true);
    $vicidialAPI->version();        
} catch (Exception $e) {
    echo 'Exception: ',  $e->getMessage(), "\n";
}

What's my problem ?

http://127.0.0.1/agc/api.php?source=VicidialAPI&user=6666&pass=1234&function=version http://127.0.0.1/agc/api.php?source=VicidialAPI&user=6666&pass=1234&function=version Exception: cURL The requested URL returned error: 404 Not Found

2

There are 2 best solutions below

0
On

Replace 127.0.0.1 with the IP address of your vicidial server. If your server is local, try 'localhost'.

0
On

You said "NON-agent API" in the title, then "AgentAPI" in the filename. Which are you trying to use?

Vicidial's NonAgent API is at http://SERVER_IP/vicidial/non_agent_api.php not "vicidialAgentAPI.php", unless you've created a copy or made your own. (The Agent API is at /agc/api.php)

You appear to be invoking the API as a class, but it is not. It's just a PHP file that accepts parameters and provides responses based on GET or POST data. If you made your own PHP class, then including the class definition would be a requirement to get help with why it isn't working.

http://vicidial.org/docs/NON-AGENT_API.txt

http://vicidial.org/docs/AGENT_API.txt