@@ -430,6 +430,7 @@ class Codebird
430
430
'statuses/update_with_media ' , // deprecated, use media/upload
431
431
'ton/bucket/:bucket ' ,
432
432
'ton/bucket/:bucket?resumable=true ' ,
433
+ 'tweets/search/30day/:env ' ,
433
434
'users/lookup ' ,
434
435
'users/report_spam '
435
436
],
@@ -1930,11 +1931,11 @@ protected function _detectMedia($method) {
1930
1931
/**
1931
1932
* Detects if API call should use JSON body
1932
1933
*
1933
- * @param string $method The API method to call
1934
+ * @param string $method_template The API method to call
1934
1935
*
1935
1936
* @return bool Whether the method is defined as accepting JSON body
1936
1937
*/
1937
- protected function _detectJsonBody ($ method ) {
1938
+ protected function _detectJsonBody ($ method_template ) {
1938
1939
$ json_bodies = [
1939
1940
'ads/batch/accounts/:account_id/campaigns ' ,
1940
1941
'ads/batch/accounts/:account_id/line_items ' ,
@@ -1943,9 +1944,10 @@ protected function _detectJsonBody($method) {
1943
1944
'ads/sandbox/batch/accounts/:account_id/line_items ' ,
1944
1945
'ads/sandbox/batch/accounts/:account_id/targeting_criteria ' ,
1945
1946
'collections/entries/curate ' ,
1946
- 'media/metadata/create '
1947
+ 'media/metadata/create ' ,
1948
+ 'tweets/search/30day/:env '
1947
1949
];
1948
- return in_array ($ method , $ json_bodies );
1950
+ return in_array ($ method_template , $ json_bodies );
1949
1951
}
1950
1952
1951
1953
/**
@@ -2224,7 +2226,7 @@ protected function _callApiPreparationsPost(
2224
2226
$ multipart_boundary = substr ($ params , 2 , $ first_newline - 2 );
2225
2227
$ request_headers [] = 'Content-Type: multipart/form-data; boundary= '
2226
2228
. $ multipart_boundary ;
2227
- } elseif ($ this ->_detectJsonBody ($ method )) {
2229
+ } elseif ($ this ->_detectJsonBody ($ method_template )) {
2228
2230
$ authorization = $ this ->_sign ($ httpmethod , $ url , []);
2229
2231
$ params = json_encode ($ params );
2230
2232
$ request_headers [] = 'Content-Type: application/json ' ;
0 commit comments