【问题标题】:How can I post Yammer's Poll using the REST API?如何使用 REST API 发布 Yammer 的投票?
【发布时间】:2018-06-19 07:50:53
【问题描述】:

我正在尝试创建一个使用 REST API 使用 Yammer 发布 Poll 的 Java 应用。

当我将 ‍poll‍‍‍‍ 设置为 message_type 并 POST https://www.yammer.com/api/v1/messages 但返回状态 400 Bad Request

// 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);

如何使用 REST API 发布投票?

最好的问候。

【问题讨论】:

    标签: java rest post yammer


    【解决方案1】:

    您询问了如何通过 REST API 发布投票,目前的答案是不支持。我希望我有一个更好的答案,但这在 Yammer 开发人员网站上没有记录,并且您(和您的用户)尝试对其进行逆向工程以包含在应用程序中是一种风险。

    如果要对其进行逆向工程,请使用当前代码捕获 Fiddler 跟踪,然后调整 HTTP 请求,直到它与 Yammer 站点匹配。

    如果您想要支持 API,那么您应该在 Yammer UserVoice 网站上发帖。这么多对事物的请求都以这样的线程结束,如果能提高可见性会更好。

    【讨论】:

    • 嗨,布赖恩!感谢您的回复。我明白了。为什么即使通过检查网络我也找不到答案。而且我无法通过那里的投票找到解决方案。我将探索其他替代方案。
    猜你喜欢
    • 1970-01-01
    • 2018-07-31
    • 1970-01-01
    • 2015-10-13
    • 2014-11-20
    • 1970-01-01
    • 1970-01-01
    • 2015-02-20
    • 2012-12-16
    相关资源
    最近更新 更多