Step 2: Verify authentication type
CDK supports multiple authentication types like Basic, Bearer Token, API Key, OAuth2 Authorization Code, OAuth2 Password, OAuth2 Implicit, and OAuth2 Client.
IBM Watson Natural Language Understanding service supports API Key authentication. You have already noted down the API Key in the previous step. There is nothing to do in this step.
Step 3: Add or remove actions
You notice that the Connector Development Kit has created several actions for you using the OpenAPI document you have provided.
By default CDK creates 10 actions, you can click on the Add or remove actions to add additional actions or remove actions that are not applicable for the connector. All the actions that are visible on the pallet will be the available actions of your connector.
To keep the connector simple, lets remove all actions from the pallet and retain only Analyze group of actions.
You will have only Analyze Text (GET) and Analyze Text actions as part of the connector actions.
Analyze Text operation helps you analyze raw text, html or a website. We will use the operation to analyze the emotional quotient of a text to test the connector action later.
Step 4: Configure actions
In this step you will configure both the actions for further improvements. If you notice, the "Anlayze text (GET)" action is marked incomplete. We will make it complete first.
Configure action details
Select the display name field on the action details tab, you will notice that CDK is throwing an error. CDK does not allow non alphanumeric characters in the display name. Lets change the display name value to "Analyze text GET". Now, change the action type to "Retrieve" as this is simple GET operation and returns a single record. The action shall be marked complete now. You can further format the action description if you are not happy with the text.
Configure Request and Response properties
Navigate to the Request tab to configure the request properties for the action. As this a Retrieve action, you need to configure request query parameters. You can keep all of the query parameters as is or you can remove some of them to make connector precise and concise. Click on "Add or remove" on Query parameters to unselect of the parameters from the actions.
You can now go to other action "Analyze text" and modify display name and description if required. Navigate to Request tab, you can configure the request properties for your action. Click on "Add or remove" on Properties section to remove properties that are not relevant for the connector.
After removing unwanted properties you can now set the display order of these properties. You can move important and required properties to the top of the request set and less important properties to the bottom. This helps connector users to configure the connector action quickly when used in an integration flow.
Similar to request tab, you can configure the response properties. But, you can't change the display order of the response properties.
Your connector is complete and ready for testing.
Step 4: Testing actions
CDK has in-built test runtime that helps you quickly test the connector without moving to App Connect. Click on Test tab to test your connector actions. It is mandatory to provide connection details before testing your actions. Click on connect button to create a connection.
In order to connect to IBM Watson NLU service you need to provide API key you noted down previously.
The IBM Watson NLU service expects you to pass API Key in the Authorization header as BASIC Authentication type. For that you need to generate the Base64 encoded string of 'apikey:<apikey_value>
'. You can easily generate Base64 encoded string through internet. Read more about how to authenticate to a Watson Service here
In the connection screen provider following values
Provide API key field with the value Basic <Base64encoded string>
Provide the instance URL of your IBM Watson NLU service instance that you noted down in the prerequisite section in the 'Override server URL
' field.

Once you connected successfully to the service, you can now see all your actions in the Test tab. Lets try testing "Analyze text GET" action.
Lets try to analyze a text for emotional quotient using the action you have just developed. Here are values you need to fill in for the request parameters in the test tab and click on Submit. You will get back the emotion rating for the text you provided to the action.
The current IBM Watson NLU version is '2022-04-07
'
The successful test results indicate that the connector is able to successful connect to your NLU service and invoke the operation on it.
Step 5: Download connector
Now that your connector is complete and tested, you can download it as a private connector to use it in IBM App Connect. You can use the connector in both App Connect on AWS cloud and CP4I.
Click on download connector option to download the connector.