Coder Social home page Coder Social logo

eventbrite.jquery.js's Introduction

An Eventbrite API client library. (requires jQuery)


written by @ryanj, with ISO 8601 date support provided by Colin Snover

Usage Examples

The following parameters can be used to initialize the Eventbrite API client:

  • app_key: (REQUIRED) Eventbrite users can request an API key on the following page: http://www.eventbrite.com/api/key/
  • user_key: (OPTIONAL) Omitting this parameter will limit access to public data. Providing a user_key is only needed when updating/accessing private information. Each user can find their user_key on this page: http://www.eventbrite.com/userkeyapi
  • access_token: (OPTIONAL) If you are using OAuth2 with Eventbrite, you can also initialize our API client by supplying a user's access_token (instead of supplying an api_key and user_key). For more information on how to get started with OAuth2, see our OAUTH2-README.
  • callback: for interacting with the API

Initialize the client:

Eventbrite({'app_key': "YOUR_API_KEY", 'user_key':"YOUR_USER_KEY"}, function(eb_client){ //eb_client interaction goes here... });

OR, if when using an OAuth2 access_token:

Eventbrite({'access_token': "USER_ACCESS_TOKEN"}, function(eb_client){ //eb_client interaction goes here... });

Within the callback, the client can be used to call any of the methods described in the Eventbrite API Docs:

// parameters to pass to the API
var params = {'city': "San Francisco", 'region':'CA'};
// make a client request, provide another callback to handle the response data
eb_client.event_search( params, function( response ){
    console.log( response );
});
eb_client.event_get( {'id': 123456789 }, function( response ){
    // render the event as a ticket widget:
    var ticket_widget_html = eb_client.widget.ticket( response.event ); 

    // or, render it as a countdown widget:
    var countdown_widget_html = eb_client.widget.countdown( response.event ); 

    console.log( countdown_widget_html + ticket_widget_html );
});
eb_client.event_list_attendees ( {'id': 123456789 }, function( response ){
    console.log(response);
});
eb_client.user_list_events ( {}, function( response ){
    $( '#target' ).html( eb_client.utils.eventList( response, eb_client.utils.eventListRow ));
});

WARNING: user_keys provide privileged access to a user's private data. Keep it secret. Keep it safe.

Eventbrite does not recommend storing authentication tokens in client side source.

See the included example.html file for a more detailed implementation example.

Resources

eventbrite.jquery.js's People

Contributors

ryanj avatar

Stargazers

Leo Yuanjie Li avatar Cameron Kalegi avatar Douglas Cabral avatar James #FFFFFF avatar Ronan Guilloux avatar Frederic D. avatar  avatar Alco avatar anton avatar Scott Gowell avatar Michael Elias avatar Cameron Hendrix avatar Chris Kobayashi avatar

Watchers

ryan jarvinen avatar  avatar James Cloos avatar Frederic D. avatar Leo Yuanjie Li avatar

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.