Getting 403 while accessing https://api.linkedin.com/v1/companies/ - linkedin

Equinix uses http://api.linkedin.com/v1/companies/ for getting information about any company and we publish this info in our Equinix Marketplace website for that Company's storefront.
We are using Spring Social Network API to connect to LinkedIn API. It was working before and it started giving below error now:
###[WARN] 2015-07-02 00:17:17:839 [org.springframework.web.client.RestTemplate] - GET request for "https://api.linkedin.com/v1/companies/universal-name=tata-communication:(id,name,universal-name,email-domains,company-type,ticker,website-url,industry,status,logo-url,square-logo-url,blog-rss-url,twitter-id,employee-count-range,specialties,locations,description,stock-exchange,founded-year,end-year,num-followers)?" resulted in 403 (Forbidden); invoking error handler ###[ERROR] 2015-07-02 00:17:18:037 [com.equinix.gse.gsd.servlet.SocialNetworkFlowHandlerServlet] - SocialNetworkServiceException
Is there anyway to get any company information via API for any user?

Starting from May 12, 2015, Linkedin has limited the open APIs.
Access to Companies API requires that you apply for and are granted access to this information from LinkedIn.
As per LinkedIn,
All calls to Companies API endpoints will require the authenticated
user to be flagged as an administrator of the LinkedIn Company Page
that is the target of the API call. You become the administrator of a
page when you create it. If the page already exists, you will have to
contact the existing administrator to grant admin access to other
LinkedIn members.
Your API call will return a 403 Forbidden error if you do not have the
appropriate admin permission to interact with the target company.
So from now onwards, you will have to become an administrator for that company page to access the Companies API.
(This LinkedIn page might be helpful to know more about getting the appropriate admin permissions.)

Related

How do I acquire an OAuth 2.0 Access Token with the r_ads_gen_automation permission for accessing LinkedIn leads for a company page?

My end goal is to register my API to receive notifications of leads generated by LinkedIn for my business's Company Page. The docs here say I need to register at https://api.linkedin.com/v2/leadNotificationUrls using the r_ads_ge_automation permission. I'm trying to acquire this type of access token by using a web browser to hit https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=client_id_for_my_application&redirect_uri=https://my.company.net/api/oauth/linkedin&state=Testing12345&scope=r_ads_leadgen_automation, then logging in as a user that is an admin for the respective company page, then acquiring authentication code, and finally requesting an access token.
The problem is that when I try to hit https://www.linkedin.com/oauth/v2/authorization (with the query params above), I get an error response stating "r_ads_leadgen is not authorized for your application". I can't find any kind of application configuration that is supposed to give this permission to my application.
Can anyone help? Thank you
Permissions are offered to select Partners only. Have you applied to a Partner Program https://business.linkedin.com/marketing-solutions/marketing-partners/become-a-partner?

Can't Access LinkedIn Company Stats via API

when trying to get this endpoint : https://api.linkedin.com/v1/companies/{id}/company-statistics
we are getting the following error:
"Member 87483729 does not have permission to get company 123928234", status: 403..."
Their docs say :
"All calls to Companies API endpoints will require the authenticated user to be flagged as an administrator of the LinkedIn Company Page that is the target of the API call. You become the administrator of a page when you create it. If the page already exists, you will have to contact the existing administrator to grant admin access to other LinkedIn members."
Funny thing is, we do have admin rights to the page.
We figured it out :
"I had to add permissions to the app, but as i was already logged in
and the auth was done by the cookie..i coudn't see the changes"

LinkedIn oAuth1 always return 'Member xxx does not have permission to get company xxx' after May 2015

we have a portal to fetch 'num-followers' and working well, but after the linkedin upgrading, we encounter following 403 message:
<error>
<status>403</status>
<timestamp>1440149000543</timestamp>
<request-id>ULRPYICAEE</request-id>
<error-code>0</error-code>
<message>Member xxxx does not have permission to get company xxxx</message>
</error>
after the research as linkedin said:
"New requirement for Companies API
All calls to Companies API endpoints will require the authenticated user to be flagged as an administrator of the LinkedIn Company Page that is the target of the API call. You become the administrator of a page when you create it. If the page already exists, you will have to contact the existing administrator to grant admin access to other LinkedIn members.
Your API call will return a 403 Forbidden error if you do not have the appropriate admin permission interact with the target company."
so we upgrade the member to be as administrator of company page, then we test by the https://developer.linkedin.com/rest-console, using Oauth2
Check if the member is a company administrator, yes
Get a company's followers, by segment, successfully
but the original code in our portal still encounter the same 403 error, does linkedin abandoned oauth1.0? do i missed some config setting?
thanks in advance if anyone can help on this.
LinkedIn February 12th 2015 update effects LinkedIn applications between May 12th - May 19th, 2015. Maybe, your application affected today.
Check the following answer please.
https://stackoverflow.com/a/30208638/741356

