Yammer JavaScript API错误地为空200响应抛出错误?

时间:2014-09-20 14:43:58

标签: javascript yammer

我无法发布Yammer JavaScript library的活动。当我使用yam.request时,错误回调将返回HTTP status code 200

如果我尝试使用yam.platform.request,我会得到: Origin https://3sharpepgdev03.sharepoint.com not found in Access-Control-Allow-Origin header.我在Yammer的JavaScript源列表中有这条路径。

以下是您看到其他错误的代码:

<script>
   function postActivity2() {
        yam.request({
            url: "activity.json",
            method: "POST",
            data: {
                "activity": {
                    "actor": {
                        "name": "Jeff Kirkham",
                        "email": "garthf@retailv3dev2.onmicrosoft.com"
                    },
                    "action": "create",
                    "object": {
                        "url": "https://3sharpepgdev03.sharepoint.com/Pages/Yammer%20Test%20Page.aspx",
                        "title": "Lunch Meeting"
                    },
                    "message": "Hey, let’s get sushi!",
                    "users": [
                    {
                        "name": "Jeff Kirkham",
                        "email": "garthf@retailv3dev2.onmicrosoft.com"
                    }
                    ]
                }
            },
            success: function (msg) { alert("Post was Successful!: " + msg); },
            error: function (msg) { console.dir(msg); }
        })
    }
</script>

0 个答案:

没有答案