Skip to content

Latest commit

 

History

History
273 lines (190 loc) · 7.04 KB

README.md

File metadata and controls

273 lines (190 loc) · 7.04 KB

Eventbrite

Eventbrite rubygem for API v3.

Installation

Add this line to your application's Gemfile:

gem 'eventbrite'

And then execute:

$ bundle

Or install it yourself as:

$ gem install eventbrite

Usage

Access Token

Each method requires you have to a valid access_token that you obtain via Eventbrite OAuth 2.0 protocol.

There are two ways to use your access_token with this gem.

# This token will be used globally each time you used the gem API.
Eventbrite.token = `your_access_token`
Eventbrite::Event.search({q: 'Dogecoin'})

# This is to specific the token you want to use for each API call.
Eventbrite::Event.search({q: 'Dogecoin'}, 'your_access_token')

Pagination

Please not that not all APIs have pagination.

events = Eventbrite::Event.search({q: 'Dogecoin'})
events.paginated? # => true

# Get all events
all_events = events.events
while events.next?
  events = Eventbrite::Event.search({q: 'Dogecoin', page: events.next_page})
  all_events.concat(events.events)
end
# For supported parameters, check out the link above.
Eventbrite::Event.search({q: 'Dogecoin'})
Eventbrite::Category.all
Eventbrite::Subcategory.all
Eventbrite::Format.all
Eventbrite::Event.retrieve('event_id')
# For supported parameters, check out the link above.
# Also, the parameter `event_id` is required.
Eventbrite::Attendee.all({ event_id: 'event_id' })
Eventbrite::Attendee.retrieve('event_id', 'attendee_id')
# For supported parameters, check out the link above.
# Also, the parameter `event_id` is required.
Eventbrite::Order.all({ event_id: 'event_id' })
# For supported parameters, check out the link above.
# Also, the parameter `event_id` is required.
Eventbrite::Discount.all({ event_id: 'event_id' })
# For supported parameters, check out the link above.
# Also, the parameter `event_id` is required.
Eventbrite::AccessCode.all({ event_id: 'event_id' })
# The parameter `event_id` is required.
Eventbrite::TicketClass.all({ event_id: 'event_id' })
# The parameter `event_id` is required.
Eventbrite::Transfer.all({ event_id: 'event_id' })
# The parameter `event_id` is required.
Eventbrite::Team.all({ event_id: 'event_id' })
Eventbrite::Team.retrieve('event_id', 'team_id')
Eventbrite::Team.attendees('event_id', 'team_id')
Eventbrite::User.retrieve('user_id')
# The parameter `user_id` is required.
Eventbrite::User.orders({ user_id: 'user_id' })
# For supported parameters, check out the link above.
# Also, the parameter `user_id` is required.
Eventbrite::User.owned_events({ user_id: 'user_id' })
# For supported parameters, check out the link above.
# Also, the parameter `user_id` is required.
Eventbrite::User.owned_event_orders({ user_id: 'user_id' })
# For supported parameters, check out the link above.
# Also, the parameter `user_id` is required.
Eventbrite::User.owned_event_attendees({ user_id: 'user_id' })
# Retrieve a User’s Venues
# The parameter `user_id` is required.
Eventbrite::User.venues({ user_id: 'user_id' })
# Retrieve a Venue
Eventbrite::Venue.retrieve('venue_id')
# The parameter `user_id` is required.
Eventbrite::User.organizers({ user_id: 'user_id' })
Eventbrite::Order.retrieve('order_id')
# For supported parameters, check out the link above.
# Also, the parameter `user_id` is required.
Eventbrite::ContactList.all({ user_id: 'user_id' })
Eventbrite::ContactList.retrieve('user_id', 'contact_list_id')
# Retrieve a Webhook.
Eventbrite::Webhook.retrieve('webhook_id')

# Create a Webhook.
# See above link for supported parameters.
Eventbrite::Webhook.create({endpoint_url: 'your_webhooks_endpoint_url'})

# Delete a Webhook.
Eventbrite::Webhook.delete('webhook_id')
# For supported expansions, check out the link above.
# Required parameters dependent on method called, refer to methods covered above for required parameters

# Retrieve venue information with events
Eventbrite::User.owned_events({ user_id: 'user_id', expand: 'venue' })

# Retrieve organizer and venue information with events
Eventbrite::User.owned_events({ user_id: 'user_id', expand: 'organizer,venue' })

Todo

  • Event Attendees' Details API should support parameters
  • POST/UPDATE/DELETE request for the API
  • Support for chained method

Thanks

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request