LinkedIn API unable to view _any_ company profile

I'm trying to figure out how to access any company profile on LinkedIn. For example, the REST endpoint API for LinkedIn itself is:
https://api.linkedin.com/v1/companies/1337?format=json
with the sample response of:
{
"id": 1337,
"name": "LinkedIn"
}
However, after authenticating with OAuth2 with rw_company_admin enabled, my app returns:
{
"errorCode": 0,
"message": "Member 206xxxxxx does not have permission to get company 1337",
"requestId": "G6LNMCEZO8",
"status": 403,
"timestamp": 1432358171348
}
This worked up until very recently.
The documentation does note that "In order to perform any of the company page management API calls below, the authenticated LinkedIn user making the requests must be an administrator of the target company." Confusingly, it also says that "The following endpoints are the only ones that will remain available for use... Companies API — /v1/companies/{id}".
However, my goal isn't to manage a company as an admin, it's to show a user a brief output of the company. How can I get company info?
It looks like they turned that feature off.
See https://developer.linkedin.com/support/developer-program-transition
New requirement for Companies API
All calls to Companies API endpoints will require the authenticated
user to be flagged as an administrator of the LinkedIn Company Page
that is the target of the API call. You become the administrator of a
page when you create it. If the page already exists, you will have to
contact the existing administrator to grant admin access to other
LinkedIn members.
Your API call will return a 403 Forbidden error if you do not have the
appropriate admin permission to interact with the target company.
And in the first line,
On February 12th 2015 we announced a series of changes to our
developer program. These changes have now begun to take affect and
will be rolled out to the entire LinkedIn application base between May
12th - May 19th, 2015.
So we are out of luck.
For accessing the company details from LinkedIn you must make a authenticated request(You must be the administrator of the company). For authenticated calls follow this link. https://developer.linkedin.com/docs/oauth2#!
Anyway, you must have the permission rw_company_admin to access the company details. For that, you must check Default Application Permissions in your App settings and also important to note that when you request for an Authorization Code you must specify the scope.
Use this method to get an authorization code for a company
https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=123456789&redirect_uri=https%3A%2F%2Fwww.example.com%2Fauth%2Flinkedin&state=987654321&scope=rw_company_admin
I had issues with this as well even though I was definitely a company admin. Once I added that company as my current place of work on my profile, the API started to respond as expected.

LinkedIn API returns 403 when requesting companies list

We use the LinkedIn API to list companies that a user admins.
We have our App set to get r_fullprofile and rw_company_admin when the user grants permission.
We're trying to list all of the companies the user has admin access to via:
http://api.linkedin.com/v1/companies:(id,name,square-logo-url)?is-company-admin=true
<error>
<status>403</status>
<timestamp>1432323149224</timestamp>
<request-id>XXXXXXXXXX</request-id>
<error-code>0</error-code>
<message>Member [user id] does not have permission to get companies as admin.</message>
</error>
According to the Manage Company Pages docs, as long as we have the rw_company_admin scope, we should be able to call this endpoint.
I've read through the Developer Program Transition docs (https://developer.linkedin.com/support/developer-program-transition) but it doesn't seem to affect this usage of the API.
ETA: This has been flagged as a possible duplicate of LinkedIn API unable to view _any_ company profile
That question is about fetching details for a single company (which the user may or may not administrate). My question is about listing companies that the user specifically does administrate.
According to new api changes user should be administrator of target company. Read this .
All calls to Companies API endpoints will require the authenticated user to be flagged as an administrator of the LinkedIn Company Page that is the target of the API call. You become the administrator of a page when you create it. If the page already exists, you will have to contact the existing administrator to grant admin access to other LinkedIn members.
I faced the same problem and the problem was with the initial authorization code. You should mention the scope=rw_company_admin while doing the initial redirect URL call. Something like this -
https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=your_client_id&redirect_uri=https%3A%2F%2Fwww.google.com/&state=12345&scope=rw_company_admin%20r_emailaddress%20w_share%20r_basicprofile

Resources