-
Notifications
You must be signed in to change notification settings - Fork 37
Configure your Dialog service with IBM's Dialog XML
Obtain your NLC service credentials by following these steps to display Bluemix service credentials from the command line or by going through the Bluemix admin tool.
Next, We push our dialog file to the Dialog service bound to the app. The dialog file for this application is packaged with the project at /dialog/ipa-v1.xml. Use the following command to upload this file to Bluemix. Replace <unique_dialog_name>
with the globally unique dialog name that you entered into public/javascript/ipaRemote.js.
curl -X POST -F "file=@dialog/ipa-v1.xml" -F "name=<unique_dialog_name>" https://gateway.watsonplatform.net/dialog/api/v1/dialogs -u "<username>:<password>"
Adjust the path to your dialog file as necessary. Replace <username>
and <password>
with the username
and password
credentials for the Dialog service from the prior step..
Warning: Do not forget the @ symbol after the equals sign in the file=@dialog/ipa-v1.xml
parameter.
If the upload is successful, you will get a response which looks like the following.
{"dialog_id": "4ff28b26-63ef-492f-902d-86a467f50040"}
We're ready to push the app to Bluemix.
ADDITIONAL INFORMATION
View all Dialog files uploaded to your service using this command:
curl -X GET https://gateway.watsonplatform.net/dialog/api/v1/dialogs -u "<username>:<password>"
The response with available dialogs looks like the following:
{"dialogs":[{"name":"<unique_dialog_name>", "dialog_id":"3d19efa8-4ba6-4ab4-a9a7-9e531c283935"}]}
Delete Dialog files using this command (after replacing the <dialog_id>
):
curl -X DELETE https://gateway.watsonplatform.net/dialog/api/v1/dialogs/<dialog_id> -u "<username>:<password>"
Explore the Dialog Services's REST APIs. We also have a Swagger version of the the NLC API.
I hope to come back and write a detailed explanation of the dialog.xml file. To get started though, walk through the Watson Dialog tutorial and also review the various XML elements in the dialog XML schema.