I use the method to edit ads .
In response, I get this error:
["error_code"]=>100 ["error_msg"]=>"One of the parameters specified was missing or invalid: data[data][ad_id] is invalid" The data array itself:
string(185) "{"data":{"0":{"ad_id":"15142751","cpc":4.4},"1":{"ad_id":"15142643","cpc":4.4},"2":{"ad_id":"15210287","cpc":4.4},"3":{"ad_id":"15210280","cpc":4.4},"4":{"ad_id":"15210269","cpc":4.4}}}" ID ads are correct, most likely I am forming an array of objects.
$data = json_encode(array('data' => $data), JSON_FORCE_OBJECT); Full answer with error:
array(1) { ["error"]=> array(3) { ["error_code"]=> int(100) ["error_msg"]=> string(84) "One of the parameters specified was missing or invalid: data[data][ad_id] is invalid" ["request_params"]=> array(5) { [0]=> array(2) { ["key"]=> string(5) "oauth" ["value"]=> string(1) "1" } [1]=> array(2) { ["key"]=> string(6) "method" ["value"]=> string(13) "ads.updateAds" } [2]=> array(2) { ["key"]=> string(10) "account_id" ["value"]=> string(10) "xxxxxxxxxx" } [3]=> array(2) { ["key"]=> string(4) "data" ["value"]=> string(151) "{"data":[{"ad_id":22981362,"cpc":4.4},{"ad_id":22975854,"cpc":4.4},{"ad_id":22721708,"cpc":4.4},{"ad_id":26690417,"cpc":0},{"ad_id":22690359,"cpc":0}]}" } [4]=> array(2) { ["key"]=> string(1) "v" ["value"]=> string(4) "5.62" } } } }