Developers
Our platform was built to be flexible and intuitive for developers like you. You own all the data you collect with Tradable Bits. Our API and SDK are designed to make it easy to access your fan data, tickets and campaigns at any time, on your terms Customize the front end of any of your campaigns with the help of our documentation, complete with examples. Our RESTful API helps you access, send or receive fan data from our system to your endpoints quickly and securely. Enrich your Fan CRM and Tickets Analytics with data from other CRM systems through our many integrations. Have any questions about our developers platform? Our support team is happy to help.
Website Integration Example

Integration with Websites for Festivals

Tradable Bits Platform consumes fan data from various sources and Festival Website is very important source to be ignored. Social Login, Schedule, and ability to create personal schedule are highly expected and used features, so our API allows fully integrate and build entire user experience without having to resort to building full development Environment.


Terms and Values we will reference in the example
https://www.festival.com Link to your Festival Website
https://www.festival.com/auth_callback Authentication Callback, which will handle authentication
Python Server Side language used in the example. Obviously, you're not restricted to stay with python
email Login Network Used in the example.
api_secret API Secret will be required to map back "code" from callback to session_uid, which can be used in the API
api_key As per our reference, api_key is used for call with RESTful API together with session_uid

Login Integration

There is more than one way to integrate authentication into website. In this example we will utilize OAUTH mechanism. Javascript SDK is also available and can be used if desired.

First, you need to add links with social auth on your website:

<a href="https://tradablebits.com/crm/oauth?account_id=xxxx&business_id=xxxx&login_type=email&redirect_url=https://wwww.festival.com/auth_callback"> Connect with Email </a>
        
        
On your Auth Call back Code, redirect will include code

def process_response():
    code = request.args.get('code')
    error = request.args.get('error')
    if error is not None:
        handle_error(error)
    elif code is not None:
        code = request.args.get('code')
        api_key = "12345"
        account_id = "12345"
        redirect_url = "http://www.festival.com/auth_callback"
        parms = {"code":code,"api_key":api_key,"account_id":account_id,"redirect_url":redirect_url}
        token_url = "https://tradablebits.com/crm/access_token?%s" % urllib.urlencode(parms)
        with contextlib.closing(urllib2.urlopen(token_url, timeout=10)) as r:
            res = r.read()
            session = json.loads(res)
        session_uid = session['session_uid']
        fan_id = session['fan_id']
        handle_session(session_uid,fan_id)

        
        
With Valid session_uid, you can start querying API for the list of artists in the line up and optionally their schedules
Idols and Line up
Existing Artists for the line up can be retrieved with public key
url = "https://tradablebits.com/api/v1/idols?api_key=xxxxx&label_name=myfest2019"
        
Existing Events for the festival
url = "https://tradablebits.com/api/v1/idols/events?api_key=xxxxx&label_name=myfest2019"
        
Fetching list of liked idols
url = "https://tradablebits.com/api/v1/sessions/" + session_uid + "/idols?api_key=xxxxx&label_name=myfest2019"
        
Adding Idol into "liked"

url = "https://tradablebits.com/api/v1/sessions/" + session_uid + "/idols?api_key=xxxxx"
args = {"action":"add","idol_uid": "xxxx"}
requests.post(url,args)