Get Google Plus cover URL by user_id

主宰稳场 提交于 2019-12-24 15:09:04

问题


Is there a way to get the profile picture for a google+ account by using an URL ?

I know that we can get the photo by doing something like: https://plus.google.com/s2/photos/profile/1234567890?sz=200 and I need something similar to get the profile cover photo.


回答1:


It depends on the URL you have, if you have the user's Google+ ID, you can then retrieve their profile, which contains a link to their profile. An example:

Api Explorer Demo of Retrieving a Cover Photo

Set the fields value to cover/coverPhoto/url if it's not getting added automatically.




回答2:


There is not a link to access profile photos through the Google+ API. The best way to do this would be to make a GET request to the people.get API endpoint, as follows:

GET https://www.googleapis.com/plus/v1/people/{userId}

That will return a Person resource, which will contain the user's profile image under the id image.



来源:https://stackoverflow.com/questions/19055914/get-google-plus-cover-url-by-user-id

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!