I'm developing an iOS app using the LinkedIn API. Everything works fine but I'm having problems with the "Invitation API"
I don't understand what the "Member ID + auth token" are, I need those to make the call to the server...
This is what the documentation says about it:
Member ID + auth token: If the invitee was found using a search API call, then the search result will have included the member ID and auth token to make the API call. Use both of those to identify the member to invite.
So aparently those are fields that come when I search for the contact using the search API. To search for contacts I do the following call to the server:
NSString *url = [[NSString stringWithFormat:@"https://api.linkedin.com/v1/people-search:(people:(id,first-name,last-name,picture-url,headline,distance))?keywords=%@&facet=network,S&sort=distance&count=25&oauth2_access_token=%@&format=json",keywords, self.auth.accessToken] stringByAddingPercentEscapesUsingEncoding:
NSASCIIStringEncoding];
This works fine, and returns what I' looking for but I never get back the "Member ID + auth token". First I thought it was because I was selecting just some fields from the people so I check in the "Search API" if there is some field called "Member ID" or "Auth Token" but there is not. So I'm really lost... where do I found those values?
Any Idea?
I found the answer to get the token to send invites. When performing the search is necessary to add the field "api-standard-profile-request"
After that when performing the search you will get:
<api-standard-profile-request>
<url>http://api.linkedin.com/v1/people/T4sKMZ8qEN</url>
<headers total="1">
<http-header>
<name>x-li-auth-token</name>
<value>NAME_SEARCH:1Mlb</value>
</http-header>
</headers>
</api-standard-profile-request>
And that's it... I hope it helps someone!