Reputation: 3200
The linkedin document clearly shows how to retrieve json format when making an api call. For example:
https://api.linkedin.com/v1/people/~:(id)?format=json
However, I need to make an authenticated api call, which means that I include the accesss token in the url. The structure is as follows...
https://api.linkedin.com/v1/people/~?oauth2_access_token=ACCESS_TOKEN_GOES_HERE
I have retrieved the default xml data but dont understand from their documents how i can make an authenticated call and get json format.
Relavent link https://developer.linkedin.com/documents/authentication https://developer.linkedin.com/documents/api-requests-json
Upvotes: 3
Views: 4363
Reputation: 53928
For presenting an OAuth 2.0 access token to a protected API it is best (according to the OAuth 2.0 standard) to present the token in a header as follows (using cURL):
curl -H "Authorization: Bearer <token>" "https://api.linkedin.com/v1/people/~:(id)?format=json"
Upvotes: 4