IBM Watson Chatbot unable to connect to server - ibm-watson

I am trying to integrate a Chatbot on my website. I followed this tutorial to set up the Watson Chatbot.
The bot is working as expected on the IBM cloud platform. And all my credentials are correct to set up the env.
However when I run the chatbot in my localhost:3000, I am not able to connect to the server. When I try to post a message to the bot for some reason I can not connect to the server and generate a session id.
this is the input JSON:
{
"session_id": null,
"input": {
"message_type": "text",
"text": "covid"
}
}
And the console is giving me this message: Uncaught TypeError: Cannot read property 'session_id' of undefined.
Would anyone know what could have gone wrong in my app?
Thanks.

Related

Connect react native with my dialogflow account

I am creating this application currently following this tutorial
When I send a message in the chatbot, the onSend function works, however, I get an error with my chatbot's response and I am given this error in the console.
Received response:
{
"error":{
"code":401,
"message":"Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie, or another valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
"status":"UNAUTHENTICATED"
}
}
Can anyone help?
I have tried to see if my Google cloud APIs and services status is active and checked if my credentials have been revoked in IAM & Admin, still, the same error is returned in my console

Cannot connect to Coinbase Extension via the #web3-react/walletlink-connector

I am trying to connect to the coinbase extension via the wallet link connector's instance, new WalletLinkConnector, but I cannot even get the extension's popup open. I am following the exact tutorial on the official docs. The connection with the metamask works fine but it fails with the coinbase. Here is the screenshot of the error I am getting in console.log
Here is the connector code I am using
export const Walletlink = new WalletLinkConnector({
url: "https://rinkeby.infura.io/v3/<my-api-key>",
appName: "demo",
});
I am calling this WalletLink via the activate method of the useWeb3React(). Any solution will be greatly appreciated.
This maybe happen in non https websites in my experience.
Did you try to connect in SSL website (https)?

Microsoft bot builder framework AWS API gateway

Could you please let me know if we can use Lambda function inside AWS gateway and Microsoft Bot Framework REST API principles for the bot framework with "Single tenant" type
When we use multi tenant, the API works like a charm. The moment it is changed to single tenant type in the app, we get error when replying to the conversation:
{
"message": "Authorization has been denied for this request."
}
Note: I we are able to generate the access token, but when post the response on service URL throws an error :https://smba.trafficmanager.net/v3/conversations//activities/

OpenWhisk (CloudFunction) binding to Watson Conversation and the use of username password in the SDK

I have an IBM Cloud Function (OpenWhisk) that invokes a Watson Conversation Service.
We are using JAVA
The documentation of the JAVA SDK (https://github.com/watson-developer-cloud/java-sdk ) suggests that the credentials would be picked up from the binding.
When I list the bindig I get this:
>bx wsk action get talksmall parameters
ok: got action talksmall, displaying field parameters
[
{
"key": "__bx_creds",
"value": {
"conversation": {
"credentials": "Credentials-SmallTalk",
"instance": "<INSTANCE>",
"password": "<PASSWORD>",
"url": "https://gateway.watsonplatform.net/conversation/api",
"username": "<USERNAME>"
}
}
}
]
But when I use the SDK like this:
Conversation conversationService = new Conversation(Conversation.VERSION_DATE_2017_05_26);
I get an error
{
"error": "An error has occured while invoking the action (see logs for details): java.lang.IllegalArgumentException: apiKey or username and password were not specified"
}
When I add the line:
conversationService.setUsernameAndPassword(userName, password);
It works.
Maybe the VCAP_Service way of binding does not work with Cloud Functions ?
The Cloud Function runs in the same IBM Cloud organization and space.
I opened an issue against the SDK documentation which talks about "running in Bluemix". IBM Cloud offers infrastructure, OpenWhisk / Cloud Functions, Cloud Foundry and more. Bluemix originated from Cloud Foundry and the automatic binding via VCAP_SERVICE is a Cloud Foundry feature.
From my experience with using IBM Cloud Functions with Python and Node.js you need to call the API functions to set credentials explicitly. With the feature of service binding you can easily make credentials of provisioned services available to the context within IBM Cloud Functions as successfully shown in your code above.

"Access not configured" when accessing google cloud endpoints from web app

I wrote a webapp with angularjs frontend, google app engine for storing data, and google cloud endpoints for api access from the frontend client. I tested everything fine locally, but after deploying, accessing the api from the frontend javascript client gives me the following error:
[
{
"error": {
"code": 403,
"message": "Access Not Configured",
"data": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured"
}
]
},
"id": "gapiRpc"
}
]
I've checked the production api explorer after deployment and it works fine. Also, I tried directly accessing the api by URL which also works fine. Just the frontend client does not work. Any ideas?
Turns out I set the API key in the client with gapi.client.setApiKey(API_KEY); where the API Key is the browser key from the cloud console. I removed this and it works fine. I have no idea what the API key is for.
I'm looking at the problem now on one of my projects. Might be that the ipv6 address must be registered for the project. Take a look at this post Google API returning Access Not Configured
The usual reason for this is that the API, which is being queried is not yet enabled in Google Console by the time of the request. Once it is turned on - error goes away.

Resources