Search code examples
linkedin-apiscopes

Linkedin-api-,Advertising API {id} does not work


I have an approved Advertising API inside my Linkedin App so the "r_basicprofile", "r_1st_connections_size" scopes are granted.

I am looking for the number of the connections of the user which based on the document could be get via /rest/connections/{id} endpoint. When I get the access token ( put it in the header of the get request) then I want to reach https://api.linkedin.com/rest/connections/{id}{I think id of the inkedin user and can be retrieve via r_basicprofile} I get the following error:

{"message":"Key parameter value 'XXXXXX' is invalid","status":400}

Where I assumed the id can get via r_basicprofile is "XXXXXX" which it looks it is not right. Anyone knows what I need to replace for {id}?


Solution

  • According to the LinkedIn documentation, you don't need to specify a user id in the call. Instead, just use an access token that was granted by the user whose connections you want to query (e.g. for the user with id 'XXXXXX').

    You can find the documentation here: https://learn.microsoft.com/en-us/linkedin/shared/integrations/people/connections-api