Я пытаюсь получить количество комментариев для подачи yammer.получить количество комментариев в yammer feed
Я использовал ниже запрос
jQuery.getScript("https://c64.assets-yammer.com/assets/platform_js_sdk.js",function(){
console.log("script loaded");
var commentCnt = 0;
yam.platform.request(
{ url: "https://www.yammer.com/api/v1/messages/open_graph_objects/"+ogID+".json"
, method: "GET"
, data: {"body": "This Post was Made Using the Yammer API. Welcome to the Yammer API World."}
, success: function (msg) {
if (msg) {
jQuery.each(msg.messages, function (index, element) {
commentCnt++;
});
}
//adds the count to the webpage.
jQuery("div#commentCnt").text(commentCnt);
}
, error: function (msg) {
//console.log("message lookup failed");
}
});
});
это возвращается
XMLHttpRequest cannot load http://myApiUrl/. No
'Access-Control-Allow-Origin' header is present on the requested
resource. Origin 'null' is therefore not allowed access
Как это можно решить? Я также пробовал использовать api.yammer.com
вместо www.yammer.com