Skip to content

Instantly share code, notes, and snippets.

@pburkholder
Created October 30, 2012 18:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pburkholder/3982113 to your computer and use it in GitHub Desktop.
Save pburkholder/3982113 to your computer and use it in GitHub Desktop.
Stashboard API POST example
#!/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