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