LinkedIn v2 organization API endpoint failing - linkedin

I'm currently requesting scopes w_company_admin, r_basicprofile, and rw_organization.
I already posted a similar question here, but I got no support so I'm trying a different approach.
I found another endpoint that should get me the organization name. I used this endpoint to get ID of organizations:
https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee&role=ADMINISTRATOR&start=0&count=100&fields=organizationalTarget&oauth2_access_token='.$oauth_token;
Then when I extract the ID from urn leaving me with just ID number I use that in this request
https://api.linkedin.com/v2/organizations/'.$company_id.'?projection=(elements*(entity~(vanityName)))&oauth2_access_token='.$oauth_token;
The problem is that this request is returning 200 status with the output being "{}".
I don't understand why no data would be returned? It seems like the API request is failing considering the first request worked successfully.

I can replicate the problem, you should use a different projection.
Use this:
projection=(vanityName)
Instead of this:
projection=(elements*(entity~(vanityName)))
Probably the doc here seems misleading about the usage of the decorator in this case.
Hope this help

Reposted an answer to your original question:
I found the answer on this page: https://learn.microsoft.com/en-us/linkedin/shared/references/migrations/permissions-resources-mapping
"rw_organization_admin" is the missing scope.

Related

Using LinkedIn API to retrieve advertising reports

I'm working on a simple app to programmatically retrieve ads performance within Linkedin. I have general API experience but this is the first time i get my feet wet with the Linkedin API.
One example from Linkedin API documentation suggest something that would get me started:
GET https://api.linkedin.com/v2/adAnalyticsV2?q=analytics&dateRange.start.month=1&dateRange.start.day=1&dateRange.start.year=2016&timeGranularity=MONTHLY&pivot=CREATIVE&campaigns=urn:li:sponsoredCampaign:112466001
I am encountering two problems:
First this example implies that you already know the campaign ID. However I am unable to find a way to retrieve a list of campaign ID's for a given account.
Second, if I manually pull a campaign ID, I receive an error: "{"serviceErrorCode":2,"message":"Too many fields requested. Maximum possible fields to request: 20","status":400}". Pretty clear error.
A little research tells me that by adding the parameter "&fields=" I will be able to limit my query to less than 20 field (I really need only a dozen anyway) but I can't find and documentation regarding the names of the fields available.
Any help or pointer will be appreciated.
please refer the link below scroll down where you ill see the field names mentioned as metrics , these are the fields.
https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ads-reporting?tabs=http#analytics-finder

Why calculateRoute never returns route for mode shortest and type truck?

Our team encountered a problem with HERE API while testing routing with Calculate Route for mode=shortest and type=truck.
We've also tested this not only in our implementation but also on the ref client here just by dragging points to different locations with the same result.
Example of REST request:
https://route.api.here.com/routing/7.2/calculateroute.json?app_code=456&app_id=123&jsonattributes=41&language=pl-pl&maneuverattributes=po,ti,pt,ac,di,fj,ix&metricsystem=metric&mode=shortest;truck;traffic:disabled&routeattributes=sh,gr&waypoint0=geo!stopOver!52.913486,6.693136&waypoint1=geo!stopOver!52.002047,19.921338
I would expect this combination to return successful result or message about this being exception. Also, proper remark in docs would be greatly appreciated.
Currently truck routing support Fastest and Balanced mode only.
When calculating truck routes, we recommend to always use the fastest Routing Mode Type.
please see the documentations for your reference.
https://developer.here.com/documentation/routing/topics/routing-mode-parameter-combinations.html
https://developer.here.com/documentation/routing/topics/filtering-truck-routing-requests.html
Hope this helps!!

What is the purpose of X-Cloud-Trace-Context?

I was practicing some HTTP Post requests with a post-test server (ptsv2.com).
After a successful post, I can see the request body and headers etc. on the site.
There is one value that I am unsure about:
X-Cloud-Trace-Context
What is this for?? I understand the rest of header data, but I can't seem to find a good explanation on that one part.
Thank you.
X-Cloud-Trace-Context is a header from Google Cloud Platform to identify the current request.
It is particularly useful for correlating logs. As per documentation (https://cloud.google.com/appengine/docs/standard/python3/writing-application-logs), correlation has to be done manually. This post explains in detail how to do it: https://code.luasoftware.com/tutorials/google-app-engine/app-engine-standard-python37-correlate-application-log-with-request-log/

(Why) 'dont my credentials authorize access' to any descriptive meta resources from the HERE-api?

Yesterday I registered with HERE to experiment on Traffic/Flow data.
I registered with both the 'Public Basic plan' as well as the '90-day evaluation'. I managed to perform some basic query's and also got results but the next step was to understand the output.
The official way to get descriptions on the output data is described here:
https://developer.here.com/rest-apis/documentation/traffic/topics/additional-parameters.html.
I simply substituted my credentials in the the https://traffic.cit.api.here.com/traffic/6.0/xsd/flow.xsd?app_id={YOUR_APP_ID}&app_code={YOUR_APP_CODE} URL and pasted in my browser. But the only result I get for every xsd is:
"error:These credentials do not authorize access. Please contact your customer representative or submit a request here developer.here.com/contact-us to upgrade your account. You can also get valid credentials by registering for a free trial license on developer.here.com.,error_description:NA" . So apparently I am authorized to use the api but not authorized to get information on how to interpret the results...?
I already found out the many abbreviation are explained on Interpreting HERE Maps real-time traffic tags but I found a few that weren't described, like <SSS> and <SS>.
Thanks in advance.
UPDATE: Apparently I was already voted down on the question. What am I doing wrong?
The Description of SS/SSS tag is here:
The SS (SUB_SEGMENT) will be provided if the current traffic data is
more precise than the road defined. When there are SS elements, the
elements will be ordered by driving direction. If there are SS
elements, the lengths (LE) of all SS elements will add up to the
length of the roadway represented from the corresponding CF section.

How to get LinkedIn Company status update comments using API?

I am trying to get comments to one particular Company status update using update-key. It is not documented in the manual, but when trying to call the link similar to Network status update link I can get some data, but the result data is not correct (it's addressed to another post).
The link is : http://api.linkedin.com/v1/companies/{company_id}/updates/key={update-key}/update-comments .
I am just wondering whether it is possible using API and whether this feature is in plans?
Reading Company updates is available in preview mode as of this answer:
https://developer.linkedin.com/reading-company-updates
However, there does not appear to be any published support for pulling a particular update by it's id. You can specify the type, and paginate through the results, but pulling a particular update does not appear to be supported, per the docs linked above.
This is actually possible, however the LinkedIn API documentation seems to have some typos in the examples:
v1/companies/{company_id}/updates/key={update_key}
I was able to get this to work!

Resources