-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't upload messages with attachment. #26
Comments
You probably will have better luck if you post this question in the Yammer Developer's Network. |
I will do so. Thanks for the suggestion. |
Here's what will work: require 'yammer' Yammer.configure do |c| file1 = File.open('test.txt', 'r') file2 = File.open('test2.txt', 'r') optobj = {:group_id => xxxxxxx , :pending_attachment1 => file1, :pending_attachment2 => file2 } tmp_obj = Yammer.create_message('building a yammer client', optobj) |
Doesn't work.
|
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 text was updated successfully, but these errors were encountered: