8000 Fix Ads API batch methods to send JSON body · dreamenemy/codebird-php@f17ce4b · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit f17ce4b

Browse files
committed
Fix Ads API batch methods to send JSON body
1 parent 9deb1f6 commit f17ce4b

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ codebird-php - changelog
88
+ Add Ads Sandbox API POST accounts method
99
+ Add Ads Sandbox API POST accounts/:account_id/features method
1010
+ Add Ads Sandbox API POST accounts/:account_id/funding_instruments method
11+
+ Update more Ads API methods
12+
- Fix Ads API batch methods to send JSON body
1113

1214
3.1.0 (2016-02-15)
1315
+ #143 Add support for proxy types

src/codebird.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,6 +1928,12 @@ protected function _detectMedia($method) {
19281928
*/
19291929
protected function _detectJsonBody($method) {
19301930
$json_bodies = [
1931+
'ads/batch/accounts/:account_id/campaigns',
1932+
'ads/batch/accounts/:account_id/line_items',
1933+
'ads/batch/accounts/:account_id/targeting_criteria',
1934+
'ads/sandbox/batch/accounts/:account_id/campaigns',
1935+
'ads/sandbox/batch/accounts/:account_id/line_items',
1936+
'ads/sandbox/batch/accounts/:account_id/targeting_criteria',
19311937
'collections/entries/curate'
19321938
];
19331939
return in_array($method, $json_bodies);

test/detection_tests.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ public function testDetectJsonBody()
189189
$cb = $this->getCB();
190190
$this->assertFalse($cb->call('_detectJsonBody', ['statuses/update']));
191191
$this->assertTrue($cb->call('_detectJsonBody', ['collections/entries/curate']));
192+
$this->assertTrue($cb->call('_detectJsonBody', ['ads/batch/accounts/:account_id/targeting_criteria']));
192193
}
193194

194195
/**

0 commit comments

Comments
 (0)
0