-->

Yammer JS SDK — problems with CORS

2019-04-08 16:19发布

问题:

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:

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.

回答1:

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.");
            }
        });


回答2:

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).



回答3:

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.



回答4:

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