06-17-2019 01:00 PM - edited 06-17-2019 01:01 PM
Hi,
I am trying to integrate Yammer REST API to post a message into a group with attachment as per documentation -
https://developer.yammer.com/docs/messages-json-post
What is working for me so far -
But, I am NOT able to
Below is code snippet -
File fileToUse = new File("logo.png");
FileBody fileBody = new FileBody(fileToUse, ContentType.MULTIPART_FORM_DATA);
StringBody stringBody1 = new StringBody("12345", ContentType.MULTIPART_FORM_DATA);
MultipartEntityBuilder builder = MultipartEntityBuilder.create();
builder.addPart("attachment1", fileBody);
builder.addPart("group_id", stringBody1);
HttpEntity entity = builder.build();
httpPost.setEntity(entity);
HttpResponse response = client.execute(httpPost);
Did anyone face this issue? appreciate your thoughts on this.