vania-janet/multiturn-rag-retrieval-data huggingface dataset:
Currently, JSON is the only supported format.









 Get details of a custom resolver using the API 



 Get details of a single custom resolver 

To get the details of a custom resolver using the API, follow these steps:



1. Set up your API environment with the correct variables.
2. Store the following values in variables to be used in the API command:



* instance_id, which is the unique identifier of a service instance.
* resolver_id, which is the unique identifier of a custom resolver.
* X-Correlation-ID, which is a string that uniquely identifies a request.



3. When all variables are initiated, get the details of your custom resolver:

{
"id": "5365b73c-ce6f-4d6f-ad9f-d9c131b26370",
"name": "my-resolver",
"description": "custom resolver",
"enabled": false,
"health": "HEALTHY",
"locations": [
{
"id": "9a234ede-c2b6-4c39-bc27-d39ec139ecdb",
"subnet_crn": "crn:v1:bluemix:public:is:us-south-1:a/01652b251c3ae2787110a995d8db0135::subnet:0716-b49ef064-0f89-4fb1-8212-135b12568f04",
"enabled": true,
"healthy": true,
"dns_server_ip": "10.10.16.8"
}
],
"created_on": "2021-04-21T08:18:25Z",
"modified_on": "2021-04-21T08:18:25Z"
}







 List all custom resolvers 

To list all custom resolvers using the API, follow these steps:



