1
votes

I'm trying to connect IBM Cloud Functions with a Watson Assistant dialog as web_action. So I have specified web_action as following in watson dialog json editor.

"actions": [
    {
      "name": "[email protected]_dev/default/callKinvey",
      "type": "web_action",
      "parameters": {
      },
      "credentials": "$private.mycredential",
      "result_variable": "context.my_input_returned"
    }
  ]

Now, the issue is while testing assistant I'm getting following error

Internal error: Content-type can not be retrieved. (and there is 1 more error in the log)

enter image description here

Following is my function that is created on IBM-cloud and enabled for Web Action:

/**
  *
  * main() will be run when you invoke this action
  *
  * @param Cloud Functions actions accept a single parameter, which must be a JSON object.
  *
  * @return The output of this action, which must be a JSON object.
  *
  */
function main(params) {
    return { message: 'Hello World' };
}

CURL of my function is:

curl -u API-KEY -X POST https://us-south.functions.cloud.ibm.com/api/v1/namespaces/[email protected]_dev/actions/callKinvey?blocking=true
1
Please refer to the detailed answers to these very similar questions - stackoverflow.com/questions/51357554/… and developer.ibm.com/answers/questions/458474/… - chughts

1 Answers

2
votes

The easiest way to solve this type of error is to append .json to your endpoint.