vania-janet/multiturn-rag-retrieval-data huggingface dataset:
You cannot use a webhook to call a Cloud Functions action that uses token-based Identity and Access Management (IAM) authentication. However, you can make a call to a secured Cloud Functions web action. For more information, see [Calling an IBM Cloud Functions web action](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-webhooksdialog-webhooks-cf-web-action).

For information about how to call a client application, see [Calling a client application from a dialog node](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-actions-client).

![Plus or higher plans only](https://cloud.ibm.com/docs-content/v1/content/417db917d18067d9dcc4cf2612564a9a87c3ddc8/assistant/images/plus.png) For environments where private endpoints are in use, keep in mind that a webhook sends traffic over the internet. For more information, see [Private network endpoints](https://cloud.ibm.com/docs/assistant?topic=assistant-securitysecurity-private-endpoints).



 Defining the webhook 

You can define one webhook URL for a dialog skill, and then call the webhook from one or more dialog nodes.

The programmatic call to the external service must meet these requirements:



* The call must be a POST HTTP request.
* The request body must be a JSON object (Content-Type: application/json).
* The response must be a JSON object (Accept: application/json).
* The call must return in 8 seconds or less. If invoked more than once in a single message call through [dialog nodes](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-webhooksdialog-webhooks-dialog-node-callout), all of those invocations must return in 8 seconds or less.
Using Kafka console tools with Event Streams 

Apache Kafka comes with various console tools for simple administration and messaging operations. You can use many of them with Event Streams, although Event Streams does not permit connection to its ZooKeeper cluster. As Kafka developed, many of the tools that previously required connection to ZooKeeper no longer have that requirement.

These console tools are in the bin directory of your Kafka download. You can download a client from [Apache Kafka downloads](http://kafka.apache.org/downloads).

To provide the SASL credentials to these tools, create a properties file based on the following example:

sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="USER" password="PASSWORD";
security.protocol=SASL_SSL
sasl.mechanism=PLAIN
ssl.protocol=TLSv1.2
ssl.enabled.protocols=TLSv1.2
ssl.endpoint.identification.algorithm=HTTPS

Replace USER and PASSWORD with the values from your Event Streams Service Credentials tab in the IBM Cloud console.



 Console producer 

You can use the Kafka console producer tool with Event Streams. You must provide a list of brokers and SASL credentials.

After you created the properties file, you can run the console producer in a terminal as follows:

kafka-console-producer.sh --broker-list BOOTSTRAP_ENDPOINTS --producer.config CONFIG_FILE --topic TOPIC_NAME

Replace the following variables in the example with your own values:



* BOOTSTRAP_ENDPOINTS with the value from your Event Streams Service Credentials tab in the IBM Cloud console.
* CONFIG_FILE with the path of the configuration file.



You can use many of the other options of this tool, except for those that require access to ZooKeeper.





 Console consumer 

You can use the Kafka console consumer tool with Event Streams. You must provide a bootstrap server and SASL credentials.

After you created the properties file as described previously, run the console consumer in a terminal as follows:
Managing a SOAP service 

Duration: 15 mins Skill level: Beginner



 Objective 

Use the API Connect V5 API Manager to create a SOAP API that is a proxy for a SOAP-based weather service.





 Prerequisites 



* [Set up your API Connect instance](https://cloud.ibm.com/docs/apiconnect/tutorials?topic=apiconnect-tut_prereq_set_up_apic_instance).
* Copy the [weatherprovider.wsdl test](https://raw.githubusercontent.com/IBM-Bluemix-Docs/apiconnect/master/tutorials/weatherprovider.wsdl) file to your local file system.

Click Raw and then save the page on your local system as a .wsdl file.







 Setting up a SOAP API definition 



1. Log in to IBM Cloud: [https://cloud.ibm.com](https://cloud.ibm.com).
2. In the IBM Cloud Dashboard, click Cloud Foundry Services.
3. Launch the API Connect service.
4. In API Connect, make sure the navigation panel on the left side is open. If not, click >> to open it.
5. Select Drafts in the navigation panel.
6. In the menu, select API from a SOAP service. ![New API](https://cloud.ibm.com/docs-content/v1/content/78bb71851d95d7580503eb9ba10cf3ae31490ade/apiconnect/tutorials/images/newapi-menu2.png)
7. The New API from WSDL dialog box opens. Click Upload File. !
To authenticate with a service's API by using an API key, complete the following steps:



1. First, [create an IBM Cloud API key](https://cloud.ibm.com/docs/account?topic=account-userapikeymanage-user-keys) if you have not already.
2. Send the IBM Cloud API key as defined in [RFC 7617](https://tools.ietf.org/html/rfc7617) as HTTP header “Authorization”. Use apikey as the user name, and the API key value as the password.



As an example, the following steps assume that the API key is 0a1A2b3B4c5C6d7D8e9E:



1. Concatenate the user name apikey and the API key that is separated by a colon: apikey:0a1A2b3B4c5C6d7D8e9E
2. Base64 encode the string: base64("apikey:0a1A2b3B4c5C6d7D8e9E") => YXBpa2V5OjBhMUEyYjNCNGM1QzZkN0Q4ZTlF
3. Set the HTTP header Authorization with schema Basic, for example Authorization: Basic YXBpa2V5OjBhMUEyYjNCNGM1QzZkN0Q4ZTlF.





* Curl
* Java
* Python
* Go
* Node



curl -u "apikey:<IBM Cloud API key value>"

import com.ibm.cloud.sdk.core.security.BasicAuthenticator;
import <sdk_base_package>.ExampleService.v1.ExampleService;
...
// Create the authenticator.
BasicAuthenticator authenticator = new BasicAuthenticator.Builder()
.username("myuser")
.password("mypassword")
.build();

// Create the service instance.
For more information, see [Network types](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-restrict_accessnetwork_type).





 Establishing a connection 

To connect a Kafka application, complete the following tasks.



* Use the <bootstrap_endpoints> field from the service key as the bootstrap.servers property of your Kafka application.
* Set the security.protocol property to SASL_SSL and the sasl.mechanism property to PLAIN.
* Use the <user> field from the service key as the username and the <api_key> field from the service key as the password. Ensure that your application parses the details.
* For more information, see [Configuring your Kafka API client](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-kafka_usingkafka_api_client).



To call an HTTP API, complete the following tasks.



* Use the <kafka_admin_url> field of the service key as the base URL for HTTP requests.
* Use the IBM Cloud CLI ibmcloud iam oauth-tokens command to generate an auth token. Place this token in the Authorization header of the HTTP request with the value formatted as Bearer <token>. Both API key or JWT tokens are supported.
* Further documentation is provided for each API.



* [REST Admin API](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-admin_api)
* [REST Producer API](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-rest_producer_using)
* [Schema Registry API](https://cloud.ibm.com/docs/EventStreams?topic=EventStreams-ES_schema_registryschema_registry_rest_endpoints)









 Network connectivity 

For the Satellite plan, the network connectivity depends on the infrastructure that is used and is therefore the responsibility of the user.
You can use the UI, [CLI](https://cloud.ibm.com/docs/vpc?topic=vpc-connect-to-ESXi-bare-metal-serversconnect-to-vnc-console-cli), or [API](https://cloud.ibm.com/docs/vpc?topic=vpc-connect-to-ESXi-bare-metal-serversconnect-to-vnc-console-api) to connect to a VNC console.



 Connecting to a VNC console by using the UI 



1. In the [IBM Cloud console ![External link icon](https://cloud.ibm.com/docs-content/v1/content/f02b9c9adcbb7328d95a45e105cec371d50f15eb/icons/launch-glyph.svg)](https://cloud.ibm.com), go to Menu icon ![Menu icon](https://cloud.ibm.com/docs-content/v1/content/icons/icon_hamburger.svg) > VPC Infrastructure > Compute > Bare metal servers
2. Click the overflow icon of the target bare metal server, then click Open VNC Console.







 Connecting to a VNC console by using the CLI 



1. Run the following command to connect to a console:

ibmcloud is bare-metal-server-console $bare_metal_server_id --vnc

The access token is invalid after 3 minutes.
2. Save the value of "href" in the response.
3. Open the [noVNC portal ![External link icon](https://cloud.ibm.com/docs-content/v1/content/f02b9c9adcbb7328d95a45e105cec371d50f15eb/icons/launch-glyph.svg)](https://novnc.com/noVNC/vnc.html) in a browser.
4. Click Setting, then expand Advanced > WebSocket.
--------------------





 Add a new OpenAPI spec to create a REST API proxy 



1. Log in to IBM Cloud: [https://cloud.ibm.com](https://cloud.ibm.com).
2. In the IBM Cloud Dashboard, click Cloud Foundry Services. Launch the API Connect service.
3. In API Connect, make sure that the navigation panel is open. If not, click >> to open it.

![cloud-apic-dashboard.png](https://cloud.ibm.com/docs-content/v1/content/78bb71851d95d7580503eb9ba10cf3ae31490ade/apiconnect/tutorials/images/cloud-apic-dashboard.png)
4. Select Drafts in the navigation panel.
5. In the APIs tab, click Add > New API.
![cloud-add-api-new.png](https://cloud.ibm.com/docs-content/v1/content/78bb71851d95d7580503eb9ba10cf3ae31490ade/apiconnect/tutorials/images/cloud-add-api-new.png)
6. In the New API window, enter New Weather Provider API for the title. The Name and Base Path are auto-populated.
![bluemix-add-new-api2.png](https://cloud.ibm.com/docs-content/v1/content/78bb71851d95d7580503eb9ba10cf3ae31490ade/apiconnect/tutorials/images/bluemix-add-new-api2.png)
7. Click Create API to complete the wizard.
8. After you create your API, the Design tab is selected.
9. Scroll to the Host panel. Enter $(catalog.host) as the value if the field is not automatically completed.
Supported SSL protocols: TLS 1.2, TLS 1.3 ([draft version 18](https://datatracker.ietf.org/doc/html/draft-ietf-tls-tls13-18))





 Altering the response content of web action 

You can alter the response content of a web action to return different content types by using [Content extensions](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions_webactions_web_extra).

Before you begin

Create the demo package and hello web action by completing the steps in [Creating a web action](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-actions_webactions_web_example).

To alter the response of a web action:



1. Save the following code as hello.js.

function main(params) {
return { response: params };
}
2. Update your hello web action with the new version of your hello.js code. Replace <filepath> with the file path of your hello.js file.

ibmcloud fn action update demo/hello <filepath>/hello.js --web true
3. Test the action in your browser or by using a cURL command. Replace the <apihost> and <namespace_ID> variables.

a. Return JSON by either:

* Opening https://<apihost>/api/v1/web/<namespace_ID>/demo/hello.json in your web browser.

* Running the following cURL command.

 {: pre}
curl https://<apihost>/api/v1/web/<namespace_ID>/demo/hello.json

* Running the following wget command.

 {: pre}
wget https://<apihost>/api/v1/web/<namespace_ID>/demo/hello.json


Example output

{
"response": {
Enter a valid U.S. zipcode (e.g. 10504) in the test box. ![test-explore-2.png](https://cloud.ibm.com/docs-content/v1/content/78bb71851d95d7580503eb9ba10cf3ae31490ade/apiconnect/tutorials/images/test-explore-2.png)
6. Click Call operation to see the response.

![test-explore-3h.png](https://cloud.ibm.com/docs-content/v1/content/78bb71851d95d7580503eb9ba10cf3ae31490ade/apiconnect/tutorials/images/test-explore-3h.png)







 Conclusion 

In this tutorial, you saw how an existing REST service can be invoked through an API passthrough proxy. You started by checking the availability of the sample service through the web browser. Then you created an API proxy in API Connect, and linked the proxy to the sample service to be invoked. You packaged your API into a product, published the product to catalog, and tested the proxy.

--------------------







 Next step 

Secure your API using [OAuth 2.0](https://cloud.ibm.com/docs/apiconnect/tutorials?topic=apiconnect-tut_secure_oauth_2).

Create > Manage > Secure > Socialize > Analyze
The web preview opens at a URL that's the equivalent to http://localhost:<port>. To view another endpoint, add the path to the web preview URL.

For example, the Node.js sample app outputs the following URLs:

App UI available http://localhost:3000
Swagger UI available http://localhost:3000/swagger/api-docs

To view the Swagger UI, add /swagger/api-docs to the web preview URL:

https://p3000-abcd1234-ef56-a1b2-b122-a122560ba24f.dp3.us-south.shell.cloud.ibm.com/swagger/api-docs
"provisioning_status": "active",
"proxy_protocol": "disabled"
}
6. Wait until the NLB is in an active state, then add a listener.

The port range for the listener must be defined as follows:



* port_min is 1
* port_max is 65535



Create an API request payload using the following template:

{
  "default_pool": {
"id": "r014-0b8f4cde-4684-484b-bd3c-64f55a917328"
},
"port_min": 1,
"port_max": 65535,
"protocol": "tcp"
}

Run the following command:

curl -s -H "Authorization: Bearer $IAM_TOKEN" -X POST -d @create_vnf.json "https://us-east.iaas.cloud.ibm.com/v1/load_balancers/r014-020f4f34-bb49-4699-98a7-a53384cd649d/listeners?version=2021-07-30&generation=2" | jq

Sample output:

{
"id": "r014-0ce87b15-9530-4624-a574-92495631f75d",
"href": "https://us-east.iaas.cloud.ibm.com/v1/load_balancers/r014-020f4f34-bb49-4699-98a7-a53384cd649d/listeners/r014-0ce87b15-9530-4624-a574-92495631f75d",
"protocol": "tcp",
"port": 1,
"port_min": 1,
"port_max": 65535,
"default_pool": {
user String Your Event Streams username. 
 password String Your Event Streams password. 
 topic String The topic that you want the trigger to listen to. 
 kafka_admin_url URL string The URL of the Event Streams admin REST interface. 
 isJSONData Boolean (Optional - default=false) When set to true, the provider attempts to parse the message value as JSON before passing it along as the trigger payload. 
 isBinaryKey Boolean (Optional - default=false) When set to true, the provider encodes the key value as Base64 before passing it along as the trigger payload. 
 isBinaryValue Boolean (Optional - default=false) When set to true, the provider encodes the message value as Base64 before passing it along as the trigger payload. 



To create the trigger, follow these steps.



1. [Bind the /whisk.system/messaging package](https://cloud.ibm.com/docs/openwhisk?topic=openwhisk-pkg_event_streamsevent_streams_binding) to your Event Streams instance.
2. Create a trigger that is fired when new messages are posted to your Event Streams topic. Replace <namespace_ID> with your namespace ID, <binding> with your package binding name, and <mytopic> with the topic in your Event Streams instance that you want the trigger to listen to.

ibmcloud fn trigger create MyMessageHubTrigger -f /<namespace_ID>/<binding>/messageHubFeed -p topic <mytopic>

To find the path to the messageHubFeed trigger, run ibmcloud fn package list | grep <binding>, where <binding> is the name of your package binding.





 Creating a trigger for an Event Streams package outside IBM Cloud 

If you want to set up your Event Streams outside of IBM Cloud, you must manually create a package binding for your Event Streams service. You need the Event Streams service credentials and connection information.



1. Create a package binding that is configured for your Event Streams service.
![screenshot_explore.png](https://cloud.ibm.com/docs-content/v1/content/78bb71851d95d7580503eb9ba10cf3ae31490ade/apiconnect/tutorials/images/screenshot_explore.png)



--------------------





 Conclusion 

In this tutorial, you saw how an existing REST service can be invoked through an API pass-through proxy. You started by checking the availability of the sample service through the web browser. Then, you created a new OpenAPI spec in API Connect, and linked it to the sample service to be invoked. Finally, you tested the API proxy with the built-in testing tool.

--------------------





 Next step 

Secure your API using [rate limiting](https://cloud.ibm.com/docs/apiconnect/tutorials?topic=apiconnect-tut_rate_limit), [client ID and secret](https://cloud.ibm.com/docs/apiconnect/tutorials?topic=apiconnect-tut_secure_landing), or [securing using OAuth 2.0](https://cloud.ibm.com/docs/apiconnect/tutorials?topic=apiconnect-tut_secure_oauth_2).

Create > Manage > Secure > Socialize > Analyze
Import your API spec and proxy an existing REST service by using the Developer Toolkit 

Duration: 5 mins
Skill level: Beginner



 Objective 

This tutorial illustrates how you can bring your existing API under management control with IBM® API Connect for IBM Cloud® V5. In this tutorial, you will import an OpenAPI spec, and create a passthrough API proxy for an existing REST service.





 Prerequisites 

Before you begin, you will need to [set up your API Connect Instance](https://cloud.ibm.com/docs/apiconnect?topic=apiconnect-tut_prereq_set_up_apic_instance) and [install the API Connect toolkit](https://cloud.ibm.com/docs/apiconnect?topic=apiconnect-tut_prereq_install_toolkit).

--------------------





 Explore the sample app and test the target endpoints 

A sample weather provider app has been created for this tutorial. The corresponding API specification (OpenAPI 2.0) is in the [weather-provider-api_1.yaml](https://raw.githubusercontent.com/IBM-Bluemix-Docs/apiconnect/master/tutorials/weather-provider-api_1.yaml) file.



1. To explore the app, go to [http://gettingstartedweatherapp.mybluemix.net/](http://gettingstartedweatherapp.mybluemix.net/).
2. Enter a valid 5-digit U.S. zipcode to get the current weather and today's forecast.
![explore-weatherapp-1.png](https://cloud.ibm.com/docs-content/v1/content/78bb71851d95d7580503eb9ba10cf3ae31490ade/apiconnect/tutorials/images/explore-weatherapp-1.png)S
3.
Make sure you have either the [Node Test Runner extension](https://marketplace.visualstudio.com/items?itemName=oshri6688.javascript-test-runner), [Java Test Runner extension](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-test) or [Go extension](https://marketplace.visualstudio.com/items?itemName=golang.Go) installed.



After the test file is built, the tests can be run by clicking the Run Tests button in the file.





 Step six: Connect to your IBM Blockchain Platform network 

You can also use the extension to interact with your network on the IBM Blockchain Platform.



 Invoke a smart contract that has been instantiated or committed on your channels 

You can download your connection profile from the IBM Blockchain Platform console to build a gateway in the Fabric Gateways pane. You can then use the gateway to invoke the smart contracts that were deployed on your channel.

Open the IBM Blockchain Platform console that is associated with your instance of the IBM Blockchain Platform. Navigate to the Organizations tab and click the Organization MSP tile for the organization that your client application will interact with. Click Create connection profile to open a side panel that allows you to [build and download your connection profile](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ibp-console-appibp-console-app-profile) to your local file system. Then, [create an application identity](https://cloud.ibm.com/docs/blockchain?topic=blockchain-ibp-console-appibp-console-app-identities) by using your CA and save the enrollID and secret. Use the following steps to connect to the IBM Blockchain Platform from VS Code.



1. Open the IBM Blockchain Platform tab.
2. Hover your mouse over the Fabric Gateways pane and click +.
3. Choose Create a gateway from a connection profile.
4. Enter a name for the connection.
5.
Creating an API in Node.js 

Duration: 20 mins
Skill level: Beginner



 Objective 

This tutorial guides you through creating an API in Node.js using the LoopBack framework with API Connect V5. The tutorial describes how to:



1. Create a LoopBack project.
2. Use API Designer in the IBM® API Connect for IBM Cloud® toolkit to add a data source and model to a LoopBack project.







 Prerequisites 

Before you begin, [install the API Connect toolkit](https://cloud.ibm.com/docs/apiconnect/tutorials?topic=apiconnect-tut_prereq_install_toolkit) version 5.0.8.1, or later. Check the version of an existing toolkit by opening a command window and running the following command:: apic -v





 Create a Loopback project 

You can create a Loopback project with either the API Connect developer toolkit command line interface (CLI) or API Designer interface.



 Create a LoopBack project with the toolkit CLI 

To create a LoopBack project with the API Connect toolkit CLI, complete the following steps:



1. Run the following command to create a LoopBack application.

apic loopback

For this tutorial, you will create a project called weather-data.
2. At the prompt, enter weather-data as the project name and press Enter.

? What's the name of your application? weather-data

A project name can contain any characters except blank space (" "), forward slash ("/"), ampersand ("&"), at ("@"), plus ("+"), percent ("%"), and colon (":").
3. Enter the name of the directory in which to create the project. Press Enter to use a directory with the same name as the project, or type a new name and press Enter.

? Enter name of the directory to contain the project: weather-data
4. Select the version of LoopBack to use. Choose the current production version: 3.x.
* [Import your API spec, and proxy an existing REST service](https://cloud.ibm.com/docs/apiconnect/tutorials?topic=apiconnect-tut_rest_landing).
* [Secure your API with a client ID and secret](https://cloud.ibm.com/docs/apiconnect/tutorials?topic=apiconnect-tut_secure_landing).







 Launching API Connect 



1. Log in to IBM Cloud: [https://cloud.ibm.com/login](https://cloud.ibm.com/login).
2. Click All Services, and then select API Connect.
3. Click API Connect to start the API Connect service.







 Exploring the Default Plan 



1. In the API Connect navigation panel, select Drafts. (If the navigation panel is not open, click >> to open it.)
2. Select the Products tab, and verify that the Weather Provider API product displays in the list.

![draftproducts.png](https://cloud.ibm.com/docs-content/v1/content/78bb71851d95d7580503eb9ba10cf3ae31490ade/apiconnect/tutorials/images/draftproducts.png)
3. Click the Product link, and the Design view opens, displaying information about the Product.
4. Look in the Plans section of the page. A Default Plan was created when you generated this Product.

![defaultplanlist.png](https://cloud.ibm.com/docs-content/v1/content/78bb71851d95d7580503eb9ba10cf3ae31490ade/apiconnect/tutorials/images/defaultplanlist.png)
5. Expand the Default Plan details. Notice the default rate limit (100 calls / 1 Hour) and API list, which can be expanded to show specific operations.
3. Use the API key that is displayed as the credentials to connect to the service instance.







 Services with service keys 

The following services provide service keys for you to use externally:



* Alert Notification
* Analytics for Apache Spark
* Blockchain
* Discovery
* Event Streams
* Geospatial Analytics
* Globalization Pipeline
* IBM® App Connect
* IBM Cloudant
* Language Translator
* Lift
* Natural Language Classifier
* Object Storage
* Personality Insights
* Push
* Speech to Text
* Streaming Analytics
* Text to Speech
* Tone Analyzer
* Watson Assistant
* Workload Scheduler