IBM® Watson® is an AI platform that helps businesses to uncover insights, engage in new ways, and make decisions with more confidence. The numerous Watson APIs that are available both analyze and process data. IBM API Connect™ provides a way to control back-end systems, such as the ones you run inside your organization or services that you run on IBM Cloud®.

This tutorial demonstrates how you can expose the Swagger file for IBM Watson as an API in API Connect. By having access to Watson APIs in API Connect, you can control and track usage of how your organization is using Watson.

The steps in this tutorial use the Watson Language Translator API as an example. However, you can use these steps for any Watson APIs.


Get the Swagger file

  1. Go to the Watson API Explorer page.
  2. Under Language, click Language Translat**or**, or go to the Language Translator page.
  3. In the lower-right corner of the page, right-click the VALID {...} button, and click Copy Link.

Load the Swagger file into API Connect

  1. Log in to API Connect.
  2. On the Drafts page, click the APIs tab.
  3. Click Add, and select Import API from a file or URL. Clicking Add to import the API
  4. In the Import OpenAPI (Swagger) box, click the Or import from URL link. Importing the API
  5. In the URL field, right-click, and select Paste.
  6. Remove from the beginning of the URL.
  7. Click the Add a Product check box.
  8. Under Info, set the Product Title field to Watson Language Translator.
  9. Click Import.

Deploy the Watson API in IBM Cloud

  1. Log in to IBM Cloud at:
  2. From the hamburger menu in the upper left corner, select Services and then click Watson to go to Watson Services. Watson Services
  3. On the next page, click Create Watson service.
  4. Click Language Translator. Language Translator
  5. Click Create.
  6. On the next page, under Getting started on the left side, click Service Credentials.
  7. In the right pane, in the Service credentials box (see the following figure), click View Credentials. The URL, user name, and password credentials are required in Step 4. Service credentials

Create the assembly for the API

  1. In API Connect, go to the API that you created in Step 2.
  2. Click Assemble.
  3. Click Create Assembly.
  4. Drag the Proxy Policy from the toolbox to the canvas.
  5. Refer to the Service Credentials that you viewed in Step 3, and set the following details: a. URL b. User name c. Password
  6. Click the Save (disk icon) in the upper-right corner of the window.

If you require more configuration, such as security, you can extend the API in the Design view to add these functions.


Publish the API

  1. In IBM API Connect, on the Drafts tab, click the APIs tab. API Connect menu
  2. Click Language Translator.
  3. Click the Save icon in the upper-right corner. Then, select the catalog that you want to deploy the API into. In this example, the API is deployed to the Sandbox catalog. Deploying the API to the catalog


In this article, you learned how to locate the Watson Swagger file and load it into API Connect. You then created an assembly, deployed a Watson Service, and published it as an API. You can use these same steps for any Watson APIs.

Ready to get started? Use the Language Translator API to translate text from one language to another for specific domains. Then, see how else you can use other Watson services, such as the Tone Analyzer API to analyze the tone of support transcripts or the Watson Assistant API to automate interactions with your users, using virtual agents and chat bots.


The author thanks Dennis Ashby for his review of this article.