1.
[query](https://cloud.ibm.com/apidocs/discoveryquery) Action username, password, iam_access_token, iam_apikey, iam_url, headers, headers[X-Watson-Learning-Opt-Out], url, environment_id, collection_id, filter, query, natural_language_query, passages, aggregation, count, return_fields, offset, sort, highlight, passages_fields, passages_count, passages_characters, deduplicate, deduplicate_field, similar, similar_document_ids, similar_fields Query your collection. 
 [query-entities](https://cloud.ibm.com/apidocs/discoveryquery-entities) Action username, password, iam_access_token, iam_apikey, iam_url, headers, headers[X-Watson-Learning-Opt-Out], url, environment_id, collection_id, feature, entity, context, count, evidence_count Query a Knowledge Graph entity. 
 [query-notices](https://cloud.ibm.com/apidocs/discoveryquery-notices) Action username, password, iam_access_token, iam_apikey, iam_url, headers, headers[X-Watson-Learning-Opt-Out], url, environment_id, collection_id, filter, query, natural_language_query, passages, aggregation, count, return_fields, offset, sort, highlight, passages_fields, passages_count, passages_characters, deduplicate_field, similar, similar_document_ids, similar_fields Query system notices. 
 [query-relations](https://cloud.ibm.com/apidocs/discoveryquery-relations) Action username, password, iam_access_token, iam_apikey, iam_url, headers, headers[X-Watson-Learning-Opt-Out], url, environment_id, collection_id, entities, context, sort, filter, count, evidence_count Query a Knowledge Graph relationship.
The information that is included in requestData is specific for each type of action. Check the [API documentation](https://cloud.ibm.com/docs?tab=api-docs&) of a request to learn about some of the fields that may be included.





 responseData (JSON) 

When the field is available, it includes additional information about the request.

The information that is included in responseData is specific for each type of action. Check the [API documentation](https://cloud.ibm.com/docs?tab=api-docs&) of a request to learn about some of the fields that may be included.





 saveServiceCopy (boolean) 

This field determines whether the IBM Cloud service that generates the event saves a copy of the event for IBM Cloud auditing.

When it is set to true, the service that generates the event saves a copy.





 severity (string) 

This field defines the level of threat an action may have on the IBM Cloud.

Valid values are: normal, warning, and critical.

The following table describes how this field is set based on the type of action:



Table 3. Severity values by type of action

 Value Type of action Sample of action 

 normal Routine actions in the IBM Cloud Start an instance 
 warning Actions that fail <br>Actions where a resource is updated or its metadata is modified Rename a service instance 
 critical Actions that affect security in the IBM Cloud such as changing credentials of a user or deleting data <br>Actions where the initiator is not authorized to work with an IBM Cloud resource Delete a security key 



When the reasonCode for an API call is any of the following values, the value of severity is set as follows:



Table 4. Severity value for some reason codes

 reasonCode description severity 

 400 Bad Request warning 
 401 Unauthorized critical 
 403 Forbidden critical 
 409 Conflict warning 
 424 Failed Dependency warning 
 500 Internal Server Error warning 
 502 Bad Gateway warning 
 503 Service Unavailable critical 
 504 Gateway Timeout warning 
 505 HTTP Version Not Supported warning 
 507 Insufficient Storage critical 







 Target fields
Discovery provides an API that can be embedded in your application to track events. Calling this API with the appropriate information when a user performs an action sends a signal back to Discovery, which can then be viewed in the logs.

Events can help gather information on computing metrics (like clickthrough rate) to measure how effective the application is at helping end users find relevant information, or can be used to help seed training by reviewing the queries and clicks to start to build ground truth.

You can add this API wherever users interact with your results. For example, in a search UI, you can add the API when a user clicks on a document link. In a chatbot interface, you can use the API to track when the user clicks on Expand or More details.

Discovery results return additional information that can be used for tracking events, including a session token.

"matching_results": 179,"session_token": "1_LKczxWGEWx59fYD0_VV8HFUpb6"

To record an event, make a POST to the /api/v1/events endpoint. See the [Events API](https://cloud.ibm.com/apidocs/discoverycreate-event) for details.

Once an event is recorded, it can be read back out using the /api/v1/logs endpoint. Join events to the associated query using the session_token.
For the initial export request, this parameter should be omitted. Subsequent requests for pagination should provide the token sent in the response to this parameter. 



For example, you can define a set of parameters to include information:

ENDPOINT/v2/export?to=START_TIME&from=END_TIME&hosts=LIST_OF_HOSTS<=vels=LIST_OF_LEVELS&size=N&query=(SEARCH_QUERY)" -u $TOKEN:





 Exporting events 

Complete the following steps to export events programmatically:



 Step 1. Get a service key 

[Get a service key](https://cloud.ibm.com/docs/activity-tracker?topic=activity-tracker-service_keys).





 Step 2. Identify the data to pass through the export parameters 

To verify that the query that you use in the export returns the set of events that you are looking for, define the search query through the UI. Refine the query until you can only see the events that you want to export. Then, map the data to the query parameters.

When you copy the query from the UI, you must replace every space with %20.





 Step 3. Export the events 

Run the following cURL command to export events:

curl "ENDPOINT/v2/export?QUERY_PARAMETERS" -u SERVICE_KEY:

Where



* ENDPOINT represents the entry point to the service. Each region has a different URL. [Learn more](https://cloud.ibm.com/docs/activity-tracker?topic=activity-tracker-endpoints).
* QUERY_PARAMETERS are parameters that define the filtering criteria that is applied to the export request.
* SERVICE_KEY is the service key that you created in the previous step.









 Samples 

For example, to write event lines into the terminal, you can run the following command:
ApiKey apiKey = response.getResult();
System.out.println(apiKey.toString());

api_key = iam_identity_service.update_api_key(
id=apikey_id,
if_match=apikey_etag,
description='This is an updated description'
).get_result()

print(json.dumps(api_key, indent=2))

updateAPIKeyOptions := iamIdentityService.NewUpdateAPIKeyOptions(apikeyID, apikeyEtag)
updateAPIKeyOptions.SetDescription("This is an updated description")

apiKey, response, err := iamIdentityService.UpdateAPIKey(updateAPIKeyOptions)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(apiKey, "", " ")
fmt.Println(string(b))

const params = {
id: apikeyId,
ifMatch: apikeyEtag,
description: 'This is an updated description',
};

iamIdentityService.updateApiKey(params)
.then(res => {
console.log(JSON.stringify(res.result, null, 2));
})
.catch(err => {
console.warn(err);
});





 Locking an API key 

For platform API keys that represent your user identity you can prevent the API key from being deleted by locking it. A locked API key is indicated by the Locked icon ![Locked icon](https://cloud.ibm.com/docs-content/v1/content/4d8c6eec891cff72b666dc24bd3211810c77fb42/account/images/locked.svg).



 Locking and unlocking an API key from the UI 



1.
* v2: [Information security](https://cloud.ibm.com/docs/discovery-data?topic=discovery-data-information-security)







 Querying user data 

Use the v1 /logs method filter parameter to search an application log for specific user data. For example, to search for data specific to a customer_id that matches my_best_customer, the query might be:

curl -X GET -u "apikey:3Df... ...Y7Pc9" "{url}/v2/assistants/{assistant_id}/logs?version=2020-04-01&filter=customer_id::my_best_customer"

where {url} is the appropriate URL for your instance. For more details, see [Service endpoint](https://cloud.ibm.com/apidocs/assistant-data-v2service-endpoint).

See the [Filter query reference](https://cloud.ibm.com/docs/assistant-data?topic=assistant-data-filter-reference) for additional details.





 Deleting data 

To delete any message log data associated with a specific user that your assistant might have stored, use the DELETE /user_data v1 API method. Specify the customer ID of the user by passing a customer_id parameter with the request.

Only data that was added by using the POST /message API endpoint with an associated customer ID can be deleted using this delete method. Data that was added by other methods cannot be deleted based on customer ID. For example, entities and intents that were added from customer conversations, cannot be deleted in this way. Personal Data is not supported for those methods.

IMPORTANT: Specifying a customer_id will delete all messages with that customer_id that were received before the delete request, across your entire Watson Assistant instance, not just within one skill.

As an example, to delete any message data associated with a user that has the customer ID abc from your Watson Assistant instance, send the following cURL command:

curl -X DELETE -u "apikey:3Df...
* UI
* CLI
* API







 Searching for resources 

You can search for resources from anywhere in the IBM Cloud® console. Enter the resource or tag in the search field from the console menu bar. You can also use the IBM Cloud command-line interface (CLI) to search across your resources. The CLI searches for distributed applications and service instances across locations and data centers. [The Global Search and Tagging - Search API](https://cloud.ibm.com/apidocs/search) supports searching for resources as well.



 Refining your search results 

View all resource results

View all catalog results
: Use this option to view a filtered catalog search. The first five results are displayed by name. If you want a more detailed search criteria for catalog entries, such as searching the description, you can click this link and get a filtered catalog results view. This option helps you find the offerings that you want to create faster. This appears if it matches to a catalog result. This field doesn't appear if your search query starts with tag:.

Search support cases
: Use this option to filter by your open support cases across the platform, including infrastructure resources. This shows up at the end of the search if you search for anything, including if you search by tag:.

Search in IBM Cloud docs
: Use this option to get a filtered search of the documentation. This shows up at the end of any search, including if you search by tag:.

Press the Forward Slash key (/) to navigate your cursor to the search field.





 Searching with the CLI 

You can also search across all your resources by using Lucene query syntax, with a single command by using the IBM Cloud CLI, starting with version 0.6.7.

You can search for the following attributes:

name
: The user-defined name of the resource.

region
: The geographical location where the resource is created. The allowed values are, for example, us-south, us-east, au-syd, eu-gb, eu-de, and jp-tok.

service_name
ListObjectsV2Request request = new ListObjectsV2Request()
.withBucketName(bucketName)
.withMaxKeys(maxKeys)
.withContinuationToken(nextToken);

ListObjectsV2Result result = _cos.listObjectsV2(request);
for(S3ObjectSummary objectSummary : result.getObjectSummaries()) {
System.out.printf("Item: %s (%s bytes)n", objectSummary.getKey(), objectSummary.getSize());
}

if (result.isTruncated()) {
nextToken = result.getNextContinuationToken();
System.out.println("...More results in next batch!n");
}
else {
nextToken = "";
moreResults = false;
}
}
System.out.println("...No more results!");
}
Show more

SDK References



* Classes



* [ListObjectsV2Request](https://ibm.github.io/ibm-cos-sdk-java/com/ibm/cloud/objectstorage/services/s3/model/ListObjectsV2Request.html)
* [ListObjectsV2Result](https://ibm.github.io/ibm-cos-sdk-java/com/ibm/cloud/objectstorage/services/s3/model/ListObjectsV2Result.html)
* [S3ObjectSummary](https://ibm.github.io/ibm-cos-sdk-java/com/ibm/cloud/objectstorage/services/s3/model/S3ObjectSummary.html)



* Methods
* [Viewing associated resources with the API](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-uko-view-associated-resourceuko-view-associated-resource-api)
* [What's next](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-uko-view-associated-resourceuko-view-associated-resource-next)



[Rotating managed keys manually](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-uko-rotate-keysuko-rotate-keys)



* [Rotating managed keys with the console](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-uko-rotate-keysuko-rotate-managed-key-gui)
* [Rotating managed keys with the API](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-uko-rotate-keysuko-rotate-managed-key-api)
* [What's next](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-uko-rotate-keysuko-rotate-keys-next)



[Viewing managed key versions](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-uko-view-key-versionsuko-view-key-versions)



* [Viewing manage key versions with the console](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-uko-view-key-versionsuko-view-key-versions-gui)
* [Viewing managed key versions with the API](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-uko-view-key-versionsuko-view-key-versions-api)
ApiKey apiKey = response.getResult();
System.out.println(apiKey.toString());

api_key = iam_identity_service.update_api_key(
id=apikey_id,
if_match=apikey_etag,
description='This is an updated description'
).get_result()

print(json.dumps(api_key, indent=2))

updateAPIKeyOptions := iamIdentityService.NewUpdateAPIKeyOptions(apikeyID, apikeyEtag)
updateAPIKeyOptions.SetDescription("This is an updated description")

apiKey, response, err := iamIdentityService.UpdateAPIKey(updateAPIKeyOptions)
if err != nil {
panic(err)
}
b, _ := json.MarshalIndent(apiKey, "", " ")
fmt.Println(string(b))

const params = {
id: apikeyId,
ifMatch: apikeyEtag,
description: 'This is an updated description',
};

iamIdentityService.updateApiKey(params)
.then(res => {
console.log(JSON.stringify(res.result, null, 2));
})
.catch(err => {
console.warn(err);
});





 Locking an API key 

For platform API keys that represent your user identity you can prevent the API key from being deleted by locking it. A locked API key is indicated by the Locked icon ![Locked icon](https://cloud.ibm.com/docs-content/v1/content/814aeaf04800bb4f74ea1c057d4abb166a5f357a/account/images/locked.svg).



 Locking and unlocking an API key from the UI 



1.
API endpoint, the results are passed to IBM Cloudant.<-- <ul> --> * Curl * Java * Node * Python * Go<-- </ul> --> curl -X POST -H "Authorization: Bearer $API_BEARER_TOKEN" -H 'Content-type: application/json' -d '{"selector":{"country":{"$eq": "US"}},"limit":5}' "$SERVICE_URL/cities/_find"
import com.ibm.cloud.cloudant.v1.Cloudant;
import com.ibm.cloud.cloudant.v1.model.FindResult;
import com.ibm.cloud.cloudant.v1.model.PostFindOptions;

import java.util.Collections;
import java.util.Map;

Cloudant service = Cloudant.newInstance();

Map<String, Object> selector = Collections.singletonMap(
"country",
Collections.singletonMap("$eq", "US"));

PostFindOptions.Builder findOptions = new PostFindOptions.Builder()
.db("cities")
.selector(selector)
.limit(5);

FindResult response = service.postFind(findOptions.build()).execute().getResult();
while (response.getDocs().size() > 0) {
System.out.println(response.getDocs());
// The bookmark of the next request becomes the bookmark of this response
findOptions.bookmark(response.getBookmark());
response = service.postFind(findOptions.build()).execute().getResult();
}
const { CloudantV1 } = require('@ibm-cloud/cloudant');

const service = CloudantV1.newInstance({});

async function paginate(pageSize) {
let requestParams = {
Support The Support page is where you can direct developers on how they can receive support on your APIs. For example, you can refer them to your forums and FAQs. You can also provide a link that allows them to open a support ticket if needed. 



Note: On the API Products page, you can select one of the products to view the Product page for an API and the available plans. It enables developers to subscribe to and view the API details.

![API Products](https://cloud.ibm.com/docs-content/v1/content/78bb71851d95d7580503eb9ba10cf3ae31490ade/apiconnect/tutorials/images/27-api-products.png)



 Conclusion 

In this tutorial, you learned how to set up and configure your API Connect Developer Portal. You also explored the developer portal.

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







 Next step 

[Customize your Developer Portal and select a theme](https://cloud.ibm.com/docs/apiconnect/tutorials?topic=apiconnect-tut_custom_dev_portal).

Create > Manage > Secure > Socialize > Analyze
For example, the Overview page includes several new, detailed graphs that summarize interactions between users and your application, the amount of traffic for a given time period, and the intents and entities that were recognized most often in user conversations.





 12 March 2018 

New date and time methods
: Methods were added that make it easier to perform date calculations from the dialog. See [Date and time calculations](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-methodsdialog-methods-date-time-calculations) for more details.





 16 February 2018 

Dialog node tracing
: When you use the "Try it out" pane to test a dialog, a location icon is displayed next to each response. You can click the icon to highlight the path that your assistant traversed through the dialog tree to arrive at the response. See [Building a dialog](https://cloud.ibm.com/docs/assistant?topic=assistant-dialog-tasksdialog-tasks-test) for details.

New API version
: The current API version is now 2018-02-16. This version introduces the following changes:



* A new include_audit parameter is now supported on most GET requests. This is an optional boolean parameter that specifies whether the response should include the audit properties (created and updated timestamps). The default value is false. (If you are using an API version earlier than 2018-02-16, the default value is true.) For more information, see the [API Reference](https://cloud.ibm.com/apidocs/assistant/assistant-v1).
* Responses from API calls using the new version include only properties with non-null values.
* The output.nodes_visited and output.nodes_visited_details properties of message responses now include nodes with the following types, which were previously omitted:
* Nodes with type=response_condition
* Nodes with type=event_handler and event_name=input







 9 February 2018 

Dutch system entities (Beta)
GET /{db}/_design/{ddoc}/_search_info/{index} <br>[Cloudant](https://cloud.ibm.com/apidocs/cloudantgetsearchinfo), [CouchDB](https://docs.couchdb.org/en/latest/api/ddoc/search.htmlget--db-_design-ddoc-_search_info-index) Retrieve search index metadata information, such as the size of the index on disk. 
 GET /{db}/_design/{ddoc}/_search/{index} <br>[Cloudant](https://cloud.ibm.com/apidocs/cloudantpostsearch), [CouchDB](https://docs.couchdb.org/en/latest/api/ddoc/search.htmlget--db-_design-ddoc-_search-index) Query an index by using the HTTP GET method. 
 POST /{db}/_design/{ddoc}/_search/{index} <br>[Cloudant](https://cloud.ibm.com/apidocs/cloudantgetsearchinfo) Query an index by using the HTTP POST method where the query is submitted as a JSON object in the request body. 
 GET /{db}/_design/{ddoc}/_view/{view} <br>[Cloudant](https://cloud.ibm.com/apidocs/cloudantgetview), [CouchDB](https://docs.couchdb.org/en/latest/api/ddoc/views.htmlget--db-_design-ddoc-_view-view) Execute the view function from the specified design document. <br>CouchDB documentation references more query parameters (conflicts, end_key, end_key_doc_id, attachments, att_encoding_info, sorted, start_key, start_key_doc_id, update_seq).
When you execute a query, passing execution_stats: true as an extra parameter forces IBM Cloudant to enumerate the number of documents it scanned in performing the query, for example:

{
"selector": {
"firstname": "Charles",
"surname": "Dickens"
},
"sort": ["date"],
"limit": 10,
"execution_stats": true
}

The returned data now includes an extra JSON object:

{
...
"execution_stats": {
"total_keys_examined": 0,
"total_docs_examined": 1000000,
"total_quorum_docs_examined": 0,
"results_returned": 2,
"execution_time_ms": 4400.699
}
}

The ratio between total_docs_examined and results_returned is key here: a high value indicates that too many documents are being scanned per document that is returned.

For more information, see [Blog post on Optimizing IBM Cloudant Queries](https://blog.cloudant.com/2020/04/24/Optimising-Cloudant-Queries.html).





 Which IBM Cloudant Query operators defeat the use of an index? 

Any of the [combination operators](https://cloud.ibm.com/docs/Cloudant?topic=Cloudant-queryoperators) other than $and can make a query do a full database scan without the help of a secondary index. For example, if an $or operator is used, then no secondary index can be used to assist the query. If in doubt, use the [POST /{db}/_explain](https://cloud.ibm.com/apidocs/cloudant?code=javapostexplain) endpoint to check that an index is used, and the execution_stats: true parameter to measure the efficiency of each query.

For a type=json index to be used to support a query, it must match the fields that are used in the selector and sort parameters. Comparison operators might be used on the last element to perform range queries.
Accept: application/json
Host: localhost:5984

{
"queries": [
{
"keys":
"meatballs",
"spaghetti"
]
},
{
"limit": 3,
"skip": 2
}
]
}
Show more

See the following example response for multiple queries:

HTTP/1.1 200 OK
Cache-Control: must-revalidate
Content-Type: application/json
Date: Wed, 20 Dec 2017 11:17:07 GMT
ETag: "1H8RGBCK3ABY6ACDM7ZSC30QK"
Server: CouchDB (Erlang/OTP)
Transfer-Encoding: chunked

{
"results" : [
{
"rows":
{
"id": "SpaghettiWithMeatballs",
"key": "meatballs",
"value": 1
},
{
"id": "SpaghettiWithMeatballs",
"key": "spaghetti",
"value": 1
},
{
"id": "SpaghettiWithMeatballs",
"key": "tomato sauce",
"value": 1
}
],
"total_rows": 3
},
{
"offset" : 2,
"rows" :
{
"id" : "Adukiandorangecasserole-microwave",
"key" : "Aduki and orange casserole - microwave",
"value" :
null,
"Aduki and orange casserole - microwave"
]
},
{
"id" : "Aioli-garlicmayonnaise",
"key" : "Aioli - garlic mayonnaise",
"value" :
null,
"Aioli - garlic mayonnaise"
]
},
{
"id" : "Alabamapeanutchicken",