In node-red in ibm cloud. I am able to use the IBM Watson node "assistant workspace manager" to retrieve a particular dialog node. However, I am unable to use the same "assistant workspace manager" to update a dialog node. I keep getting the error message "Invalid Request Body".
It is not a matter of incorrect credentials, because I use the same credentials for both instances.
Below is the code in my functions module that passes the information to my "assistant workspace manager" node so that it can update a dialog node in my watson conversation workspace.
var uptime = msg.payload[1].d.uptime;
var message = "Server uptime is " + uptime + " seconds.";
msg.topic = "";
msg.dialog_node.output.generic[0].values[0].text = message;
msg.payload = msg.dialog_node;
return msg;
I literally took the dialog node that was returned to me and combined it with the message that had the info I wanted to inject, then modified the payload (before attempting to update my dialog node) so that the payload looked exactly like the dialog node that was returned to me (except with the text for the message modified).
I have successfully done this in the past, by manually formatting the msg.payload object similar to the format that it is returned in. I tried that also, but when that didn't work, I attempted this method.
Any advice would be appreciated.
Thanks in Advance.
This is because the underlying Node.JS SDK for watson-developer-cloud has been updated. https://cloud.ibm.com/apidocs/assistant?code=node#update-dialog-node
The JSON that you supply needs to have at least one field with a new_
prefix as a key.
So in this example the condition is being updated:
{
"type":"standard",
"title":"Entry Point For Up Down Commands",
"output":{},
"context":
{
"appl_action":"increase"
},
"next_step":
{
"behavior":"jump_to",
"selector":"condition",
"dialog_node":"node_11_1467233013716"
},
"new_conditions":"#turn_up",
"dialog_node":"Entry Point For Up Down Commands",
"previous_sibling":"node_1_1487022155950"
}
I need to amend the node info tab with this information.