从 windows live 获取个人资料图片

发布于 2024-12-18 12:15:01 字数 622 浏览 5 评论 0原文

window live api

我可以通过以下方式获取用户信息、联系人、朋友windows live api 正确。

但是当我根据以下说明请求用户个人资料图片时:

注意要将 GET 调用重定向到用户图片的 URL,您可以 调用 /me/picture 或 /USER_ID/picture。

https://apis.live.net/v5.0/me/picture ?access_token=MY_ACCESS_TOKEN

它响应 null,事实上我已经为 window live 设置了个人资料图片。

很奇怪的是,我可以获得除用户图片之外的所有信息,但是当我使用 Windows Interactive SDK 获取用户图片时,它会响应我正确的图片 url。

问题是什么?

window live api

I can get user infomation, contacts, friends through the windows live api correctly.

but when i request for the user profile picture according to the following note:

Note To redirect a GET call to the URL of a user's picture, you can
call /me/picture or /USER_ID/picture.

https://apis.live.net/v5.0/me/picture?access_token=MY_ACCESS_TOKEN

It responses null, in fact i have set a profile picture for window live.

it is very strange that I can get all the information except user picture, but when I use the windows Interactive SDK for user picture, it response me the right picture url.

what is the problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

蓬勃野心 2024-12-25 12:15:01

这就是我所做的。我确实即时编辑了这段代码,所以我希望语法是正确的。

var uri = "https://apis.live.net/v5.0/me?access_token=" + accessToken;
var profile = JObject.Parse(new WebClient().DownloadString(uri));
var pictureUrl = string.Format("https://apis.live.net/v5.0/{0}/picture", profile["id"]);

Here is what I do. I did edit this code on the fly so I hope the syntax is correct.

var uri = "https://apis.live.net/v5.0/me?access_token=" + accessToken;
var profile = JObject.Parse(new WebClient().DownloadString(uri));
var pictureUrl = string.Format("https://apis.live.net/v5.0/{0}/picture", profile["id"]);
无语# 2024-12-25 12:15:01

也许晚了...但对其他人仍然有用...如果您有实时用户 ID,则不需要访问令牌。试试这个:

https://apis.live.net/v5.0/USER_ID/picture?type=large

当然,您必须将 USER_ID 替换为您尝试获取图片的名称...然后您可以添加首选尺寸:
(获得 96 × 96 像素的图片)、 (180 × 180) 或 (360 × 360)

Maybe late... but still can be useful to someone else... You don't need the access token if you have the Live user id. Try this:

https://apis.live.net/v5.0/USER_ID/picture?type=large

Of course, you must replace the USER_ID with the one you trying to get the picture... then you can add the preferred size :
small (to get a 96 × 96-pixel picture), medium (180 × 180), or large (360 × 360)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文