Yammer JS SDK — problems with CORS

2019-04-08 16:48发布

It seems like something has changed on the Yammer side, because my app (not yet published to the Yammer Global App Directory) has stopped working, resulting in an obscure CORS error, that doesn't tell a thing about the problem.

So the workflow is very simple —

  • I'm ensuring that user is logged in by calling getLoginStatus() (which pops-up a window and immediately closes it. Irritating, but can live with that)
  • Sending a request to messages/in_group/ID.json wrapped in a yam.platform.request, as suggested by the Yammer JS SDK manual

Here's the console screenshot:

enter image description here

In the Yammer App settings there's a single Javascript Origin, which is https://buzztale.com, which is exactly the one, the request is made from.

This happened before, but then disappeared itself (really confusing). And now it seems to be back…

Hope somebody has any suggestions regarding this issue. In order to get to the app, here's the URL — https://buzztale.com/yammer.

4条回答
做自己的国王
2楼-- · 2019-04-08 16:50

Same here my dev app started failing sometime today. It seems that all of the login end points are working as expected however the messages feed is giving me CORS errors.

yam.platform.request({
            url: "https://api.yammer.com/api/v1/messages/my_feed.json",
            method: "GET",
            success: function (user) { //print message response information to the console
              console.log("The request was successful." + user.messages);
            },
            error: function (user) {
              console.log("There was an error with the request.");
            }
        });
查看更多
一夜七次
3楼-- · 2019-04-08 16:52

Yeah, I'm seeing this on our end too. Seems to be just the GET requests with the messages api endpoint. Like POST / DELETE and Message POST seem to work correctly.

This issue appeared to me around 4PM PST yesterday (7/22/14).

查看更多
成全新的幸福
4楼-- · 2019-04-08 17:09

I am seeing this with the notifications endpoint as well. I noticed that the CLIENT_ID is not being appended to the call https://api.yammer.com/api/v1/streams/notifications.json?&_=xxxxxxxxxx

查看更多
放我归山
5楼-- · 2019-04-08 17:10

This was a known issue with a recent change on our side, and we have pushed a fix to production today. Please let me know if it still isn't working for you. — Nick

So it is an issue on the Yammer side and we can just hope for it not to appear again.

查看更多
登录 后发表回答