获取LinkedIn用户的主图片URL [英] Get main picture URL of LinkedIn user

查看:55
本文介绍了获取LinkedIn用户的主图片URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当请求特定用户的基本配置文件字段时,我们会返回以下:

When requesting Basic Profile Fields for a specific user we get back the following:

  1. picture-url ,是方形个人资料图片的URL,大小为100x100像素.

  1. picture-url, a URL for a square profile picture with a size of 100x100 pixels.

图片网址,一个包含原始上载网址的列表图片.

picture-urls, a list containing URLs for the original uploaded picture.

我需要的是用户图片的正方形尺寸,质量更高.

What I need is the user's picture in square size and in a higher quality.

我知道用户的主图片(在他/她的个人资料页面上 https://www.linkedin.com/in/[user_id]/ 下的那个)是大小200x200像素,效果更好.

I know that the user's main picture (the one that is available on his/her profile page under https://www.linkedin.com/in/[user_id]/) is the size of 200x200 pixels, which is much better.

如何通过API访问该图片网址?

How can I access this picture URL through the API?

备注:如果尝试仅生成此URL,则会出现拒绝访问错误.

Remark: If I try to just generate this URL I get Access Denied error.

推荐答案

LinkedIn API没有任何记录的方法来访问生成的图像的不同大小.您可以使用 picture-urls::(原始)字段获取原始上传的图片URL,然后根据需要对其进行缩放.原始上传的图片甚至可以大于LinkedIn个人资料使用的200x200.

The LinkedIn API does not have any documented way to access the different sizes of the generated images. You can use picture-urls::(original) field to get the original uploaded picture URL and then scale it as you like. The original uploaded image can be even larger than 200x200 that the LinkedIn profile uses.

https://developer.linkedin.com/docs/fields/basic-profile

图片网址::(原始) 指向会员原始未设置格式的网址个人资料图片.此图片通常大于图片网址上面的值.

API调用

GET: /v1/people/~:(id,first-name,last-name,picture-url,picture-urls::(original))

结果

{
    "firstName": "Christos",
    "id": "...",
    "lastName": "Litras",
    "pictureUrl": "https://media.licdn.com/dms/image/C5603AQHcTGe3GOQviw/profile-displayphoto-shrink_100_100/0?e=1528894800&v=beta&t=JzgIhDOm-xGxIEuQP1jy3sFHRAeN5pk5skHhXm9s3wM",
    "pictureUrls": {
        "_total": 1,
        "values": [
            "https://media.licdn.com/dms/image/C5600AQG-fzvmQVCLsg/profile-originalphoto-shrink_900_1200/0?e=1528894800&v=beta&t=TrtntJgtAHeolrPeteffiq_Ixg-JecaAvutQioy0c8A"
        ]
    }
}

这篇关于获取LinkedIn用户的主图片URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