Created
October 30, 2012 18:34
-
-
Save pburkholder/3982113 to your computer and use it in GitHub Desktop.
Stashboard API POST example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/ruby | |
# | |
require 'rubygems' | |
require 'oauth' | |
require 'json' | |
oauth_key = '1/xxxxxxxxxxxx' | |
oauth_secret = 'yyyyyyyyyy' | |
# Fill in your website | |
base = "https://workstatus2.appspot.com" | |
@consumer=OAuth::Consumer.new "work.com", | |
'zzzzzzzzzzzzzzzzz', | |
{:site=>base} | |
@token = OAuth::AccessToken.new(@consumer, oauth_key, oauth_secret) | |
@response = @token.post("/api/v1/services", { | |
:name => "An Example Service", | |
:description => "An example service, created using the StashBoard API", | |
}) | |
srvice = JSON.parse(@response.body) | |
puts srvice |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment