2017-06-21 77 views
4

我試過波紋管代碼,但它不工作。如何使用LinkedIn獲取用戶朋友列表?

AFHTTPSessionManager *manager = [AFHTTPSessionManager manager]; 
manager.responseSerializer = [AFJSONResponseSerializer serializer]; 
[manager GET:[NSString stringWithFormat:@"https://api.linkedin.com/v1/people/~/connections:(picture-url,first-name,last-name,id,industry,positions:(company:(name),title),specialties,date-of-birth,interests,languages,siteStandardProfileRequest)?oauth2_access_token=%@&format=json",accessToken] parameters:nil progress:nil success:^(NSURLSessionTask *task, id responseObject) { 

NSLog(@"%@",responseObject); 

    } failure:^(NSURLSessionTask *operation, NSError *error) { 
     NSLog(@"Fail"); 

    }]; 

打到這個API後,我得到了波紋管響應。請幫助我如何獲取linkedin friends列表。

<error> 
    <status>403</status> 
    <timestamp>1498049304917</timestamp> 
    <request-id>G6GU8W51BY</request-id> 
    <error-code>0</error-code> 
    <message>Access to connections denied</message> 
    </error> 
+0

https://stackoverflow.com/questions/20496248/how to-get-linkedin-connections試試這個 –

+0

我試過了,但現在不行。 –

+0

請檢查[Linked In Docs] [https://developer.linkedin.com/docs/oauth2] –

回答

4

更新:LinkedIn已成爲制約其開放API的訪問,並得到用戶的朋友的屬性列表不再起作用。

Connections API僅適用於LinkedIn合作伙伴。

2015年2月12日Linkedin宣佈了一系列開發者計劃的變更。這些變化現已開始生效,並將於2015年5月12日至5月19日期間推出至整個LinkedIn應用程序庫。您可以看到更多詳細信息here

相關問題