jeyben / IOSLinkedInAPI

Simple and non intrusive library to get access tokens for LinkedIn using Oauth2.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Making API calls

Isuru-Nanayakkara opened this issue · comments

How do you make an API call using the library? I'm trying to use the Share API (http://developer.linkedin.com/documents/share-api#toggleview:id=xml) on LinkedIn to post a status message. I'm kinda lost on how to add parameters to the URL using the library. How can it be done?

Thanks

The api only helps you getting hold of a valid accesstoken. It is currently up to you how to use that for further requests to linkedin.

Hi, it's really a good API.can you give me an example of post status request ? I am using your API and trying to post it by

NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:@"comment", @"TEST", nil];
NSString *url = [NSString stringWithFormat:@"https://api.linkedin.com/v1/people/~/shares?oauth2_access_token=%@",accesToken];
[self postPath:url parameters:params success:^(AFHTTPRequestOperation *operation, NSDictionary *accessToken) {
    NSLog(@"dictionary is :%@",accessToken);
}     failure:^(AFHTTPRequestOperation *operation, NSError *error) {
    NSLog(@"Error :%@",[error description]);
}];

where accesToken is what i get by NSString *accessToken = [accessTokenData objectForKey:@"access_token"];

but getting error :{NSLocalizedRecoverySuggestion={
"errorCode": 0,
"message": "Access to posting shares denied",
"requestId": "KP3O4JQCD5",
"status": 403,
"timestamp": 1379659659933
}

The issue is not really handled by this api (as is right now). It is only providing an easy way of getting access to the required access token.