06-18-2018 11:40 PM - edited 06-19-2018 01:32 AM
Hi! Everyone.
I am trying to create a java app that posts Poll using the REST API.
When I set "poll" to "message_type" and POST "https://www.yammer.com/api/v1/messages" but status 400 Bad Request is returned.
// Post
HttpPost httpPost = new HttpPost("https://www.yammer.com/api/v1/messages");
// Add header
httpPost.addHeader("Authorization", "Bearer " + accessAuthToken);
List<NameValuePair> nvps = new ArrayList<>();
nvps.add(new BasicNameValuePair("group_id", group));
nvps.add(new BasicNameValuePair("body", "message body 1"));
nvps.add(new BasicNameValuePair("message_type", "poll"));
// set entity
httpPost.setEntity(new UrlEncodedFormEntity(nvps, UTF8));
// execute
HttpResponse response = httpclient.execute(httpPost);
How can I post Poll using the REST API?
Best Regards.
06-22-2018 10:11 AM
Solution06-24-2018 11:21 PM
Hi!Simon.
Thank you for your reply.
Is not that Poll can not be posted via the REST API?
If that is the case, I consider another way.
Thank you very much.