How to get other member's profile details from linkedin api - linkedin

I am trying to fetch users details from linkedIn api. After generating accesstoken I can get my details from linkedIn api but I want to get other members details. How to get this work? please help me.
I have tried the solutions according to the documentation.
As per the documentation we have to sent a get request to the GET https://api.linkedin.com/rest/people/(id:{person ID}) to Retrieve Other Member's Profile. When I am sending the get request it is showing me
data: {
code: 'VERSION_MISSING',
message: 'A version must be present. Please specify a version by adding the LinkedIn-Version header.'
}
this error. after searching the documentation I found that there is a note saying
in order to make the sample calls above succeed, you must include
X-RestLi-Protocol-Version:2.0.0 in your request header.
I have added that to and still getting the error.

I experienced the same issue. After some browsing this works for me:
Use https://api.linkedin.com/v2/me instead of https://api.linkedin.com/rest/me

You need to pass the version number like this: LinkedIn-Version: 202210. It worked for me without changing /rest to /v2. More info here: Introducing API Versioning and New Content APIs.

I had the same problem.
As the error says, I tried using LinkedIn-Version as the header key and got:
{
"code": "INVALID_VERSION",
"message": "API versions should have date format as YYYYMM or YYYYMM.RR where RR is the revision"
}
With the header value being: 2.0.0
So I tried sending as value: 202201.01 ==> YYYY=2022, MM=01, RR=01
YYYY: year
MM: month
RR: revision
Obtaining:
{
"code": "NONEXISTENT_VERSION",
"message": "Requested version 20220101 is not active"
}
Trying some different dates and revision codes, I got to value = 202204.01 that gave me:
{
"serviceErrorCode": 100,
"code": "ACCESS_DENIED",
"message": "Not enough permissions to access: me.GET.20220401"
}

I'm also facing the same issue but you can use this
https://api.linkedin.com/v2/me
and it will work

This version worked for me: 202204.01
Then I got:
"code": "EMPTY_ACCESS_TOKEN",
"message": "Empty oauth2 access token"
Which I think can be fixed by getting the access token by implementing the 3-legged OAuth. I have successfully implemented that for getting someone's profile but I am doing this for getting org info

Related

Getting 400 error while creating "Web Token" when hitting enterprises.webTokens.create endpoint to use iframe in EMM console

