Hoiio Open API

This example shows you how to make use of voice/conference to make a conference call to multiple parties.


        <title>Hoiio Conference API</title>
    <body style="font-family:arial,helvetica,sans-serif;font-size:13px;margin-top:20px;">

        // Developer information: appId, accessToken
        $appId = "YOUR_APP_ID_HERE";
        $accessToken = "YOUR_ACCESS_TOKEN_HERE";
        $server = "https://secure.hoiio.com/open";

        if ($_SERVER['REQUEST_METHOD'] == "GET") {
            // Exit PHP and print those UI
            <h1>Hoiio Conference API</h1>
            <form id="conference" name="conference" action="conf-example.php" method="post">
                <p>Enter at least 1 destination phone number in E.164 format. Example: +6511111111</p>
                <input name="n1" type="text" /><br>
                <input name="n2" type="text" /><br>
                <input name="n3" type="text" /><br>
                <input name="n4" type="text" /><br>
                <input name="n5" type="text" /><br>
                <input name="n6" type="text" /><br>
                <input name="n7" type="text" /><br>
                <input name="n8" type="text" /><br><br>
                <input id="makeCall" type="submit" value="Make Conference Call">
            // Back to PHP

        // String the destinations together, separated by comma
        $dest = "";
        for ($i=1; $i<=8; $i++) {
            $val = $_POST['n'.$i];
            if (strlen($val) > 0)
                $dest .= $val . ',';
        if (substr($dest, -1) == ',')
            $dest = substr($dest, 0, -1);
        // Call Hoiio Conference API
        $params = array("app_id"        => $GLOBALS['appId'],
                        "access_token"  => $GLOBALS['accessToken'], 
                        "dest"          => $dest,
                        "room"          => "myroom",
                        "tag"           => "conference trial");

        $data = http_build_query($params);
        $response = do_post_request($GLOBALS['server']."/voice/conference", $data);
        $result = json_decode($response);

        if ($result->status != "success_ok")
            echo "Error: " . $result->status . "<br>";
            echo "Conference call is send out successfully<br>";
        echo '<br><a href="conf-example.php">back</a><br>';

        // This function will do the http post to the server, feel free to use different function of your desire
        function do_post_request($url, $data) {
            $params = array('http' => array(
                      'method' => 'POST',
                      'content' => $data
            $ctx = stream_context_create($params);
            $fp = @fopen($url, 'rb', false, $ctx);
            if (!$fp) {
                throw new Exception("Problem with $url, $php_errormsg");
            $response = @stream_get_contents($fp);
            if ($response === false) {
                throw new Exception("Problem reading data from $url, $php_errormsg");
            return $response;

Download the source code.