LinkedIn REST API可以访问用户活动供稿吗?

时间:2018-11-19 16:29:48

标签: linkedin linkedin-api

1 个答案:

答案 0 :(得分:0)

在调用REST API之前,OAuth(必须先对应用程序进行授权和身份验证,然后才能从LinkedIn获取数据或访问成员数据。)                         -获得许可                             -客户端ID(API密钥)和客户端密钥。                             -您的应用程序将浏览器定向到成员进行身份验证的LinkedIn的OAuth 2.0授权页面。身份验证后,LinkedIn的授权服务器将身份验证代码传递给您的应用程序。                             -将此代码发送到LinkedIn,LinkedIn返回访问令牌。                             -应用程序使用此令牌代表成员调用API。

                        - Step 1: Get Client ID (API Key) and Client Secret
                            -   OAuth setting - Add redirect URL
                        - Step 2: Generate an Access Token 
                            -   https://www.linkedin.com/oauth/v2/accessToken?grant_type=client_credentials&client_id={your_client_id}&client_secret={your_client_secret}
                            -   {
                                    "access_token": "AQV8...",
                                    "expires_in": "1800"
                                }
                        - Step 3: Make API Requests
                            - Make API requests by including an Authorization header with your token in the HTTP call to LinkedIn's API.
                            https://developer.linkedin.com/docs/guide/v2/shares/activity-feed

                            -   GET /v2/jobs HTTP/1.1
                                Host: api.linkedin.com
                                Connection: Keep-Alive
                                Authorization: Bearer {access_token}

                                https://api.linkedin.com/v2/activityFeeds?q=networkShares&count=2

                                Available v2 APIs include:
                                    r_liteprofile (replaces r_basicprofile)
                                    r_emailaddress
                                    w_member_social (replaces w_share)
                    */