3

i try to find a way of uploading programatically images in java to my Yammer account.

For the OAuth issues I use https://github.com/fernandezpablo85/scribe-java which works fine, but for the image upload I need to create a payload message.

Is there any code example of a payload message (or any other way to do so) to send a post request with an image ?

Thanks for any help :)

Emerson
  • 1,327
  • 2
  • 15
  • 24

1 Answers1

0

You'll need to upload via the rest api. You'll need to use a combination of making a POST to https://www.yammer.com/api/v1/messages.json, setting the parameter attachment1 to the binary value of the attachement.

To set that binary value, see this .net code that should be similar to what you're trying to accomplish in Java

https://stackoverflow.com/a/16925159/12497

Community
  • 1
  • 1
Peter Walke
  • 2,497
  • 6
  • 33
  • 50