IBM Watson SDK for Go

Erika Dsouza
IBM watsonx Assistant
2 min readNov 16, 2018
IBM Watson + Go

Have your first go at Go with the IBM Watson Go SDK , a wrapper for the IBM Watson APIs. The SDK includes ready to use data structures and takes care of all the underlying HTTP requests including authentication. Using this SDK, developers can now easily integrate Watson services into their applications.

How to install

Use the Go command on the terminal.

go get -u github.com/watson-developer-cloud/go-sdk/...

This will fetch the packages sub-packages and dependencies.

How to Use

First, provision a Watson service by following the steps here. Once you provision a service, you will get credentials which you would use in the following general steps.

Service Dashboard

Now, follow the below general steps in your code:

  1. Import the service package

2. Instantiate the Watson service using the API key obtained above

3. Invoke the API endpoint using the service instance. For a successful response, it will contain the HTTP status code, response headers and API result

4. Handle responses and errors

Ready, Set, Go

Go ahead and explore the various capabilities of IBM Watson services with Go— from quickly building a simple chatbot to tagging and classifying visual content to unlocking hidden value in data to find answers and surface patterns.

There are also a bunch of examples for various services to help you get started. Play with the Go SDK and let us know what you think.

five years, image source https://golang.org/doc/gopher/fiveyears.jpg

--

--