Vista
campaign/geo
Parámetros:
Ejemplo de llamada a un 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": "Rusia", // nombre de la región "checked": true, // seleccionado o no "count": 84836 // número estimado de visitas por día }, "geo_ua": { "name": "Ucrania", "checked": false, "count": 22551 }, ... }, "ru_regions": { "region_105": { "name": "Moscú", "checked": true, "count": 17419 }, "region_106": { "name": "San Petersburgo", "checked": true, "count": 5551 }, ... }, "ua_regions": { "region_10": { "name": "Kyiv", "checked": false, "count": 9226 }, "region_21": { "name": "Región de Donetsk", "checked": false, "count": 3692 }, ... }, "error_code": 0 }
Configuración de regiones
campaign/geo_set_by_names
Parámetros:
Параметр regions can also contain the code or names of the macroregion:
Ejemplo de llamada a un método:
<?php $post = array( 'token' => $token, 'id' => 999999, 'regions' => 'Moscú, San 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 }