function main()
{
    $api = new SipuniApi(SIPUNI_API_KEY);
    try {
        $url = $api->getStatisticsUrl('74996476965');
        print "Statistics url: {$url}\n";
    } catch (\Exception $e) {
        print $e;
    }
}
function main()
{
    $api = new SipuniApi(SIPUNI_API_KEY);
    try {
        // даты в формате unix timestamp
        $hits = $api->getStatisticsHits('140', 1441111200, 1441411200);
        print_r($hits);
    } catch (\Exception $e) {
        print $e;
    }
}
Esempio n. 3
0
function main()
{
    $api = new SipuniApi(SIPUNI_API_KEY);
    try {
        print "\nSettings preferences\n";
        $r = $api->setPreferences(array('calltracking_webhook' => 'http://abc.com/webhook.php'));
        print_r($r);
        print "\nGetting preferences\n";
        $r = $api->getPreferences();
        print_r($r);
    } catch (\Exception $e) {
        print $e;
    }
}
Esempio n. 4
0
function main()
{
    $api = new SipuniApi(SIPUNI_API_KEY);
    try {
        // Получить диапазон номеров "Москва 499"
        $range = $api->findRange('499');
        print "Found range: {$range->title}\n";
        // Выделить статический номер и создать для него перенаправление на номер +749912312312
        $number = $api->allocateStatic($range->id, '+749912312312', 'For newspapers');
        print "Allocated number: {$number}\n";
    } catch (\Exception $e) {
        print $e;
    }
}