Toky API

Connect Toky with your business tools

Integrate Toky virtual phone system features into your business apps and CRM and improve your communication with customers.
Find comprehensive guides and documentation to help you start working with Toky API and developer tools.

API Reference    Get Started

How to get Toky agents list

Learn how to get a list of your Toky agents using our API

📘

API Endpoint used

/agents

Parameters you need to replace in the getTokyAgents function:

function getTokyAgents()
{
    // create a new cURL resource
    $ch = curl_init();
        $api_key = '[[TOKY_API_KEY]]';
    $headers = array();
    $headers[] = "X-Toky-Key: {$api_key}";
 
    // set URL and other appropriate options
    curl_setopt($ch, CURLOPT_URL, "https://api.toky.co/v1/agents");
    curl_setopt( $ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true);
    
    $curl_response = curl_exec($ch); // Send request
    curl_close($ch); // close cURL resource 
    
        return json_decode($curl_response,true);
}
    $agents = getTokyAgents();
    $agentsNumber = sizeof($agents);
    print "Loaded $agentsNumber agents: "; var_export($agents);

Updated 8 months ago

How to get Toky agents list


Learn how to get a list of your Toky agents using our API

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.