Basic Workflow


The following code examples are in Ruby.

Step 1 - Set up a client oauth library

< your consumer key > and < your consumer secret > can be found at

@client ||=< your consumer key >,< your consumer secret >,
                               :site => '',
                               :parse_json => true

Step 2 - Authorize your application to access resources of your Bime account

Get the URL to authorize your app

auth_url = @client.auth_code.authorize_url(:redirect_uri => "http://yourapplication/redirect_url")

Redirect browser to the authorization page

redirect_to auth_url

On a classic workflow, after authorizing the application, you will be redirected to your application with an authorization code (in params[:code])

Step 3 - Code behind http://yourapplication/redirect_url

  # Exchange the authorization code with an access token (used in future calls to access resources)
  @access_token = @client.auth_code.get_token(params[:code], :redirect_uri => "http://yourapplication/redirect_url")
  # Setup the API endpoint = ""

Step 4 - Make an API call

resp = @access_token.get "/v3/dashboards/" + dashboard_id
dashboard = JSON.parse(resp.body)["result"]
Have more questions? Submit a request


Please sign in to leave a comment.
Powered by Zendesk