发表/创建使用Yammer的REST API的一项民意调查 [英] Post/Create a poll using Yammer REST API

查看:279
本文介绍了发表/创建使用Yammer的REST API的一项民意调查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在做一个项目,有发展显示从Yammer的饲料自定义Web部件的要求。此外,登录的用户应能够从Web部件发布消息,附件投票。

我是能够利用发布REST API,并与Yammer的嵌入邮件和附件。但我不能找到如何发布/创建通过Yammer的API使用JavaScript的一项民意调查的任何信息/文件。我已经通过的Yammer( https://developer.yammer.com/documentation/),并用Google搜索了很多,但不能得到任何帮助。

对此任何建议将是非常美联社preciated。

问候,

Srivikas Nallamilli。


解决方案

使用您用来获取信息相同的API从哭诉即的 https://www.yammer.com/api/v1/messages.json

当您发布的一项民意调查,上述API将返回如下JSON respose的内容:

\r
\r

external_references:[],\r
   元:{\r
      requested_poll_interval:60,\r
      即时的:{\r
         URI:https://7-791.rt.yammer.com/cometd/,\r
         authentication_token:或其可令牌GT;\r
         CHANNEL_ID:<渠道ID>\r
      },\r
      last_seen_message_id:空,\r
      current_user_id:1530316230,\r
      followed_references:[\r
\r
      ]\r
      ymodules:[\r
         {\r
            ID:12147685,\r
            inline_html:<内嵌HTML>中,\r
            viewer_id:1530316230\r
         }\r
      ]\r
      newest_message_details:空,\r
      FEED_NAME:公司频道,\r
      feed_desc:,\r
      direct_from_body:假的\r
   }

\r

\r
\r

你会得到内嵌HTML部分查询信息在code上文所强调的。

让我知道,如果它的工作原理。

谢谢,

主治医生布哈特

I have been working on a project where there is a requirement to develop a custom web part that displays the feeds from Yammer. Also, the logged in user should be able to post messages, attachments, polls from the web part.

I was able to post messages and attachments using rest api and with yammer embed. But I couldn't find any information/documentation on how to post/create a poll via Yammer API using JavaScript. I've browsed through the documentation provided by Yammer( https://developer.yammer.com/documentation/ ) and googled a lot, but couldn't get any help.

Any suggestions regarding this would be highly appreciated.

Regards,

Srivikas Nallamilli.

解决方案

Use the same API that you use to fetch messages from yammer i.e https://www.yammer.com/api/v1/messages.json

When you post a poll, above api will return json respose something as below:

"external_references":[],
   "meta":{  
      "requested_poll_interval":60,
      "realtime":{  
         "uri":"https://7-791.rt.yammer.com/cometd/",
         "authentication_token":<TOKEN>
         "channel_id":<CHANNEL ID>
      },
      "last_seen_message_id":null,
      "current_user_id":1530316230,
      "followed_references":[  

      ],
      "ymodules":[  
         {  
            "id":12147685,
            "inline_html":"<INLINE HTML>",
            "viewer_id":1530316230
         }
      ],
      "newest_message_details":null,
      "feed_name":"Company Feed",
      "feed_desc":"",
      "direct_from_body":false
   }

you will get the poll message in inline html section highlighted in code above.

Let me know if it works.

Thanks,

Avni Bhatt

这篇关于发表/创建使用Yammer的REST API的一项民意调查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