We are getting 200 success while hitting endpoints like create signup URL, create enterprise, create enrollment token etc. through API Explorer or Postman. But while we are trying to hit the "create web token" endpoint we are getting 400 error.
We are implementing Google Android Management API. Finally, we are proceeding for implementing iframe which required the web token as it's carrier. But we are failing to do so.
For your reference:
enrollmentTokens.create endpoint Link below:
https://developers.google.com/android/management/reference/rest/v1/enterprises.enrollmentTokens/create
In the API explorer we are providing
parent = enterprises/LC00x1u8p0 and selecting Google OAuth 2.0 credentials.
With this much information API Explorer giving 200 success message.
enterprises.webTokens.create endpoint Link below:
https://developers.google.com/android/management/reference/rest/v1/enterprises.webTokens/create
In the API explorer we are providing
parent = enterprises/LC00x1u8p0 and selecting Google OAuth 2.0 credentials.
With this the same information API Explorer giving 400 error. I have posted the error message and unable to understand where is the error coming.
Is our console cloud project need any special supplement for giving access to web token? or what exactly is the lacking that giving this 400 error?
We are failing to understand the error message. Please check the below response.
​{
"error": {
"code": 400,
"message": "domain: \"gdata.CoreErrorDomain\"\ncode: \"INVALID_VALUE\"\nargument: \"tokenSpec.parent\"\ndebug_info: \"code: INVALID_VALUE\\nhttp status: 400\\narguments: [tokenSpec.parent]\\nvalue: \\ncause: com.google.wireless.android.vending.enterprise.common.exceptions.InvalidParameterException: EnterpriseException{httpStatus=400, code=gdata.CoreErrorDomain.INVALID_VALUE, arguments=[tokenSpec.parent]}\\n\\tat com.google.wireless.android.vending.enterprise.common.exceptions.InvalidParameterException$Builder.build(InvalidParameterException.java:60)\\n\\tat com.google.wireless.android.vending.enterprise.business.EmbeddedUiServiceImpl.validate(EmbeddedUiServiceImpl.java:173)\\n\\tat com.google.wireless.android.vending.enterprise.business.EmbeddedUiServiceImpl.createWebToken(EmbeddedUiServiceImpl.java:123)\\n\\tat com.google.wireless.android.vending.enterprise.actions.mdmapi.EnterpriseActions$CreateWebTokenAction.execute(EnterpriseActions.java:360)\\n\\tat com.google.apps.framework.request.impl.InterceptorInvocation$Rpc.beforeProceed(InterceptorInvocation.java:147)\\n\\tat com.google.apps.framework.request.impl.InterceptorInvocation.proceed(InterceptorInvocation.java:158)\\n\\tat com.google.apps.framework.request.impl.RpcDispatcher.proceed(RpcDispatcher.java:136)\\n\\tat com.google.apps.framework.request.impl.RpcDispatcher.proceed(RpcDispatcher.java:42)\\n\\tat com.google.apps.framework.request.impl.AbstractDispatcher.doExecuteChainInternal(AbstractDispatcher.java:503)\\n\\tat com.google.apps.framework.request.impl.AbstractDispatcher.doExecuteChain(AbstractDispatcher.java:497)\\n\\tat com.google.apps.framework.request.impl.AbstractDispatcher.execute(AbstractDispatcher.java:331)\\n\\tat com.google.apps.framework.request.impl.AbstractDispatcher.executeAsync(AbstractDispatcher.java:254)\\n\\tat com.google.apps.framework.request.impl.RpcDispatcher.handleRpc(RpcDispatcher.java:126)\\n\\tat com.google.apps.framework.request.impl.RpcScopedHandlerFactoryImpl.run(RpcScopedHandlerFactoryImpl.java:276)\\n\\tat com.google.apps.framework.request.impl.RpcScopedHandlerFactoryImpl$2.handleRequest(RpcScopedHandlerFactoryImpl.java:126)\\n\\tat com.google.net.rpc3.impl.server.RpcServerInterceptor2Util$RpcApplicationHandlerAdaptor.handleRequest(RpcServerInterceptor2Util.java:82)\\n\\tat com.google.net.rpc3.impl.server.RpcServerInternalContext.runRpcInApplicationWithCancellation(RpcServerInternalContext.java:672)\\n\\tat com.google.net.rpc3.impl.server.RpcServerInternalContext.lambda$runRpcInApplication$0(RpcServerInternalContext.java:637)\\n\\tat io.grpc.Context.run(Context.java:536)\\n\\tat com.google.net.rpc3.impl.server.RpcServerInternalContext.runRpcInApplication(RpcServerInternalContext.java:637)\\n\\tat com.google.net.rpc3.impl.server.RpcServerChannel$4.apply(RpcServerChannel.java:1026)\\n\\tat com.google.net.rpc3.impl.server.RpcServerChannel$4.apply(RpcServerChannel.java:996)\\n\\tat com.google.common.util.concurrent.AbstractTransformFuture$TransformFuture.doTransform(AbstractTransformFuture.java:253)\\n\\tat com.google.common.util.concurrent.AbstractTransformFuture$TransformFuture.doTransform(AbstractTransformFuture.java:243)\\n\\tat com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:124)\\n\\tat com.google.common.context.ContextRunnable.runInContext(ContextRunnable.java:89)\\n\\tat com.google.common.context.ContextRunnable$1.run(ContextRunnable.java:78)\\n\\tat io.grpc.Context.run(Context.java:536)\\n\\tat com.google.tracing.GenericContextCallback.runInInheritedContext(GenericContextCallback.java:75)\\n\\tat com.google.common.context.ContextRunnable.run(ContextRunnable.java:74)\\n\\tat java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)\\n\\tat java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)\\n\\tat com.google.apps.framework.server.AbstractThreadPoolModule$InitializingThreadFactory.lambda$newThread$0(AbstractThreadPoolModule.java:416)\\n\\tat java.base/java.lang.Thread.run(Unknown Source)\\n\\n\"\n",
"status": "INVALID_ARGUMENT"
}
}
Thanks you very much for your attention. Any help to fix the issue is appreciable.
You need to supply the Request body of the enterprises.webTokens.create method. The request body contains an instance of WebToken.
Request body:
{
"parentFrameUrl": "<the URL of the page that will be hosting the iFrame>",
"enabledFeatures": [
"PLAY_SEARCH",
"PRIVATE_APPS",
"WEB_APPS",
"STORE_BUILDER"
],
"permissions": [
"APPROVE_APPS"
]
}
If successful, the response body contains a newly created instance of WebToken containing the value you need to embed the iFrame on the hosting page.

Crashlytics + Jira integration. Failed to verify credentials (400)

