Skip to content
Advertisement

Uploading a file via Yammer API

I’m able to post a message but when I add either the attachment or pending_attachment, I get an error saying:

TypeError: ‘stepUp’ called on an object that does not implement interface HTMLInputElement.

JavaScript

Advertisement

Answer

yammer’s javascript SDK doesn’t work with attachment. (at least no working example has been seen on the internet) To upload an attachment, you can either upload the file to your server and then use og_url to post a link to that file on your server, or cook up your own ajax form upload. here is an example:

JavaScript

Notice that the authorization token is obtained in the response to a successful login. It is not your app ID. Also, I doubt document.getElementById(“attachment”) will work. You need to convert that object into an byte array blob.

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement