Skip to content

Instantly share code, notes, and snippets.

@brianly
Created June 3, 2013 15:06
Show Gist options
  • Save brianly/5698847 to your computer and use it in GitHub Desktop.
Save brianly/5698847 to your computer and use it in GitHub Desktop.
Code interpreted in my head for executing a PUT request to a Yammer user profile.
require 'net/http'
port = 443
host = "www.yammer.com"
path = "/api/v1/users/[:id].json"
req = Net::HTTP::Put.new(path, initheader = { 'Authorization' => 'Bearer YOUR_ACCESS_TOKEN'})
req.body = "work_telephone=01189998819991197253&work_extension=12345"
response = Net::HTTP.new(host, port).start {|http| http.request(req) }
puts response.code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment