Closed CaioBianchi closed 5 years ago
@CaioBianchi
In HttpClient#47
there is a bug.
Replace this:
$options = array( 'http'=>array( 'method'=>$httpMethod, 'header'=>"content-type: application/json\r\n", 'content'=>$data, 'ignore_errors'=>true ) );
With this:
$options = array( 'http'=>array( 'method'=>$httpMethod, 'header'=>"content-type: application/json\r\n", 'ignore_errors'=>true ) ); if ($httpMethod == 'POST') { $options['http']['content'] = $data; }
Good catch, @mauriciogior Let's wait and hope that your PR gets merged. :)
Need this fix!
That fix does not work for me. I am getting the same "You passed a request body that was not in JSON format." and I made the fix. I believe I am going to have to leave the API and do a PHP Curl directly to make this publish endpoint work with this API. Obviously it works in the https://www.eventbriteapi.com/v3/ testing tool, so something is wrong in this API code. It is broken. Let me know if anybody has an answer. Of if curl works as a work around, will show it here.
I was trying $client->get_user_events('me') which resulted in the same error. The fix above didn't work. What did work was changing $data = json_encode($body); to $data = empty($body) ? '{}' : json_encode($body); in public function request($path, $body, $expand, $httpMethod = 'GET') in the HttpClient.php file.
solved #17
I am unable to pull data from https://www.eventbrite.ca/developer/v3/endpoints/users/#ebapi-get-users-id-owned-events (
GET /users/:id/owned_events/
)I currently have a method exactly like this:
But I get a 400 error:
Any ideas?