This repository has been archived by the owner on Jul 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Api Guide
mockra edited this page Jun 15, 2012
·
1 revision
Authorization for the Tangela API is handled through OAuth. Currently the project, note, and resource models are available.
To get started using the Tangela API, you'll need to register a user account. You can do this here.
Once you've registered, you can create your application here.
After you've registered your application, you'll get the application_id and secret_key you need.
gem install oauth2
require 'oauth2'
# Initialize your client
client = OAuth2::Client.new(your_application_id, your_application_secret, site: 'http://tangela.info')
# Get the authorization code
code = client.auth_code.authorize_url(redirect_uri: your_redirect_uri)
# Get an access token
token = client.auth_code.get_token(code, redirect_uri: your_redirect_uri)
You can then access the API information with the following commands:
token.get('/api/v1/projects.json').parsed
/api/v1/projects.json
Returns all of the user's projects
/api/v1/projects/1.json
Returns a specific project