watson-developer-cloud / dialog-tool

DEPRECATED: this repo is no longer actively maintained
Apache License 2.0
60 stars 106 forks source link

what is dialog_id #28

Closed srijack closed 8 years ago

srijack commented 8 years ago

Hi

Im following the steps given in GitHub. One of the steps says - $ cf se application-name DIALOG_ID dialog-id

And it also says - If you don't have a dialog_id you can create one using the dialog-tool

but - I'm not able to understand what is dialog_id or how to really create dialog_id- If it exists what can I locate it ? Please help me. Thanks-

germanattanasio commented 8 years ago

The dialog_id is something like: 9feb4349-bf69-43e6-bbd3-92b317e2ff31 and identifies your dialog flow.

When using the Dialog service you need to specify a dialog id. Take a look at this tutorial on how to use the service.

You should be able to create a dialog id using curl

curl -u "{username}":"{password}" \
  -X POST
  --form file=@template.xml
  --form name=templateName
  "https://gateway.watsonplatform.net/dialog/api/v1/dialogs"

Where template.xml is an xml file describing your dialog.
Example: https://github.com/watson-developer-cloud/dialog-tool/blob/master/dialogs/pizza_sample.xml

germanattanasio commented 8 years ago

See more info here https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/dialog/api/v1/#create-dialog

srijack commented 8 years ago

Thank you -

Why am I getting this warning.

C:\bluemix\dialog\dialog-nodejs-master>npm install

DialogNodejsStarterApp@0.1.8 postinstall C:\bluemix\di alog\dialog-nodejs-master node dialogs/install-dialogs.js

WARNING: Missing credentials or VCAP_SERVICES. Not installing dialog files

germanattanasio commented 8 years ago

if you deploy the sample application in bluemix it will create the dialog automatically but you need to make sure you have a dialog-service and it's bound to your app

On Sun, Mar 27, 2016 at 5:33 PM srijack notifications@github.com wrote:

Thank you -

Why am I getting this warning.

C:\bluemix\dialog\dialog-nodejs-master>npm install

DialogNodejsStarterApp@0.1.8 postinstall C:\bluemix\di alog\dialog-nodejs-master node dialogs/install-dialogs.js

WARNING: Missing credentials or VCAP_SERVICES. Not installing dialog files

— You are receiving this because you were assigned.

Reply to this email directly or view it on GitHub https://github.com/watson-developer-cloud/dialog-tool/issues/28#issuecomment-202148331

srijack commented 8 years ago

Hi I have bound the service to the app. But still credentials are not recognized.

console.log(credentials.username); console.log(credentials.url); if (credentials && credentials.username) { dialogService.getDialogs(credentials, getDialogsCb); } else { console.warn('WARNING: Missing credentials or VCAP_SERVICES. Not installing dialog files.'); ======result==== C:\bluemix\dialog\dialog-nodejs-master\dialogs>node inst all-dialogs1.js srinath undefined undefined

WARNING: Missing credentials or VCAP_SERVICES. Not installing dialog files.

I tried logging credentials - seems like - it is not fetching .. Can you please help me finding this - from where - install-dialog.js gets credentials from - and what credentials are these.

germanattanasio commented 8 years ago

in the install-dialog.js replace

updateDialogFiles(bluemix.getServiceCreds('dialog'));

with:

updateDialogFiles({
  username: "USERNAME",
  password: "PASSWORD",
  version: 'v1'
});

where USERNAME and PASSWORD are your service credentials

srijack commented 8 years ago

Thank you so much - it worked. I can now experiment.