简体   繁体   中英

iOS - Get Interests from LinkedIn using LinkedIn API

Is it possible to get User's Interest from LinkedIn using LinkedIn API. I can get the user basic details, But i dont know that how to get the Interest list. I also searched in google, but nothing wll helps me. Any help regarding this will be appreciated. Thanks.

At finally found the answer, It is very simplest one, but it takes these much time to find out,

Just added the interests option in the following url,

NSURL* url = [NSURL URLWithString:@"http://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address,picture-url,public-profile-url,interests)"];

OAMutableURLRequest *request =
[[OAMutableURLRequest alloc] initWithURL:url
                                consumer:consumer
                                   token: self.accessToken
                                callback:nil
                       signatureProvider:nil];

[request setValue:@"json" forHTTPHeaderField:@"x-li-format"];

OADataFetcher *fetcher = [[OADataFetcher alloc] init];
[fetcher fetchDataWithRequest:request
                     delegate:self
            didFinishSelector:@selector(profileApiCallResult:didFinish:)
              didFailSelector:@selector(profileCancel:didFail:)];

Now using Linkedin sdk developer can easily fetch this kind of data.

NSString *url = @"https://api.linkedin.com/v1/people/~:(id,first-name,last-name,email-address,picture-url,public-profile-url,interests)" //NSString *url=@"https://api.linkedin.com/v1/people/~?format=json";

if ([LISDKSessionManager hasValidSession]) {
    [[LISDKAPIHelper sharedInstance] getRequest:url success:^(LISDKAPIResponse *response) {
        DLog(@"Success: %@", response.description);
        DLog(@"response.data: %@", response.data);
        DLog(@"statusCode: %d", response.statusCode);

    } error:^(LISDKAPIError *apiError) {
        DLog(@"Error: %@", apiError.description);
    }];
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM