LinkedIn profile API returning 403 - linkedin

I'm not a LinkedIn partner - so I got an access token with r_basicprofile scope (and not r_fullprofile which is not available to me).
According to the docs - this api requires either r_basicprofile or r_fullprofile. However, I cannot get any of my calls to go through without returning a 403. Any ideas?
https://api.linkedin.com/v2/me
or (all basic profile fields)
https://api.linkedin.com/v2/people/(id:{profile ID})?projection=(id,firstName,lastName,industryId~)
Thanks,
Mike

If you are not a current LinkedIn Partner, you do not have access to our v2 API just yet! Try making a similar request using our v1 API:
https://api.linkedin.com/v1/people/~
See https://developer.linkedin.com/docs/v1/people/profile-api for more information about the Profile API.

Related

Development and Testing - Organizations APIs - LinkedIn API

LinkedIn provides 2 public organization API for development purpose:
link
But when I try to access these organization using:
link
It is showing following API fail message:
{"serviceErrorCode":100,"message":"Not enough permissions to access: GET-organization /organizationPageStatistics","status":403}
Is there any problem with my current flow?
From the docs here: https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/organizations/page-statistics#parameters it looks like the organization id is formatted differently
https://api.linkedin.com/v2/organizationPageStatistics?q=organization&organization=urn:li:organization:6177438
Edit: Also, auth tokens are not spec'd to be used as query parameters. You're meant to follow these steps: https://learn.microsoft.com/en-us/linkedin/shared/authentication/authorization-code-flow?context=linkedin/marketing/context and then use the token in the request header.

I need access to use Linked API version 2

I tried to migrage current API to v2 as recent announcement by Linkedin "all developers need to migrate their apps to our newest APIs and OAuth 2.0 by March 1, 2019".
I have an app using API v1 with OAuth 2.0 to get personal and company profile, share a post on company page.
I tried test with request to https://api.linkedin.com/v2/me**&projection=(id)
System keep saying "Not enough permissions to access..."
On recent attempt to request help, it redirected to stactoverflow that implied I need to apply for access to LinkedIn's Marketing Developer Program to access this API.
I applied for API access via this page https://business.linkedin.com/marketing-solutions/marketing-partners/become-a-partner/marketing-developer-program#get-started serveral times.
Until now I haven't received any feedback yet.
That is close to the deadline March 1st to migrate to API version 2.
Please advise what I need to access and develop API v2?
First check what permission you have :
In V2 you have to apply for partner program for using company related API
In V2 for talking basic information you have to use r_liteprofile + r_emailaddress
r_liteprofile for firstName,lastName,profilePicture,id - https://api.linkedin.com/v2/me?projection=(id,firstName,lastName,profilePicture(displayImage~:playableStreams))
r_emailaddress for getting emailAddress - https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))

With the new r_liteprofile is it possible to know the authenticated user's LinkedIn profile URL?

We're using Sign in with LinkedIn, which is deprecating the r_basicprofile scope that offered the profile URL. I don't see a way to get this information using the new r_liteprofile scope. Was that intentionally left out? It seems odd that LinkedIn wouldn't want to drive people back to their own site.
Deadlock :) or just changes of LinkedIn policies.
According this tiny article Public Profile Url you have to use vanityName which is available from r_basicprofile which is not going to be deprecated but available only for Enterprise LinkedIn users :(
Quoting from Self-Serve v1 to v2 API Migration Frequently Asked Questions:
Looking to maintain access to the Basic Profile fields? Learn more
about LinkedIn Developer Enterprise products.

LinkedIn New API - Can't Get r_network Permission

I inherited a program that was written with the old LinkedIn API, and I'm trying to migrate it to the new API. When I try to get the r_basicprofile permission, my oauth token works. However, when I try r_network or rw_nus, I get a response
invalid scope -- your application has not been authorized for
r_network.
Yet, when I go to www.linkedin.com/developer/apps/xxxx/auth, the boxes for r_network and rw_nus are checked.
I.e., A request to
https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=xxxxxx&scope=r_basicprofile&state=yyyy&redirect_uri=http%3A%2F%2Fkalatublog.com%2Fwp-content%2Fmu-plugins%2Fimb-en%2Fhelpers%2Fsocial-connect%2Fapi%2Ffinalize.php%3Fapi%3Dlinkedin%26ch%zzzzz
works, but a request to
https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=xxxxxx&scope=r_network&state=yyyy&redirect_uri=http%3A%2F%2Fkalatublog.com%2Fwp-content%2Fmu-plugins%2Fimb-en%2Fhelpers%2Fsocial-connect%2Fapi%2Ffinalize.php%3Fapi%3Dlinkedin%26ch%zzzzz
gives that error. What am I doing wrong?
As of May 15,
After the grace period expires, several REST API endpoints will no longer be available for general use. The following endpoints are the only ones that will remain available for use:
Profile API — /v1/people/~ `
Share API — /v1/people/~/shares
Companies API — /v1/companies/{id}
If your application is currently using any other API services (e.g. Connections, Groups, People Search, Invitation, Job Search, etc.) you will have to apply to become a member of a relevant Partner Program that provides the necessary API access to continue to leverage any of the endpoints that are not listed above.
It looks like linkedin no longer wants to share anything with their API. Creating a new app indicates that the only possible options are r_basicprofile, r_emailaddress, rw_company_admin, and w_share:
TLDR: they have locked down the API and restricted the usage to an extremely limited set of access points.
I did some more digging. The linkedin website is misleading. On my app linkedin page, it says that I'm approved for rw_nus and r_network, but on this page
https://developer.linkedin.com/support/developer-program-transition
it says those are no longer approved.
So the app home page in linkedin incorrectly said I had those permissions.
Heres the link if you want to Apply for Linkedin
https://help.linkedin.com/app/ask/path/api-dvr

Linkedin API call C#

I need to access Linkedin api using C#, but not able to get documents/articles how I can make call to Linkedin API.
I need to get company information using Linkedin API if I pass the company name I need to get the feeds.
Can anyone please direct me how I can proceed further.
Regards
Anand
This call for get the code:
https://www.linkedin.com/uas/oauth2/authorization?response_type=code&client_id=your-client-id&redirect_uri=your-redirect-uri&state=987654321&scope=r_basicprofile
This call for exchange code to token:
https://www.linkedin.com/uas/oauth2/accessToken?grant_type=authorization_code&code=your-code&redirect_uri=your-redirect-uri&client_id=your-client-id&client_secret=your-client-secret
And finally this call for get user info:
https://api.linkedin.com/v1/people/~:(firstName,lastName,picture-url)?oauth2_access_token=your-token&format=json
To take the client id and the client secret, you need sign up to linkedin developer, Here:
https://www.linkedin.com/secure/developer

Resources