I'm trying to integrate jira with firebase by this guide https://support.google.com/firebase/answer/9118259?hl=en but I'm unable to setup the integration.
Entered jira project URL as https://[workspace-name].atlassian.net/projects/[project-key]
Entered email
Entered JIRA token
Click on Verify & Save
Progress appears and nothing. I checked chrome console and I see failed request to https://firebaseextensions-pa.clients6.google.com/v1/service_provider_values
Request body contains data from form (url, email, token). Response is
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"status": "INVALID_ARGUMENT"
}
}
Any thoughts?
So I contacted Firebase support and we found that the reason is required/mandatory fields of 'Bug' issue at my Jira project. Firebase will provide only summary and description of issue so if you have additional required filed like Environment or custom field then firebase will not setup integration with Jira.
"Unfortunately, if you have a custom field that's marked as required or mandatory, we won't be able to fill it on your behalf."
TLDR;
You have 2 options to get rid of this Error.
Make all the items/custom items in your JIRA Project's 'Bug' Issue Optional (https://community.atlassian.com/t5/Jira-questions/Making-Custom-field-required-and-optional/qaq-p/1974194).
Setup Automation to provide default values for Mandatory Fields(https://support.atlassian.com/jira-cloud-administration/docs/configure-a-custom-field/).

401 - Access denied (Microsoft TTS API)

when i try to use Text To Speech i am get he error
{ "statusCode": 401, "message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription." }
i am using tne c# sample of Github: https://github.com/Azure-Samples/Cognitive-Speech-TTS/tree/master/Samples-Http/CSharp
and i am put the key 1 of azure free license:
Keys in Azure
but the message error keep going, someone can help me ?
thanks
Depending on whether you're using the old or the preview version of Speech, you will need to access a different token-issuing endpoint. Based on your experience, you have must an API key for the old 'Bing' flavor, so you should modify the sample code thus:
Authentication auth = new Authentication("https://api.cognitive.microsoft.com/sts/v1.0/issueToken",
"input your key here");

google cloud vision api quickstart error opening file

I am following the following Google Cloud Vision quickstart:
https://cloud.google.com/vision/docs/quickstart
This is using the API Explorer, and I get
Error Opening File
I have created a bucket named vision2018, and checked Share Publicly for the file.
My portion of the request related to the file is:
"image":
{
"source":
{
"imageUri":"gs://vision2018/demo-image.jpg"
}
}
The response I get is:
{
"responses": [
{
"error": {
"code": 5,
"message": "Error opening file: gs://vision2018/demo-image.jpg\"."
}
}
]
}
}
What do I need to specify in order to access files in my GCP storage?
Alternatively, I read other Stack Overflows that talk about GOOGLE_APPLICATION_CREDENTIALS, Simple API Key, and "Create Service account key and download the key in JSON format", ... but these seem to be giving commands in the shell, which this quickstart doesn't even open.
Is there initial setup assumed prior to the quickstart?
I am not ready to call the api from code
You might want to doublecheck your request. I went to the quickstart, replaced the placeholder imageUri with gs://vision2018/demo-image.jpg and it worked just fine. The error message you posted is what would be displayed if you had given gs://vision2018/demo-image.jpg\" instead.
Regarding the second part of your question: these are authentication methods. In this particular case, under Authentication you will find a drop down which lets you chose between API key and Google OAuth 2.0. If you chose the former, you don't need to do anything as a demo key will be used just for the purposes of the quickstart. If you chose OAuth 2.0, a popup will appear prompting you to authenticate with a google account. All in all, what you need to do is follow step-by-step the instructions given by the quickstart.
I was receiving a similar JSON response from the Google Vision API:
"error": {
"code": 7,
"message": "Error opening file: gs://bucket/file.jpg."
}
The fix was to set the GCS file's permission to public-read:
gsutil acl set public-read gs://bucket/file.jpg
Finally I investigated what happened. The problem is that your API token is only grant for process the image (allow right to use OCR engine), but that API is not also for accessing object in GS.
Therefore "message": "Error opening file:
The problem is similar with this post:Authorize Google Cloud Vision API to Google Storage image Maybe the error message is a bit dumb than many years ago.
The solution also mentioned in the answer section, but if you want some thing more clear (expose security side-effect) here it is: Set GCS read-only public
Reason I want to keep using API because it's better for use it in mobile application, we cannot give the OAuth2.0 to any phone. However, still find a way to secure the read-public bucket.

Microsoft-Cognitive topic detection issue

I'm trying to use the topic detection API from Microsoft_cognitive through R and is not working ('mscstexta4r' package, I provided the key to it). My subscription is through my university and I'm using my laptop at home. Could that be the reason of the problem?
Specifically, the error I'm getting is 'Error: mscstexta4r: Not Found (HTTP 404). - { "statusCode": 404, "message": "Resource not found" }'
Please see attached screenshot of my R console. The stoplist that I'm using is a customized one and the data has 760 '.txt' documents of no more than 5KB each one (the total is 225KBScreenshot of R console)
Looks like you have a typo in the URL.
https://westus.api.cognitive.microsoft.com/text**a**/analytics/v2.0/
To submit a job the POST URL should be:
https://westus.api.cognitive.microsoft.com/text/analytics/v2.0/topics
To query for the job status, it’s a GET request to:
https://westus.api.cognitive.microsoft.com/text/analytics/v2.0/operations/{operationId}
See the Text Analytics API reference for more details about the parameters.

Resources