2

I have referred to this documentation but have not come across any API call to create Watson programmatically using the Java SDK. Is it possible to do so, or is the only way via importing the JSON file? Thank you!

zzamp
  • 31
  • 3

1 Answers1

1

Check out the workspaces endpoint documented here: https://cloud.ibm.com/apidocs/assistant#create-workspace

You can use it to create a workspace (which is a "Skill" in the updated Watson Assistant vocabulary), and from there you can use the other API endpoints to manipulate things further (creating/modifying intents, entities, dialog, etc.).

And, of course, you can use the Java SDK to make such API calls to create and manage workspaces as needed.

If you have existing JSON that you want to use when you create the Watson Assistant workspace/skill, you could pass that in the POST data using the above API call. Otherwise you can create a bare-bones workspace sending the minimal information in the sample call on that page:

{
  "name": "Your new Watson Assistant",
  "description": "Your description",
  "language": "en",
  "intents": [],
  "entities": [],
  "dialog_nodes": []
}
newbold
  • 259
  • 1
  • 5
  • Appreciate your quick response! :) This documentation is for v1, is there a support for v2? The [v2](https://cloud.ibm.com/apidocs/assistant-v2#data-handling) documentation is quite empty. I'm also not sure if some of the codes in v1 have been deprecated or I did not install the v1 dependencies because the exact codes I took from the documentation is not fully working as well. Thank you – zzamp Sep 04 '19 at 15:26
  • 1
    The v1 vs. v2 labeling is a bit confusing. v2 doesn't replace v1, but rather only a part of it (specifically related to context/session management). Everything else in v1 is still active and doesn't yet have any equivalent in v2. All of the endpoints used to manipulate exist in v1 (only). – newbold Sep 04 '19 at 23:08