No matter what I do I can't seem to get s3 to accept my multipart upload. I don't know what the structure is supposed to be and the EB documentation isn't much help and it's getting extremely frustrating.
Anyway, using the returned upload data as query parameters in a multipart request results in s3 complaining that 'key' doesn't exist. Changing 'key' to 'Key' makes this error go away (helpful that the error message is in lower case), however I then get that I'm getting conflicting query parameters, acl and policy. Unfortunately there is zero documentation on this error message - only some people suggesting that I put an enctype in the form.
I'm not using a form, however I have added the Content-Type of the file to the multipart array, and Guzzle automatically adds the multipart/form-encoded header to the request. However this has made no difference. I simply can't figure out how to structure the parameters for this request. I've tried every possible way - and now I have no idea if this is a problem with the s3 signed object I'm getting back or my code.
For more information this stack over flow question has some of the things I have tried.
https://stackoverflow.com/questions/47644875/struggling-with-s3-multipart-upload-guzzle-for-eventbrite
There is an existing question that gives a pretty specific curl example, but I can't get that working and don't get any errors at all from curl, so I'm not using it .
Unfortunately the upload to S3 isn't the only problem I'm having with the API. I've been using a curl request to push the image to s3, but I don't get an error from Curl, I get nothing back so I have no idea if it worked, I will try your method tho I'm interested in why a guzzle multipart request can't achieve the same thing.
However when I then make a POST request to the media/upload endpoint with the upload_token I get the errors "Unknown parameter 'upload_token', 'type' parameter required"
I'm starting to think there is actually something wrong with the eventbrite API. As making a post request to /events/:id/publish results in
Client error: `POST https://www.eventbriteapi.com/v3/events/41196054508/publish` resulted in a `405 METHOD NOT ALLOWED` response:
{"status_code": 405, "error_description": "That HTTP method is not valid on this endpoint.", "error": "METHOD_NOT_ALLOWE (truncated...).
The response from /media/upload to a POST request also seems to suggest it thinks it is receiving a GET request (hence asking for type)
I also cannot update an event, it just retrieves the event from the ID and ignores the updated parameters, the response you would expect from a GET request. It creates a new event just fine, when sending a POST to /events, so it must be working in SOME way. It is confusing that there would be some difference between POST /events and POST /events/:id
I am 100% sending a POST request through guzzle, if I xdebug the request object the method is POST. The error message also tells me it's POST. If I send it through POSTMAN I still get the same error. I've tried json_encoding the params into the body, and sending as form_params, and sending as multipart, but the response from the API is inconsistent with what I would expect, the most telling being the 405 error for publish.
So, the issue turned out to be omitting trailing slashes. This is something I think Eventbrite should change imo, as recommended in rule No.1 here.