Vista
campaign/geo
Parâmetros:
Exemplo de chamada de método:
<?php $post = array( 'token' => $token, 'id' => 999999 ); if( $curl = curl_init() ) { curl_setopt($curl, CURLOPT_URL, 'https://www.ipweb.ru/api/v2/campaign/geo'); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $post); $out = curl_exec($curl); echo $out; curl_close($curl); } // Resultado: { "countries": { "geo_ru": { "name": "Rússia", // nome da região "checked": true, // selecionado ou não "count": 84836 // número estimado de visitas por dia }, "geo_ua": { "name": "Ucrânia", "checked": false, "count": 22551 }, ... }, "ru_regions": { "region_105": { "name": "Moscou", "checked": true, "count": 17419 }, "region_106": { "name": "São Petersburgo", "checked": true, "count": 5551 }, ... }, "ua_regions": { "region_10": { "name": "Kyiv", "checked": false, "count": 9226 }, "region_21": { "name": "Região de Donetsk", "checked": false, "count": 3692 }, ... }, "error_code": 0 }
Configuração de regiões
campaign/geo_set_by_names
Parâmetros:
Параметр regions can also contain the code or names of the macroregion:
Exemplo de chamada de método:
<?php $post = array( 'token' => $token, 'id' => 999999, 'regions' => 'Moscou, São Petersburgo, Yaroslavl, Sverdlovsk' ); if( $curl = curl_init() ) { curl_setopt($curl, CURLOPT_URL, 'https://www.ipweb.ru/api/v2/campaign/geo_set_by_names'); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $post); $out = curl_exec($curl); echo $out; curl_close($curl); } // Resultado: { "status": "ok", "error_code": 0 } $post = array( 'token' => $token, 'id' => 999999, 'regions' => 'portuguese_language,English language' ); if ($curl = curl_init()) { curl_setopt($curl, CURLOPT_URL, 'https://www.ipweb.ru/api/v2/campaign/geo_set_by_names'); curl_setopt($curl, CURLOPT_RETURNTRANSFER,true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $post); $out = curl_exec($curl); echo $out; curl_close($curl); } // Результат: { "status": "ok", "error_code": 0 }