yammer / yam Goto Github PK
View Code? Open in Web Editor NEWThe official Yammer Ruby gem..
Home Page: http://yammer.github.io/yam/
License: Other
The official Yammer Ruby gem..
Home Page: http://yammer.github.io/yam/
License: Other
Yammer::ApiResponse#success?
is not consistent when reporting on the success of the request. Consider the following:
client = Yammer::Client.new(access_token: access_token) # => #<Yammer::Client:0x007f968faecd10 ...>
current_user = client.current_user # => #<Yammer::ApiResponse:0x007f968fc371e8 @body="...", @code=200, ...>
current_user.class # => Yammer::ApiResponse
current_user.code # => 200
current_user.success? # => true
activity_response = client.create_activity(activity) # => #<Yammer::ApiResponse:0x007f968ff41460 @body="...", @code=202, ...>
activity_response.class # => Yammer::ApiResponse
activity_response.code # => 202
activity_response.success? # => false
I would expect that any response in the 2xx range would report success?
as true
Its our understanding the yam gem should raise an Unauthorized exception when a request is made that is, um, unauthorized.
However, we've noticed recently that unauthorized requests are just return the string "Authenticated Failure" which is wrong because a) its not valid json b) it should be raising an exception.
Looking through the codebase, it looks like the only reference to Unauthorized is in error.rb#from_status method which I don't see being called from anywhere.
What is the proper way to handle unauthorized requests?
https://developer.yammer.com/v1.0/page/support#server-side
Hey i found this bronken link on this page
http://www.rubydoc.info/github/yammer/yam/Yammer/OAuth2Client
I'm trying to remove topic and tags from a thread, but not success yet :(
I'm using the same endpoint used in yammer.com
https://www.yammer.com/api/v1/threads/:threadid/remove_topic
The formdata contains topic_id and access_token
The Header contains Authorization: Barer :Token
I'm sending a POST request.
is there any example how to do it?
Thanks!
Currently if I do something like this for a thread that has been deleted from Yammer
deleted_thread_id = 12345
yamr = Yammer::Client.new(:access_token => '123abc')
resp = yamr.get_thread(deleted_thread_id)
resp
will be " "
(String with a single space). I understand that you don't wan't to handle every kind of exception that can happen, but I think at least 404 should be handled better than that.
Jruby won't install via ruby gems because of the specified oj dependency in the gemspec.(oj no longer supports jruby)
since we're using multi_json, why the hard dependency?
In this revision: db251f5#diff-011a232c794000b1bbf23ed773c9d5c0 a dependency on oauth2-client is added.
This causes this line to fail due to use of the older OAuth2::Client api: https://github.com/intridea/omniauth-oauth2/blob/master/lib/omniauth/strategies/oauth2.rb#L49
The new code for OAuth2::Client should go from/to:
# old code
redirect client.auth_code.authorize_url({:redirect_uri => callback_url}.merge(authorize_params))
# new code
redirect client.authorization_code.authorization_url({:redirect_uri => callback_url}.merge(authorize_params))
The yam gem is dependent on too new of a version of the OAuth2::Client code.
As well, adding gem dependencies doesn't seem like a patch level change, so this breaks semantic versioning. When I lock the version directly to 2.0.1(not ~> 2.0), I avoid this issue.
We're using Ruby 2.0.0 in sched.do. We should test the Yam gem against Ruby 2.0.0 as well. (update .travis.yml)
HTTP Method: POST
URL: https://www.yammer.com/api/v1/activity.json
I've been attempting to upload a message with a pending attachment but it doesnt work. I've followed the documentation exactly. I've also attached some sample code that i use, in case theres an error that i've missed.
Everything seems to be created successfully but attachments are mysteriously absent. Advice/help would be appreciated.
require 'yammer'
Yammer.configure do |c|
c.access_token = 'sometoken'
end
file = File.open('test.txt', 'r')
returnedobj = Yammer.create_pending_attachment(file).body
idobj = returnedobj[:id]
idobjarr = []
idobjarr << idobj
file = File.open('test2.txt', 'r')
returnedobj = Yammer.create_pending_attachment(file).body
idobj = returnedobj[:id]
idobjarr << idobj
optobj = {:group_id => xxxxxxx , :pending_attachment_ids => idobjarr}
tmpobj = Yammer.create_message('building a yammer client', optobj)
The gem dependencies are conflicting with my own app, specifically multi_json and faraday.
Could you please push the gem dependency versions to as up to date as possible so they can merge with mine, :)?
By the documentation, it appears only one Yammer account can be used at a time:
Yam.configure do |config|
config.oauth_token = oauth_token
end
Is it possible, or would it be possible to add, the ability to use multiple Yammer accounts at a time? Something more like this:
yam1 = Yam.new oauth_token: oauth_token1
yam2 = Yam.new oauth_token: oauth_token2
Thanks! Matt
I have generated an Yammer API key(client id and client secret) within a network and the API key is working across this network (same account). But when I try to use the same API key to access data from a different account it shows an error.
'Your network is not allowed to request an OAuth token for this Application'
Anyway to resolve this?
Currently post-install, the gem gives an invalid gemspec
warning.
Should be replaced with a fun message.
Running the following:
require 'yam'
Yam.configure do |config|
config.oauth_token = your_oauth_token
end
Results in:
in <main>': undefined method
configure' for Yam:Module (NoMethodError)
And indeed I couldn't find a configure method?
Properties in the create_open_graph_object method is ignored due to a typo. Misspelled as "properites"
Add a class for testing a la sched.do's FakeYammer:
https://github.com/yammer/sched.do/blob/master/spec/support/fake_yammer.rb
Sending Yammer notification...
ERROR: An error occurred while sending the Yammer notification.
uninitialized constant OpenSSL::SSL
org/jruby/RubyModule.java:2677:in const_missing' /var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/faraday-0.8.7/lib/faraday/adapter/net_http.rb:26:in
NetHttp'
/var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/faraday-0.8.7/lib/faraday/adapter/net_http.rb:11:in Adapter' /var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/faraday-0.8.7/lib/faraday/adapter/net_http.rb:10:in
Faraday'
/var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/faraday-0.8.7/lib/faraday/adapter/net_http.rb:9:in (root)' org/jruby/RubyModule.java:2592:in
const_get'
/var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/faraday-0.8.7/lib/faraday.rb:1:in (root)' /var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/faraday-0.8.7/lib/faraday.rb:67:in
lookup_middleware'
/var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/faraday-0.8.7/lib/faraday/builder.rb:146:in use_symbol' org/jruby/RubyBasicObject.java:1683:in
send'
/var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/faraday-0.8.7/lib/faraday/builder.rb:108:in adapter' /var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/yam-0.0.6/lib/yam/connection.rb:53:in
connection'
/var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/faraday-0.8.7/lib/faraday/connection.rb:59:in initialize' /var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/faraday-0.8.7/lib/faraday.rb:11:in
new'
/var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/yam-0.0.6/lib/yam/connection.rb:47:in connection' /var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/yam-0.0.6/lib/yam/request.rb:30:in
request'
/var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/yam-0.0.6/lib/yam/request.rb:22:in get' /var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/yamwow-0.1.6/lib/yamwow/client.rb:38:in
get'
/var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/yamwow-0.1.6/lib/yamwow/throttle.rb:13:in when_ready' /var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/yamwow-0.1.6/lib/yamwow/client.rb:36:in
get'
/var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/yamwow-0.1.6/lib/yamwow/client.rb:17:in get_autocomplete' /var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/yamwow-0.1.6/lib/yamwow/requests/groups/group_with_name_request.rb:22:in
groups_with_prefix'
/var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/yamwow-0.1.6/lib/yamwow/requests/groups/group_with_name_request.rb:18:in group_with_name' /var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/yamwow-0.1.6/lib/yamwow/requests/groups/group_with_name_request.rb:12:in
send'
/var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/yamwow-0.1.6/lib/yamwow/facade.rb:32:in group_with_name' /var/jenkins_home/plugins/yammer/WEB-INF/classes/models/yammer_notification_sender.rb:35:in
group_id'
/var/jenkins_home/plugins/yammer/WEB-INF/classes/models/yammer_notification_sender.rb:18:in send_notification' /var/jenkins_home/plugins/yammer/WEB-INF/classes/models/yammer_notification_performer.rb:20:in
perform'
/var/jenkins_home/plugins/yammer/WEB-INF/classes/models/yammer_notification.rb:19:in perform' /var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/tasks/build_step_proxy.rb:14:in
perform'
/var/jenkins_home/plugins/yammer/WEB-INF/classes/vendor/gems/gems/jenkins-plugin-runtime-0.2.3/lib/jenkins/tasks/build_step_proxy.rb:22:in `boolean_result'
Hi. I've follows the steps in readme.md a number of times previously, and was able to get an access token. Today, I tried it for both an existing app, and a freshly created app, and upon executing step 1, the browser returns the following error:
The redirect uri provided is either invalid or does not match our records
Hi,
I am working on a Ruby SDK section for the yammer developer site that will link out to this repository. Had a recommendation and a question:
to
Setup Yammer Authentication
Setup Yammer OAuth authentication in your app as laid out in “Build your first Yammer App” https://developer.yammer.com/introduction/
Thanks
Sidd
(Yammer, Inc)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.