0
votes

I am searching for the credentials to access my cloud function from Watson assistant. Both are in Dallas region.

I have looked at various docs and blogs, all looks obsolete. I could not find the credentials that could work in Watson Assistant.

Below is one example location where i could not find credentials: https://developer.ibm.com/recipes/tutorials/connect-watson-assistant-with-wikipedia-api-via-cloud-functions/

enter image description here

Could someone provide me steps or link to find or generate credentials?

More trials added

https://cloud.ibm.com/docs/services/assistant?topic=assistant-dialog-actions above link provide another link that is supposed to show me credentials but no success enter image description here

Note: I can see CF-based API key for the namespace in London but not in Dallas on link -- https://cloud.ibm.com/functions/namespace-settings

Namespace

enter image description here

Below is a part of Watson json.

"actions": [
    {
      "name": "Namespace-Y1N/irs/helloworld",
      "type": "cloud_function",
      "parameters": {
      },
      "credentials": "$private.my_creds",
      "result_variable": "$my_result"
    }
  ]

Below is the cloud function enter image description here

3

3 Answers

2
votes

Well, the official IBM Watson Assistant docs on creating programmatic calls have that information. Look for <reference_to_credentials>. There are instructions on how to access Cloud Functions and extract the API key. Some of that is not needed if working with web actions.

The official tutorial on how to build a database-driven Slackbot with Watson Assistant also offers a way on integrating those credentials once for multiple dialog nodes. It uses a "credential node" to manage the info on how to access Cloud Function actions.

Note that Cloud Functions have the old Cloud Foundry-based namespaces and the new IAM-based namespaces. You can only see the authentication key for the Cloud Foundry namespaces. It seems that your Dallas namespace is new and IAM-enabled.

As an alternative, use the IBM Cloud CLI, log in to your org / space or namespace and then use this command to obtain the Cloud Function properties including the authentication key:

ibmcloud fn property get --auth
0
votes

Create a new API key. Select Menu(Top-left), Manage, Access (AIM), IBM Cloud API Keys. Create an IBM Cloud API Key, then make sure that you save it somewhere because you will never see the key again. I hope that will help.

0
votes

Your namespace "Namespade-Y1N" in Dallas is a IAM-enabled namespace. Server-based actions in dialog node of Watson Assistant does not support IAM based authentication. It can only work with CF based namespaces and CF based Cloud foundry functions. This is restriction of Watson Assistant.