Getting User Anonymous error while accessing api - node.js

I am trying to access an api endpoint and I am getting the following error.The api has been built using node and mongo and hosted in aws. We never used AWS Elastic search service.
{
"Message": "User: anonymous is not authorized to perform: es:ESHttpGet on resource: material-definition"
}
When I hit the browser second time without hard refresh then I get the json data. I can't understand the deep cause.
Any suggestion/hint would be highly appreciated.

Related

Microsoft Graph API, Region is required when request with application permission

I am trying to access Microsoft Graph API to search the list items present in tenant. I am having no problem when GET request is executed for users or groups.
When I post the request for search using HttpClient as described on MS site. I am getting below error.
Failed to call the web API: BadRequest
Content: {"error":{"code":"System.Exception","message":"SearchRequest Invalid (Region is required when request with application permission.)\r\nRegion is required when request with application permission.","target":"","details":null,"warnings":null,"level":"Error","httpCode":400},"Instrumentation":{"TraceId":null}}
I tried with .Net core as well. same error.
If i paste access code on HTML file, calling api for search using Ajax is working fine.
what code i am missing in my c# code.
The reason should be this endpoint you use not support application permission.
Usually this error message is encountered, indicating that application permission is not supported, you can use delegated permissions.

Azure Rest API configuration details

Cloud Connection getting error on Azure, Rest API & Callback API Configuration trying to make but not connecting on it giveing error
Welcome to Stack Overflow! There are a couple ways to call REST APIs in Azure. There is a neat video that explains how to do this via Postman here. Also ensure that the access token being used for Authentication is a valid one in the Authorization header. Refer to this doc to understand the right format.

"TypeError: failed to fetch" for api calls in Wso2 apim store

I have an nodejs api which gives a valid response in postman/browser. Tried to add the api in WSO2 api manager and followed the steps in the tutorials to succesfully publish the api in API Manager. But when created an product and using an auth token to call the created API getting the failed to fetch error as below:
Have tried enabling cors which didnt solve the issue. The api from the apim store isnt hitting the node server api.
Copy and run that URL in a browser tab and accept the certificate. Then try again. It should work.

Internal error message when calling a API Gateway based REST API

Need some help :) I have created a simple AWS API Gateway with a lambda backend just for trying it out. The only response is { "date": "2017-01-01" }, and the only method accepted is GET. When I test the API in the AWS Console it works fine. The response is as expected. But when I try to access it externally I get an Internal error message response. It kind of blows of course. Do I have to setup a elastic IP for this to work? I shouldn't have to add any roles to the API Gateway (I assume) since the role only declares what resources the API Gateway should be allowed to access? Or is there a "external access" role of some kind? Ot do I have to provide any HTTP-header when accessing the API?
Please enable CORS if you accesing API from an external domain. Please see the screenshot below, which shows how to enable CORS

How to access the OEmbed Service in Connections Cloud using the IBM SBT?

Using the IBM SBT, one can easily register and endpoint to connect to IBM Connections Cloud. That way it is easily possible to access the APIs provided by IBM Connections using a local URL that is then proxied to the cloud.
Usage can be done using the provided JavaScript or by just requesting a resource from the locally provided endpoint that is connected to the cloud. While this appears to be working for the vast majority of the documented APIs, it does not for the OEmbed API.
Example: If you have a local Java App Container (like IBM Websphere Liberty Profile) that is running a testapp and has a configured endpoint to your Connections Cloud Organization, you may ask that endpoint to retrieve the users profile service document by requesting: https://localhost/testapp/service/proxy/localhost/profiles/atom/profileService.do.This will retrieve the very same resource as you would receive if you request https://apps.na.collabserv.com/profiles/atom/profileService.do directly.
Other APIs work similarly. Unfortunately the OEmbed API does not. That means, if one would request https://apps.na.collabserv.com/connections/opengraph/form/anonymous/api/oembed?maxHeight=180&maxWidth=180&extended=true&url=http%3A%2F%2Fwww.ibm.com the server returns some JSON as described in the spec. In the same seting as above, a call to https://localhost/testapp/service/proxy/localhost/connections/opengraph/form/anonymous/api/oembed?url=http%3A%2F%2Fwww.ibm.com&maxHeight=180&maxWidth=180&extended=true should return the same result but isn't. Instead the server returns an Error 403: SRVE0295E: Error reported: 403 with a HTTP Status 403.
The response is by the way the same result as one would get if he was trying to use the direct URL unauthenticated against the cloud.
Is there anything that needs to be configured in order to use the OEmbed service via SBT?

Resources