8000 Add POST media/metadata/create method · souravbadami/codebird-php@f666559 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit f666559

Browse files
committed
Add POST media/metadata/create method
1 parent 7fdac48 commit f666559

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ codebird-php - changelog
1212
- Fix Ads API batch methods to send JSON body
1313
+ Update Ads API Analytics methods (stats)
1414
+ #177 Add async media/upload calls status by GET
15+
+ Add POST media/metadata/create method
1516

1617
3.1.0 (2016-02-15)
1718
+ #143 Add support for proxy types

src/codebird.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ class Codebird
401401
'lists/subscribers/create',
402402
'lists/subscribers/destroy',
403403
'lists/update',
404+
'media/metadata/create',
404405
'media/upload',
405406
'mutes/users/create',
406407
'mutes/users/destroy',
@@ -1906,6 +1907,7 @@ protected function _fetchRemoteFile($url)
19061907
*/
19071908
protected function _detectMedia($method) {
19081909
$medias = [
1910+
'media/metadata/create',
19091911
'media/upload'
19101912
];
19111913
return in_array($method, $medias);
@@ -1926,7 +1928,8 @@ protected function _detectJsonBody($method) {
19261928
'ads/sandbox/batch/accounts/:account_id/campaigns',
19271929
'ads/sandbox/batch/accounts/:account_id/line_items',
19281930
'ads/sandbox/batch/accounts/:account_id/targeting_criteria',
1929-
'collections/entries/curate'
1931+
'collections/entries/curate',
1932+
'media/metadata/create'
19301933
];
19311934
return in_array($method, $json_bodies);
19321935
}

test/detection_tests.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,11 @@ public function testGetEndpoint()
252252
$cb->call('_getEndpoint', ['media/upload', 'media/upload']),
253253
'media/upload'
254254
);
255+
$this->assertEquals(
256+
'https://upload.twitter.com/1.1/media/metadata/create.json',
257+
$cb->call('_getEndpoint', ['media/metadata/create', 'media/metadata/create']),
258+
'media/metadata/create'
259+
);
255260
$this->assertEquals(
256261
'https://publish.twitter.com/oembed',
257262
$cb->call('_getEndpoint', ['statuses/oembed', 'statuses/oembed']),

0 commit comments

Comments
 (0)
0