Git Product home page Git Product logo

eventbrite-api-v3's Introduction

eventbrite-api

Build Status

Eventbrite API client

Integrate with Eventbrite API

Installation

Add this line to your application's Gemfile:

gem 'eventbrite-api-v3'

And then execute:

bundle

Or install it yourself as:

gem install eventbrite-api-v3

Note: In versions prior to 0.0.5, the gem was called eventbrite-api

Usage

OAuth Authentication

If you've already got an OAuth access token, feel free to skip to API Client Setup.

The Eventbrite API uses 3 legged OAuth2. You need to implement the following controller methods and store the access_token if needed.

    class EventbriteSessionController
      def new
        redirect_to eventbrite_client.get_access_code_url
      end

      def create
        @token = eventbrite_client.get_access_token(params[:code])
      end

      def eventbrite_client
        @api_client = Eventbrite::Api::Client.new({
          consumer: {
            key:    YOUR_CONSUMER_KEY,
            secret: YOUR_CONSUMER_SECRET,
          },
          redirect_uri: callback_create_url
        })
      end
    end

API Client Setup

Create an api_client

    api_client = Eventbrite::Api::Client.new({
      consumer: {
        key:    YOUR_CONSUMER_KEY,
        secret: YOUR_CONSUMER_SECRET,
      },
      access_token: YOUR_OAUTH_ACCESS_TOKEN
    })

API Methods

get

Retrieves the first page of specified collection

  categories = api_client.category.get

next_page / previous_page

Retrieves the next/previous page of specified collection. A call to get must have been performed first

  categories = api_client.category.get
  next_categories = api_client.category.next_page
  previous_categories = api_client.category.previous_page

find

Retrieves a single element by uid

  event = api_client.event.find('123')

create

Creates a resource

  event = api_client.event.create({'name' => 'My Event', ...})

update

Updates a resource

  event = api_client.event.update('123', {'name' => 'My Event', ...})

all

Fetches the entire collection of elements

  categories = api_client.category.all_items

API Resources

Events

Search events

  events = api_client.event.search
  more_events = api_client.event.next_page

  filtered_events = api_client.event.search({params: {q: 'sandwich'}})

Create event

  event = api_client.event.create({'name' => 'My Event', ...})

Publish/Unpublish events

  response = api_client.event.publish('13270934723')
  response = api_client.event.unpublish('13270934723')

Event ticket class

Create an event ticket class for event '123'

  event = api_client.event_ticket_class.create({'name' => 'My Ticket', ...}, {event_id: '123'})

Update event ticket class '456' for event '123'

  event = api_client.event_ticket_class.update('456', {'name' => 'My Ticket', ...}, {event_id: '123'})

Owned Events

User owned events

  events = api_client.owned_event.get({'user_id'=>'133925426255'})

Owned Event Attendees

User owned event attendees

  event_attendees = api_client.owned_event_attendee.get({'user_id'=>'133925426255'})

Owned Event Orders

User owned event orders

  event_orders = api_client.owned_event_order.get({'user_id'=>'133925426255'})

Categories

  categories = api_client.category.get

Formats

  formats = api_client.format.get

eventbrite-api-v3's People

Contributors

brunochauvet avatar bvsatyaram avatar ranjan-purbey avatar

Watchers

 avatar James Cloos avatar

Forkers

ranjan-purbey

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.