It's January 2019. I'm migrating to LinkedIn API v2, as LinkedIn requires.
My app has set up && been granted (by user clicks) these permissions shown in this picture.
The simplest API call is GET "/v2/me" with no extra query string, which returns data in this shape:
"{\"lastName\":{\"localized\":{\"en_US\":\"Jobs\"},\"preferredLocale\":{\"country\":\"US\",\"language\":\"en\"}},\"firstName\":{\"localized\":{\"en_US\":\"Steve\"},\"preferredLocale\":{\"country\":\"US\",\"language\":\"en\"}},\"profilePicture\":{\"displayImage\":\"urn:li:digitalmediaAsset:X9999XXXX5-XXx9-bye\"},\"id\":\"XyyyyXXXXX\"}"
But I wish to ask for more fields (all of which are allowed once I have r_basicprofile as mentioned https://developer.linkedin.com/docs/ref/v2/profile/basic-profile) by GET "/v2/me?fields=id,firstName,lastName,headline,profilePicture",
but received:
"{\"serviceErrorCode\":100,\"message\":\"not enough permissions to access field headline for GET /me\",\"status\":403}"
Indeed https://developer.linkedin.com/docs/guide/v2/people/profile-api did NOT say /v2/me
can have query string like ?fields=id,firstName,lastName,headline,profilePicture. If this query string is not allowed right now. what am I benefiting from r_basicprofile?
I have also tried GET "/v2/people/(id:{person ID})", which got
"{\"serviceErrorCode\":100,\"message\":\"Not enough permissions to access: GET /people/(id:XyyyyXXXXX)\",\"status\":403}"
Before 1st March You have to Move in V2
r_basicprofile is there because you can use this with V1 till 1st march
after that this will automatically deleted
in V2 you have to use :
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~))
From the documentation, in addition to updating your scope to r_liteprofile, you would have to change the API endpoint from people/~:(id,firstName,lastName) to me?projection=(id,firstName,lastName) to get the basic profile details.
Related
I use the Zoonman LinkedIn API PHP SDK to get information about companies an authenticated user is an admin of, using this bit of code:
$profileCompany = $client->get(
'companies',
['is-company-admin' => "true"]
);
This worked perfectly with API version V1. However, with V2, it gives a 400 not found error. I came across this: Organization Lookup API but not exactly sure if this is the right endpoint, as there is no API call to exactly do what the above code snippet does.
Could someone please help with the right endpoint?
If you have the access token from the user this is possible in v2 of the LinkedIn API. See:
https://developer.linkedin.com/docs/guide/v2/organizations/organization-lookup-api#acls
The full URL for the basic request would be:
https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee&role=ADMINISTRATOR&state=APPROVED&projection=(*,elements*(*,organizationalTarget~(*)))
With paging:
https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee&role=ADMINISTRATOR&state=APPROVED&projection=(*,elements*(*,organizationalTarget~(*)))&start=[...]&count=[...]
And you probably want the organization logo urls as well:
https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee&role=ADMINISTRATOR&state=APPROVED&projection=(*,elements*(*,organizationalTarget~(*,logoV2(original~:playableStreams,cropped~:playableStreams,cropInfo))))&start=[...]&count=[...]
For linkedin-api-php-client see also:
https://github.com/zoonman/linkedin-api-php-client/issues/31
From the docs
Please note the following changes when migrating your app from v1 of
the LinkedIn API Platform:
Company Pages and Showcase Pages are now
surfaced as Organization and Brand resources, respectively. Both
resources are considered "Organizational Entities," and share common
fields and similarities in how data is accessed.
URNs uniquely
identify organizational entities, and can be generated with existing
company or showcase ids:
Organization: urn:li:organization:{company id}
The above code make call the rest api "List all companies that the member is an administrator of". It does not seems have a direct equivalent API available in v2.
Organisation lookup/search APIs seems nearest alternative.
Hope this helps.
I've encountered some problems using POST /workspaces/{workspaceId}/timeEntries/user/{userId}/entriesInRange
It works only if I ask for my own userid, but when I request data for other workspace users - I get 403 - forbidden - how can I change that ? I'm using account within admin group
That endpoint is used for the timesheet functionality and does not support users other than yourself, even if you are an admin of your workspace. You can however use the SummaryReport endpoint which will give you time entries in requested range, and you can set the input parameter 'me' to toggle between your and your team's entries:
https://clockify.github.io/clockify_api_docs/#tag-Summary-report
I'm trying to use the MS Academic Knowledge API. I signed up for keys here as per the docs
https://labs.cognitive.microsoft.com/en-US/sign-up
When I use the key I get errors as follows
api.labs.cognitive.microsoft.com:
Endpoint api.labs.cognitive.microsoft.com is not supported
westus.api.cognitive.microsoft.com:
'Access denied due to invalid subscription key. Make sure you are subscribed to an API you are trying to call and provide the right key.'
I'm not sure what is going on here and which endpoint I need to use
The following works for me:
https://api.labs.cognitive.microsoft.com/academic/v1.0/interpret?query=darrin%20eid&complete=1&count=10&model=latest&subscription-key=your_key
(replace "your_key" with your labs subscription key)
Additionally, you can see the URL you need to use for each different API when you use the "try it" test site
We recently obtained the r_ad_campaigns permission to work with the LinkedIn V2 API:
https://developer.linkedin.com/docs/lms/marketing-analytics/quick-start#
https://developer.linkedin.com/docs/guide/v2/shares/network-update-social-actions
To work correctly, I have obtained a new TOKEN with the new permission: r_ad_campaigns
I have made the following 3 calls with this new token:
https://api.linkedin.com/v2/socialActions/{share URN}?oauth2_access_token=TOKEN
https://api.linkedin.com/v2/socialActions/{share URN}/comments?oauth2_access_token=TOKEN
https://api.linkedin.com/v2/socialActions/{share URN}/likes?oauth2_access_token=TOKEN
And they all return the same result:
{"serviceErrorCode": 100, "message": "Not enough permissions to access: GET / socialActions / {share URN}", "status": 403}
The same thing happens with these post:
Why does LinkedIn v2 Share API give not enough permissions error on any v2/shares endpoint?
LinkedIn V2 API permission for reading socialActions and Shares
Please, does anyone know how to solve this problem and that it works correctly? Is it important.
It's working in my case, this problem related to permission
Follow these steps,
Open Url, https://www.linkedin.com/developers/apps/
Goto products
Select all products
Marketing Developer Platform Product need some days to be approved
If all products are successfully installed
Check OAuth 2.0 scopes permissions to access data using your app
I am new to this linkedin api. I have made a small example which is working when I am using the keyword search by using the following url:
https://api.linkedin.com/v1/company-search:(companies:(id,name,universal-name,website-url,industries,status,logo-url,blog-rss-url,twitter-id,employee-count-range,specialties,locations,description,stock-exchange,founded-year,end-year,num-followers))?keywords={IBM}&oauth2_access_token=<access Token>
But when I am searching any company info by using the email-domain search then it is giving me 403 error:
<error>
<status>403</status>
<timestamp>1432820120642</timestamp>
<request-id>XLWN5Y7T7R</request-id>
<error-code>0</error-code>
<message>Member 385883298 does not have permission to get company 66028</message>
</error>
I am using the following url for this:
https://api.linkedin.com/v1/company-search:(companies:(id,name,universal-name,website-url,industries,status,logo-url,blog-rss-url,twitter-id,employee-count-range,specialties,locations,description,stock-exchange,founded-year,end-year,num-followers))?email-domain=ibm.com&oauth2_access_token=<acess Token>
So as you have posted your answer which is related to this problem I guess you are saying that I have to be the administrator for the company page for which I am searching. As like in my above url i.e. email-domain=ibm.com. If I am wrong or not getting the things, please guide me.
Thanks
As part of the recent changes to the LinkedIn API - you are required to be the administrator of the company you are making API calls on behalf of. As a result, the company search calls are no longer openly available.
You can make a call to check whether the authenticated user is an Administrator of a given company like this:
https://api.linkedin.com/v1/companies/{Insert CompanyID here}/relation-to-viewer/is-company-share-enabled?format=json
This will return a boolean value. If true, you're good to go. If false, you'll need to get an existing company admin to grant the user company administrator status using the tools available on www.linkedin.com