How to make Yammer REST API Call to get authenticated user's profile information?

StackOverflow https://stackoverflow.com/questions/22154403

  •  19-10-2022
  •  | 
  •  

I am trying to call Yammer REST API for getting authenticated user's information using the following code:

$(document).ready(function() {
  $.ajax({
     method: "GET",
    url: "https://www.yammer.com/api/v1/users/current.json",

    contentType: "application/json; charset=utf-8",
    dataType: 'json',
    success: function(data) {
        if (data.Success) {
            alert(data);
        }
    },
    error: function(xhr2, status2) {
        alert(xhr2.status);
    }
});
});

However, it is always going to error method. Can anyone guide me to proceed on this piece?

没有正确的解决方案

其他提示

You're not sending the API any authentication information, so how does it know what user it's supposed to be pulling down? You should take a look at the Javascript SDK.

I had the same problem. Change url from "https://www.yammer.com/api/v1/users/current.json" to "users/current.json" solves the issue (it will be going to success method)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top