a-digital / eventbrite

Craft 3 plugin to interface with Eventbrite data through its API.
Other
2 stars 2 forks source link

Error 403 retrieving data from Eventbrite #7

Closed RyanRoberts closed 4 years ago

RyanRoberts commented 4 years ago

I'm having trouble pulling in events from my client's organisation. I get the following error message:

Error 403 retrieving data from Eventbrite: You do not have permission to access the resource you requested.

That's when I use the following for all events:

{% set events = craft.eventbrite.allEvents(null, true, "current_future", true) %}

I can get it to work for individual events with the event ID, and I can get it working with the Other Events options, but for some reason I just can't get allEvents to work.

I've setup API access (otherwise the other methods wouldn't work either) and it appears to be correct.

Do you have any pointers to get me on the right path or maybe I can provide some more info that would help?

RyanRoberts commented 4 years ago

I should maybe add I'm not familiar with EventBrite itself so I guess it's possible something over there isn't set right, but then again I can get events by requesting them by their ID.

mark-adigital commented 4 years ago

Yes - so I think I had this issue a couple of weeks ago and it's due to some poor documentation from EventBrite meaning the Organisation ID probably isn't what you think it should be, I was unable to find any info pointing to the right place to get this information (it makes it more confusing that it's not the organiser ID you can access through your profile, which I mistakenly believed was the case for a while). The only way I was able to get the correct one in my case was to use their console to use a method which will return the organisation ID associated with your API token.

RyanRoberts commented 4 years ago

Excellent, thanks! Got it working now, EventBrite don't make this straightforward :/

mark-adigital commented 4 years ago

No worries, glad it's sorted.

Yeah, it's really confusing. I should maybe add some facility to the plugin to call that API method and return the organisations associated with the auth token once it's been entered, which also means the organisation ID should be optional, but that seems a bit silly when the plugin is largely useless without one - and it makes setting up the plugin a two-step process for the sake of adding just two values. It wouldn't be so bad if you could at least access your API organisation IDs from somewhere in Eventbrite. Maybe a note in the Readme, at least.

gracehcoote commented 11 months ago

Can anyone elaborate on how to use the console to retrieve the organisation ID? I have been trying and not having any success at all!

aarmitage commented 11 months ago

Hi @gracehcoote. If you follow the link to https://www.eventbrite.co.uk/platform/api?internal_ref=login#/reference/organization/list-your-organizations/list-your-organizations?console=1 you can test the API connection as shown on the screenshots below.

  1. Follow the link to the console
  2. Make sure the console is panel is open on the right hand side
  3. Click on the Headers tab next to the selected URI parameters
  4. The authorisation header should be in place with a placeholder that shows Bearer PERSONAL_OAUTH_TOKEN
  5. Replace the text. PERSONAL_OAUTH_TOKEN with the Private Token from your API keys section in your Eventbrite account. You need to keep the word Bearer in the header request.
  6. Call the resource from the production service
  7. Scroll down to see the response and find the ID you need
Eventbrite Console Usage Eventbrite Console Response
gracehcoote commented 11 months ago

Thank you so much @aarmitage that is extremely helpful, I was able to get the ID finally. Thanks again!