IBM Cloud API Docs

Introduction

IBM Watson™ Discovery v1 is a cognitive search and content analytics engine that you can add to applications to identify patterns, trends and actionable insights to drive better decision-making. Securely unify structured and unstructured data with pre-enriched content, and use a simplified query language to eliminate the need for manual filtering of results.

This documentation describes Java SDK major version 9. For more information about how to update your code from the previous version, see the migration guide.

This documentation describes Node SDK major version 6. For more information about how to update your code from the previous version, see the migration guide.

This documentation describes Python SDK major version 5. For more information about how to update your code from the previous version, see the migration guide.

This documentation describes Ruby SDK major version 2. For more information about how to update your code from the previous version, see the migration guide.

This documentation describes .NET Standard SDK major version 5. For more information about how to update your code from the previous version, see the migration guide.

This documentation describes Go SDK major version 2. For more information about how to update your code from the previous version, see the migration guide.

This documentation describes Swift SDK major version 4. For more information about how to update your code from the previous version, see the migration guide.

This documentation describes Unity SDK major version 5. For more information about how to update your code from the previous version, see the migration guide.

Discovery v1 is deprecated. As of 11 July 2023, you cannot create new instances. Existing Advanced plan instances are supported until 11 July 2023. Any instances that still exist on that date will be deleted. For more information about Discovery v2, see the v2 API. For more information about how to migrate to Discovery v2, see Getting the most from Discovery.

Discovery v1 is deprecated. As of 11 July 2023, you cannot create new instances. Existing Advanced plan instances are supported until 11 July 2023. Any instances that still exist on that date will be deleted. For more information about Discovery v2, see the v2 API. For more information about how to migrate to Discovery v2, see Getting the most from Discovery.

Discovery v1 is deprecated. As of 11 July 2023, you cannot create new instances. Existing Advanced plan instances are supported until 11 July 2023. Any instances that still exist on that date will be deleted. For more information about Discovery v2, see the v2 API. For more information about how to migrate to Discovery v2, see Getting the most from Discovery.

Discovery v1 is deprecated. As of 11 July 2023, you cannot create new instances. Existing Advanced plan instances are supported until 11 July 2023. Any instances that still exist on that date will be deleted. For more information about Discovery v2, see the v2 API. For more information about how to migrate to Discovery v2, see Getting the most from Discovery.

Discovery v1 is deprecated. As of 11 July 2023, you cannot create new instances. Existing Advanced plan instances are supported until 11 July 2023. Any instances that still exist on that date will be deleted. For more information about Discovery v2, see the v2 API. For more information about how to migrate to Discovery v2, see Getting the most from Discovery.

The IBM Watson Unity SDK has the following requirements.

  • The SDK requires Unity version 2018.2 or later to support Transport Layer Security (TLS) 1.2.
    • Set the project settings for both the Scripting Runtime Version and the Api Compatibility Level to .NET 4.x Equivalent.
    • For more information, see TLS 1.0 support.
  • The SDK doesn't support the WebGL projects. Change your build settings to any platform except WebGL.

For more information about how to install and configure the SDK and SDK Core, see https://github.com/watson-developer-cloud/unity-sdk.

The code examples on this tab use the client library that is provided for Java.

Maven

<dependency>
  <groupId>com.ibm.watson</groupId>
  <artifactId>ibm-watson</artifactId>
  <version>11.0.0</version>
</dependency>

Gradle

compile 'com.ibm.watson:ibm-watson:11.0.0'

GitHub

The code examples on this tab use the client library that is provided for Node.js.

Installation

npm install ibm-watson@^8.0.0

GitHub

The code examples on this tab use the client library that is provided for Python.

Installation

pip install --upgrade "ibm-watson>=7.0.0"

GitHub

The code examples on this tab use the client library that is provided for Ruby.

Installation

gem install ibm_watson

GitHub

The code examples on this tab use the client library that is provided for Go.

go get -u github.com/watson-developer-cloud/go-sdk/v2@v3.0.0

GitHub

The code examples on this tab use the client library that is provided for Swift.

Cocoapods

pod 'IBMWatsonDiscoveryV1', '~> 5.0.0'

Carthage

github "watson-developer-cloud/swift-sdk" ~> 5.0.0

Swift Package Manager

.package(url: "https://github.com/watson-developer-cloud/swift-sdk", from: "5.0.0")

GitHub

The code examples on this tab use the client library that is provided for .NET Standard.

Package Manager

Install-Package IBM.Watson.Discovery.v1 -Version 7.0.0

.NET CLI

dotnet add package IBM.Watson.Discovery.v1 --version 7.0.0

PackageReference

<PackageReference Include="IBM.Watson.Discovery.v1" Version="7.0.0" />

GitHub

The code examples on this tab use the client library that is provided for Unity.

GitHub

Endpoint URLs

Identify the base URL for your service instance.

IBM Cloud URLs

The base URLs come from the service instance. To find the URL, view the service credentials by clicking the name of the service in the Resource list. Use the value of the URL. Add the method to form the complete API endpoint for your request.

The following example URL represents a Discovery instance that is hosted in Washington DC:

https://api.us-east.discovery.watson.cloud.ibm.com/instances/6bbda3b3-d572-45e1-8c54-22d6ed9e52c2

The following URLs represent the base URLs for Discovery. When you call the API, use the URL that corresponds to the location of your service instance.

  • Dallas: https://api.us-south.discovery.watson.cloud.ibm.com
  • Washington DC: https://api.us-east.discovery.watson.cloud.ibm.com
  • Frankfurt: https://api.eu-de.discovery.watson.cloud.ibm.com
  • Sydney: https://api.au-syd.discovery.watson.cloud.ibm.com
  • Tokyo: https://api.jp-tok.discovery.watson.cloud.ibm.com
  • London: https://api.eu-gb.discovery.watson.cloud.ibm.com
  • Seoul: https://api.kr-seo.discovery.watson.cloud.ibm.com

Set the correct service URL by calling the setServiceUrl() method of the service instance.

Set the correct service URL by specifying the serviceUrl parameter when you create the service instance.

Set the correct service URL by calling the set_service_url() method of the service instance.

Set the correct service URL by specifying the service_url property of the service instance.

Set the correct service URL by calling the SetServiceURL() method of the service instance.

Set the correct service URL by setting the serviceURL property of the service instance.

Set the correct service URL by calling the SetServiceUrl() method of the service instance.

Set the correct service URL by calling the SetServiceUrl() method of the service instance.

Dallas API endpoint example for services managed on IBM Cloud

curl -X {request_method} -u "apikey:{apikey}" "https://api.us-south.discovery.watson.cloud.ibm.com/instances/{instance_id}"

Your service instance might not use this URL

Default URL

https://api.us-south.discovery.watson.cloud.ibm.com

Example for the Washington DC location

IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
Discovery discovery = new Discovery("{version}", authenticator);
discovery.setServiceUrl("https://api.us-east.discovery.watson.cloud.ibm.com");

Default URL

https://api.us-south.discovery.watson.cloud.ibm.com

Example for the Washington DC location

const DiscoveryV1 = require('ibm-watson/discovery/v1');
const { IamAuthenticator } = require('ibm-watson/auth');

const discovery = new DiscoveryV1({
  version: '{version}',
  authenticator: new IamAuthenticator({
    apikey: '{apikey}',
  }),
  serviceUrl: 'https://api.us-east.discovery.watson.cloud.ibm.com',
});

Default URL

https://api.us-south.discovery.watson.cloud.ibm.com

Example for the Washington DC location

from ibm_watson import DiscoveryV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator

authenticator = IAMAuthenticator('{apikey}')
discovery = DiscoveryV1(
    version='{version}',
    authenticator=authenticator
)

discovery.set_service_url('https://api.us-east.discovery.watson.cloud.ibm.com')

Default URL

https://api.us-south.discovery.watson.cloud.ibm.com

Example for the Washington DC location

require "ibm_watson/authenticators"
require "ibm_watson/discovery_v1"
include IBMWatson

authenticator = Authenticators::IamAuthenticator.new(
  apikey: "{apikey}"
)
discovery = DiscoveryV1.new(
  version: "{version}",
  authenticator: authenticator
)
discovery.service_url = "https://api.us-east.discovery.watson.cloud.ibm.com"

Default URL

https://api.us-south.discovery.watson.cloud.ibm.com

Example for the Washington DC location

discovery, discoveryErr := discoveryv1.NewDiscoveryV1(options)

if discoveryErr != nil {
  panic(discoveryErr)
}

discovery.SetServiceURL("https://api.us-east.discovery.watson.cloud.ibm.com")

Default URL

https://api.us-south.discovery.watson.cloud.ibm.com

Example for the Washington DC location

let authenticator = WatsonIAMAuthenticator(apiKey: "{apikey}")
let discovery = Discovery(version: "{version}", authenticator: authenticator)
discovery.serviceURL = "https://api.us-east.discovery.watson.cloud.ibm.com"

Default URL

https://api.us-south.discovery.watson.cloud.ibm.com

Example for the Washington DC location

IamAuthenticator authenticator = new IamAuthenticator(
    apikey: "{apikey}"
    );

DiscoveryService discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("https://api.us-east.discovery.watson.cloud.ibm.com");

Default URL

https://api.us-south.discovery.watson.cloud.ibm.com

Example for the Washington DC location

var authenticator = new IamAuthenticator(
    apikey: "{apikey}"
);

while (!authenticator.CanAuthenticate())
    yield return null;

var discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("https://api.us-east.discovery.watson.cloud.ibm.com");

Disabling SSL verification

All Watson services use Secure Sockets Layer (SSL) (or Transport Layer Security (TLS)) for secure connections between the client and server. The connection is verified against the local certificate store to ensure authentication, integrity, and confidentiality.

If you use a self-signed certificate, you need to disable SSL verification to make a successful connection.

Enabling SSL verification is highly recommended. Disabling SSL jeopardizes the security of the connection and data. Disable SSL only if necessary, and take steps to enable SSL as soon as possible.

To disable SSL verification for a curl request, use the --insecure (-k) option with the request.

To disable SSL verification, create an HttpConfigOptions object and set the disableSslVerification property to true. Then, pass the object to the service instance by using the configureClient method.

To disable SSL verification, set the disableSslVerification parameter to true when you create the service instance.

To disable SSL verification, specify True on the set_disable_ssl_verification method for the service instance.

To disable SSL verification, set the disable_ssl_verification parameter to true in the configure_http_client() method for the service instance.

To disable SSL verification, call the DisableSSLVerification method on the service instance.

To disable SSL verification, call the disableSSLVerification() method on the service instance. You cannot disable SSL verification on Linux.

To disable SSL verification, set the DisableSslVerification method to true on the service instance.

To disable SSL verification, set the DisableSslVerification method to true on the service instance.

Example to disable SSL verification. Replace {apikey} and {url} with your service credentials.

curl -k -X {request_method} -u "apikey:{apikey}" "{url}/{method}"

Example to disable SSL verification

IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
Discovery discovery = new Discovery("{version}", authenticator);
discovery.setServiceUrl("{url}");

HttpConfigOptions configOptions = new HttpConfigOptions.Builder()
  .disableSslVerification(true)
  .build();
discovery.configureClient(configOptions);

Example to disable SSL verification

const DiscoveryV1 = require('ibm-watson/discovery/v1');
const { IamAuthenticator } = require('ibm-watson/auth');

const discovery = new DiscoveryV1({
  version: '{version}',
  authenticator: new IamAuthenticator({
    apikey: '{apikey}',
  }),
  serviceUrl: '{url}',
  disableSslVerification: true,
});

Example to disable SSL verification

from ibm_watson import DiscoveryV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator

authenticator = IAMAuthenticator('{apikey}')
discovery = DiscoveryV1(
    version='{version}',
    authenticator=authenticator
)

discovery.set_service_url('{url}')

discovery.set_disable_ssl_verification(True)

Example to disable SSL verification

require "ibm_watson/authenticators"
require "ibm_watson/discovery_v1"
include IBMWatson

authenticator = Authenticators::IamAuthenticator.new(
  apikey: "{apikey}"
)
discovery = DiscoveryV1.new(
  version: "{version}",
  authenticator: authenticator
)
discovery.service_url = "{url}"

discovery.configure_http_client(disable_ssl_verification: true)

Example to disable SSL verification

discovery, discoveryErr := discoveryv1.NewDiscoveryV1(options)

if discoveryErr != nil {
  panic(discoveryErr)
}

discovery.SetServiceURL("{url}")

discovery.DisableSSLVerification()

Example to disable SSL verification

let authenticator = WatsonIAMAuthenticator(apiKey: "{apikey}")
let discovery = Discovery(version: "{version}", authenticator: authenticator)
discovery.serviceURL = "{url}"

discovery.disableSSLVerification()

Example to disable SSL verification

IamAuthenticator authenticator = new IamAuthenticator(
    apikey: "{apikey}"
    );

DiscoveryService discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("{url}");

discovery.DisableSslVerification(true);

Example to disable SSL verification

var authenticator = new IamAuthenticator(
    apikey: "{apikey}"
);

while (!authenticator.CanAuthenticate())
    yield return null;

var discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("{url}");

discovery.DisableSslVerification = true;

Authentication

You authenticate to the API by using IBM Cloud Identity and Access Management (IAM).

You can pass either a bearer token in an authorization header or an API key. Tokens support authenticated requests without embedding service credentials in every call. API keys use basic authentication. For more information, see Authenticating to Watson services.

  • For testing and development, you can pass an API key directly.
  • For production use, unless you use the Watson SDKs, use an IAM token.

If you pass in an API key, use apikey for the username and the value of the API key as the password. For example, if the API key is f5sAznhrKQyvBFFaZbtF60m5tzLbqWhyALQawBg5TjRI in the service credentials, include the credentials in your call like this:

curl -u "apikey:f5sAznhrKQyvBFFaZbtF60m5tzLbqWhyALQawBg5TjRI"

For IBM Cloud instances, the SDK provides initialization methods for each form of authentication.

  • Use the API key to have the SDK manage the lifecycle of the access token. The SDK requests an access token, ensures that the access token is valid, and refreshes it if necessary.
  • Use the access token to manage the lifecycle yourself. You must periodically refresh the token.

For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.For more information, see IAM authentication with the SDK.

Replace {apikey} and {url} with your service credentials.

curl -X {request_method} -u "apikey:{apikey}" "{url}/v1/{method}"

SDK managing the IAM token. Replace {apikey}, {version}, and {url}.

IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
Discovery discovery = new Discovery("{version}", authenticator);
discovery.setServiceUrl("{url}");

SDK managing the IAM token. Replace {apikey}, {version}, and {url}.

const DiscoveryV1 = require('ibm-watson/discovery/v1');
const { IamAuthenticator } = require('ibm-watson/auth');

const discovery = new DiscoveryV1({
  version: '{version}',
  authenticator: new IamAuthenticator({
    apikey: '{apikey}',
  }),
  serviceUrl: '{url}',
});

SDK managing the IAM token. Replace {apikey}, {version}, and {url}.

from ibm_watson import DiscoveryV1
from ibm_cloud_sdk_core.authenticators import IAMAuthenticator

authenticator = IAMAuthenticator('{apikey}')
discovery = DiscoveryV1(
    version='{version}',
    authenticator=authenticator
)

discovery.set_service_url('{url}')

SDK managing the IAM token. Replace {apikey}, {version}, and {url}.

require "ibm_watson/authenticators"
require "ibm_watson/discovery_v1"
include IBMWatson

authenticator = Authenticators::IamAuthenticator.new(
  apikey: "{apikey}"
)
discovery = DiscoveryV1.new(
  version: "{version}",
  authenticator: authenticator
)
discovery.service_url = "{url}"

SDK managing the IAM token. Replace {apikey}, {version}, and {url}.

import (
  "github.com/IBM/go-sdk-core/core"
  "github.com/watson-developer-cloud/go-sdk/discoveryv1"
)

func main() {
  authenticator := &core.IamAuthenticator{
    ApiKey: "{apikey}",
  }

  options := &discoveryv1.DiscoveryV1Options{
    Version: "{version}",
    Authenticator: authenticator,
  }

  discovery, discoveryErr := discoveryv1.NewDiscoveryV1(options)

  if discoveryErr != nil {
    panic(discoveryErr)
  }

  discovery.SetServiceURL("{url}")
}

SDK managing the IAM token. Replace {apikey}, {version}, and {url}.

let authenticator = WatsonIAMAuthenticator(apiKey: "{apikey}")
let discovery = Discovery(version: "{version}", authenticator: authenticator)
discovery.serviceURL = "{url}"

SDK managing the IAM token. Replace {apikey}, {version}, and {url}.

IamAuthenticator authenticator = new IamAuthenticator(
    apikey: "{apikey}"
    );

DiscoveryService discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("{url}");

SDK managing the IAM token. Replace {apikey}, {version}, and {url}.

var authenticator = new IamAuthenticator(
    apikey: "{apikey}"
);

while (!authenticator.CanAuthenticate())
    yield return null;

var discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("{url}");

Access between services

Your application might use more than one Watson service. You can grant access between services and you can grant access to more than one service for your applications.

For IBM Cloud services, the method to grant access between Watson services varies depending on the type of API key. For more information, see IAM access.

  • To grant access between IBM Cloud services, create an authorization between the services. For more information, see Granting access between services.
  • To grant access to your services by applications without using user credentials, create a service ID, add an API key, and assign access policies. For more information, see Creating and working with service IDs.

When you give a user ID access to multiple services, use an endpoint URL that includes the service instance ID (for example, https://api.us-south.discovery.watson.cloud.ibm.com/instances/6bbda3b3-d572-45e1-8c54-22d6ed9e52c2). You can find the instance ID in two places:

  • By clicking the service instance row in the Resource list. The instance ID is the GUID in the details pane.

  • By clicking the name of the service instance in the list and looking at the credentials URL.

    If you don't see the instance ID in the URL, the credentials predate service IDs. Add new credentials from the Service credentials page and use those credentials.

Versioning

API requests require a version parameter that takes a date in the format version=YYYY-MM-DD. When the API is updated with any breaking changes, the service introduces a new version date for the API.

Send the version parameter with every API request. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.

Specify the version to use on API requests with the version parameter when you create the service instance. The service uses the API version for the date you specify, or the most recent version before that date. Don't default to the current date. Instead, specify a date that matches a version that is compatible with your app, and don't change it until your app is ready for a later version.

This documentation describes the current version of Discovery, 2019-04-30. In some cases, differences in earlier versions are noted in the descriptions of parameters and response models.

Error handling

Discovery uses standard HTTP response codes to indicate whether a method completed successfully. HTTP response codes in the 2xx range indicate success. A response in the 4xx range is some sort of failure, and a response in the 5xx range usually indicates an internal system error that cannot be resolved by the user. Response codes are listed with the method.

ErrorResponse

Name Description
code
integer
The HTTP response code.
error
string
General description of an error.

The Java SDK generates an exception for any unsuccessful method invocation. All methods that accept an argument can also throw an IllegalArgumentException.

Exception Description
IllegalArgumentException An invalid argument was passed to the method.

When the Java SDK receives an error response from the Discovery service, it generates an exception from the com.ibm.watson.developer_cloud.service.exception package. All service exceptions contain the following fields.

Field Description
statusCode The HTTP response code that is returned.
message A message that describes the error.

When the Node SDK receives an error response from the Discovery service, it creates an Error object with information that describes the error that occurred. This error object is passed as the first parameter to the callback function for the method. The contents of the error object are as shown in the following table.

Error

Field Description
code The HTTP response code that is returned.
message A message that describes the error.

The Python SDK generates an exception for any unsuccessful method invocation. When the Python SDK receives an error response from the Discovery service, it generates an ApiException with the following fields.

Field Description
code The HTTP response code that is returned.
message A message that describes the error.
info A dictionary of additional information about the error.

When the Ruby SDK receives an error response from the Discovery service, it generates an ApiException with the following fields.

Field Description
code The HTTP response code that is returned.
message A message that describes the error.
info A dictionary of additional information about the error.

The Go SDK generates an error for any unsuccessful service instantiation and method invocation. You can check for the error immediately. The contents of the error object are as shown in the following table.

Error

Field Description
code The HTTP response code that is returned.
message A message that describes the error.

The Swift SDK returns a WatsonError in the completionHandler any unsuccessful method invocation. This error type is an enum that conforms to LocalizedError and contains an errorDescription property that returns an error message. Some of the WatsonError cases contain associated values that reveal more information about the error.

Field Description
errorDescription A message that describes the error.

When the .NET Standard SDK receives an error response from the Discovery service, it generates a ServiceResponseException with the following fields.

Field Description
Message A message that describes the error.
CodeDescription The HTTP response code that is returned.

When the Unity SDK receives an error response from the Discovery service, it generates an IBMError with the following fields.

Field Description
Url The URL that generated the error.
StatusCode The HTTP response code returned.
ErrorMessage A message that describes the error.
Response The contents of the response from the server.
ResponseHeaders A dictionary of headers returned by the request.

Example error handling

try {
  // Invoke a method
} catch (NotFoundException e) {
  // Handle Not Found (404) exception
} catch (RequestTooLargeException e) {
  // Handle Request Too Large (413) exception
} catch (ServiceResponseException e) {
  // Base class for all exceptions caused by error responses from the service
  System.out.println("Service returned status code "
    + e.getStatusCode() + ": " + e.getMessage());
}

Example error handling

discovery.method(params)
  .catch(err => {
    console.log('error:', err);
  });

Example error handling

from ibm_watson import ApiException
try:
    # Invoke a method
except ApiException as ex:
    print "Method failed with status code " + str(ex.code) + ": " + ex.message

Example error handling

require "ibm_watson"
begin
  # Invoke a method
rescue IBMWatson::ApiException => ex
  print "Method failed with status code #{ex.code}: #{ex.error}"
end

Example error handling

import "github.com/watson-developer-cloud/go-sdk/discoveryv1"

// Instantiate a service
discovery, discoveryErr := discoveryv1.NewDiscoveryV1(options)

// Check for errors
if discoveryErr != nil {
  panic(discoveryErr)
}

// Call a method
result, _, responseErr := discovery.MethodName(&methodOptions)

// Check for errors
if responseErr != nil {
  panic(responseErr)
}

Example error handling

discovery.method() {
  response, error in

  if let error = error {
    switch error {
    case let .http(statusCode, message, metadata):
      switch statusCode {
      case .some(404):
        // Handle Not Found (404) exception
        print("Not found")
      case .some(413):
        // Handle Request Too Large (413) exception
        print("Payload too large")
      default:
        if let statusCode = statusCode {
          print("Error - code: \(statusCode), \(message ?? "")")
        }
      }
    default:
      print(error.localizedDescription)
    }
    return
  }

  guard let result = response?.result else {
    print(error?.localizedDescription ?? "unknown error")
    return
  }

  print(result)
}

Example error handling

try
{
    // Invoke a method
}
catch(ServiceResponseException e)
{
    Console.WriteLine("Error: " + e.Message);
}
catch (Exception e)
{
    Console.WriteLine("Error: " + e.Message);
}

Example error handling

// Invoke a method
discovery.MethodName(Callback, Parameters);

// Check for errors
private void Callback(DetailedResponse<ExampleResponse> response, IBMError error)
{
    if (error == null)
    {
        Log.Debug("ExampleCallback", "Response received: {0}", response.Response);
    }
    else
    {
        Log.Debug("ExampleCallback", "Error received: {0}, {1}, {3}", error.StatusCode, error.ErrorMessage, error.Response);
    }
}

Data handling

Additional headers

Some Watson services accept special parameters in headers that are passed with the request.

You can pass request header parameters in all requests or in a single request to the service.

To pass a request header, use the --header (-H) option with a curl request.

To pass header parameters with every request, use the setDefaultHeaders method of the service object. See Data collection for an example use of this method.

To pass header parameters in a single request, use the addHeader method as a modifier on the request before you execute it.

To pass header parameters with every request, specify the headers parameter when you create the service object. See Data collection for an example use of this method.

To pass header parameters in a single request, use the headers method as a modifier on the request before you execute it.

To pass header parameters with every request, specify the set_default_headers method of the service object. See Data collection for an example use of this method.

To pass header parameters in a single request, include headers as a dict in the request.

To pass header parameters with every request, specify the add_default_headers method of the service object. See Data collection for an example use of this method.

To pass header parameters in a single request, specify the headers method as a chainable method in the request.

To pass header parameters with every request, specify the SetDefaultHeaders method of the service object. See Data collection for an example use of this method.

To pass header parameters in a single request, specify the Headers as a map in the request.

To pass header parameters with every request, add them to the defaultHeaders property of the service object. See Data collection for an example use of this method.

To pass header parameters in a single request, pass the headers parameter to the request method.

To pass header parameters in a single request, use the WithHeader() method as a modifier on the request before you execute it. See Data collection for an example use of this method.

To pass header parameters in a single request, use the WithHeader() method as a modifier on the request before you execute it.

Example header parameter in a request

curl -X {request_method} -H "Request-Header: {header_value}" "{url}/v1/{method}"

Example header parameter in a request

ReturnType returnValue = discovery.methodName(parameters)
  .addHeader("Custom-Header", "{header_value}")
  .execute();

Example header parameter in a request

const parameters = {
  {parameters}
};

discovery.methodName(
  parameters,
  headers: {
    'Custom-Header': '{header_value}'
  })
   .then(result => {
    console.log(response);
  })
  .catch(err => {
    console.log('error:', err);
  });

Example header parameter in a request

response = discovery.methodName(
    parameters,
    headers = {
        'Custom-Header': '{header_value}'
    })

Example header parameter in a request

response = discovery.headers(
  "Custom-Header" => "{header_value}"
).methodName(parameters)

Example header parameter in a request

result, _, responseErr := discovery.MethodName(
  &methodOptions{
    Headers: map[string]string{
      "Accept": "application/json",
    },
  },
)

Example header parameter in a request

let customHeader: [String: String] = ["Custom-Header": "{header_value}"]
discovery.methodName(parameters, headers: customHeader) {
  response, error in
}

Example header parameter in a request

IamAuthenticator authenticator = new IamAuthenticator(
    apikey: "{apikey}"
    );

DiscoveryService discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("{url}");

discovery.WithHeader("Custom-Header", "header_value");

Example header parameter in a request

var authenticator = new IamAuthenticator(
    apikey: "{apikey}"
);

while (!authenticator.CanAuthenticate())
    yield return null;

var discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("{url}");

discovery.WithHeader("Custom-Header", "header_value");

Response details

The Discovery service might return information to the application in response headers.

To access all response headers that the service returns, include the --include (-i) option with a curl request. To see detailed response data for the request, including request headers, response headers, and extra debugging information, include the --verbose (-v) option with the request.

Example request to access response headers

curl -X {request_method} {authentication_method} --include "{url}/v1/{method}"

To access information in the response headers, use one of the request methods that returns details with the response: executeWithDetails(), enqueueWithDetails(), or rxWithDetails(). These methods return a Response<T> object, where T is the expected response model. Use the getResult() method to access the response object for the method, and use the getHeaders() method to access information in response headers.

Example request to access response headers

Response<ReturnType> response = discovery.methodName(parameters)
  .executeWithDetails();
// Access response from methodName
ReturnType returnValue = response.getResult();
// Access information in response headers
Headers responseHeaders = response.getHeaders();

All response data is available in the Response<T> object that is returned by each method. To access information in the response object, use the following properties.

Property Description
result Returns the response for the service-specific method.
headers Returns the response header information.
status Returns the HTTP status code.

Example request to access response headers

discovery.methodName(parameters)
  .then(response => {
    console.log(response.headers);
  })
  .catch(err => {
    console.log('error:', err);
  });

The return value from all service methods is a DetailedResponse object. To access information in the result object or response headers, use the following methods.

DetailedResponse

Method Description
get_result() Returns the response for the service-specific method.
get_headers() Returns the response header information.
get_status_code() Returns the HTTP status code.

Example request to access response headers

discovery.set_detailed_response(True)
response = discovery.methodName(parameters)
# Access response from methodName
print(json.dumps(response.get_result(), indent=2))
# Access information in response headers
print(response.get_headers())
# Access HTTP response status
print(response.get_status_code())

The return value from all service methods is a DetailedResponse object. To access information in the response object, use the following properties.

DetailedResponse

Property Description
result Returns the response for the service-specific method.
headers Returns the response header information.
status Returns the HTTP status code.

Example request to access response headers

response = discovery.methodName(parameters)
# Access response from methodName
print response.result
# Access information in response headers
print response.headers
# Access HTTP response status
print response.status

The return value from all service methods is a DetailedResponse object. To access information in the response object or response headers, use the following methods.

DetailedResponse

Method Description
GetResult() Returns the response for the service-specific method.
GetHeaders() Returns the response header information.
GetStatusCode() Returns the HTTP status code.

Example request to access response headers

import (
  "github.com/IBM/go-sdk-core/core"
  "github.com/watson-developer-cloud/go-sdk/discoveryv1"
)
result, response, responseErr := discovery.MethodName(
  &methodOptions{})
// Access result
core.PrettyPrint(response.GetResult(), "Result ")

// Access response headers
core.PrettyPrint(response.GetHeaders(), "Headers ")

// Access status code
core.PrettyPrint(response.GetStatusCode(), "Status Code ")

All response data is available in the WatsonResponse<T> object that is returned in each method's completionHandler.

Example request to access response headers

discovery.methodName(parameters) {
  response, error in

  guard let result = response?.result else {
    print(error?.localizedDescription ?? "unknown error")
    return
  }
  print(result) // The data returned by the service
  print(response?.statusCode)
  print(response?.headers)
}

The response contains fields for response headers, response JSON, and the status code.

DetailedResponse

Property Description
Result Returns the result for the service-specific method.
Response Returns the raw JSON response for the service-specific method.
Headers Returns the response header information.
StatusCode Returns the HTTP status code.

Example request to access response headers

var results = discovery.MethodName(parameters);

var result = results.Result;            //  The result object
var responseHeaders = results.Headers;  //  The response headers
var responseJson = results.Response;    //  The raw response JSON
var statusCode = results.StatusCode;    //  The response status code

The response contains fields for response headers, response JSON, and the status code.

DetailedResponse

Property Description
Result Returns the result for the service-specific method.
Response Returns the raw JSON response for the service-specific method.
Headers Returns the response header information.
StatusCode Returns the HTTP status code.

Example request to access response headers

private void Example()
{
    discovery.MethodName(Callback, Parameters);
}

private void Callback(DetailedResponse<ResponseType> response, IBMError error)
{
    var result = response.Result;                 //  The result object
    var responseHeaders = response.Headers;       //  The response headers
    var responseJson = reresponsesults.Response;  //  The raw response JSON
    var statusCode = response.StatusCode;         //  The response status code
}

Data labels

You can remove data associated with a specific customer if you label the data with a customer ID when you send a request to the service.

  • Use the X-Watson-Metadata header to associate a customer ID with the data. By adding a customer ID to a request, you indicate that it contains data that belongs to that customer.

    Specify a random or generic string for the customer ID. Do not include personal data, such as an email address. Pass the string customer_id={id} as the argument of the header.

    Labeling data is used only by methods that accept customer data.

  • Use the Delete labeled data method to remove data that is associated with a customer ID.

Use this process of labeling and deleting data only when you want to remove the data that is associated with a single customer, not when you want to remove data for multiple customers. For more information about Discovery and labeling data, see Information security.

For more information about how to pass headers, see Additional headers.

Data collection

By default, Discovery service instances that are not part of Premium plans collect data about API requests and their results. This data is collected only to improve the services for future users. The collected data is not shared or made public. Data is not collected for services that are part of Premium plans.

To prevent IBM usage of your data for an API request, set the X-Watson-Learning-Opt-Out header parameter to true. You can also disable request logging at the account level. For more information, see Controlling request logging for Watson services.

You must set the header on each request that you do not want IBM to access for general service improvements.

You can set the header by using the setDefaultHeaders method of the service object.

You can set the header by using the headers parameter when you create the service object.

You can set the header by using the set_default_headers method of the service object.

You can set the header by using the add_default_headers method of the service object.

You can set the header by using the SetDefaultHeaders method of the service object.

You can set the header by adding it to the defaultHeaders property of the service object.

You can set the header by using the WithHeader() method of the service object.

Example request

curl -u "apikey:{apikey}" -H "X-Watson-Learning-Opt-Out: true" "{url}/{method}"

Example request

Map<String, String> headers = new HashMap<String, String>();
headers.put("X-Watson-Learning-Opt-Out", "true");

discovery.setDefaultHeaders(headers);

Example request

const DiscoveryV1 = require('ibm-watson/discovery/v1');
const { IamAuthenticator } = require('ibm-watson/auth');

const discovery = new DiscoveryV1({
  version: '{version}',
  authenticator: new IamAuthenticator({
    apikey: '{apikey}',
  }),
  serviceUrl: '{url}',
  headers: {
    'X-Watson-Learning-Opt-Out': 'true'
  }
});

Example request

discovery.set_default_headers({'x-watson-learning-opt-out': "true"})

Example request

discovery.add_default_headers(headers: {"x-watson-learning-opt-out" => "true"})

Example request

import "net/http"

headers := http.Header{}
headers.Add("x-watson-learning-opt-out", "true")
discovery.SetDefaultHeaders(headers)

Example request

discovery.defaultHeaders["X-Watson-Learning-Opt-Out"] = "true"

Example request

IamAuthenticator authenticator = new IamAuthenticator(
    apikey: "{apikey}"
    );

DiscoveryService discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("{url}");

discovery.WithHeader("X-Watson-Learning-Opt-Out", "true");

Example request

var authenticator = new IamAuthenticator(
    apikey: "{apikey}"
);

while (!authenticator.CanAuthenticate())
    yield return null;

var discovery = new DiscoveryService("{version}", authenticator);
discovery.SetServiceUrl("{url}");

discovery.WithHeader("X-Watson-Learning-Opt-Out", "true");

Synchronous and asynchronous requests

The Java SDK supports both synchronous (blocking) and asynchronous (non-blocking) execution of service methods. All service methods implement the ServiceCall interface.

  • To call a method synchronously, use the execute method of the ServiceCall interface. You can call the execute method directly from an instance of the service.
  • To call a method asynchronously, use the enqueue method of the ServiceCall interface to receive a callback when the response arrives. The ServiceCallback interface of the method's argument provides onResponse and onFailure methods that you override to handle the callback.

The Ruby SDK supports both synchronous (blocking) and asynchronous (non-blocking) execution of service methods. All service methods implement the Concurrent::Async module. When you use the synchronous or asynchronous methods, an IVar object is returned. You access the DetailedResponse object by calling ivar_object.value.

For more information about the Ivar object, see the IVar class docs.

  • To call a method synchronously, either call the method directly or use the .await chainable method of the Concurrent::Async module.

    Calling a method directly (without .await) returns a DetailedResponse object.

  • To call a method asynchronously, use the .async chainable method of the Concurrent::Async module.

You can call the .await and .async methods directly from an instance of the service.

Example synchronous request

ReturnType returnValue = discovery.method(parameters).execute();

Example asynchronous request

discovery.method(parameters).enqueue(new ServiceCallback<ReturnType>() {
  @Override public void onResponse(ReturnType response) {
    . . .
  }
  @Override public void onFailure(Exception e) {
    . . .
  }
});

Example synchronous request

response = discovery.method_name(parameters)

or

response = discovery.await.method_name(parameters)

Example asynchronous request

response = discovery.async.method_name(parameters)

Methods

Create an environment

Creates a new environment for private data. An environment must be created before collections can be created.

Note: You can create only one environment for private data per service instance. An attempt to create another environment results in an error.

Creates a new environment for private data. An environment must be created before collections can be created.

Note: You can create only one environment for private data per service instance. An attempt to create another environment results in an error.

Creates a new environment for private data. An environment must be created before collections can be created.

Note: You can create only one environment for private data per service instance. An attempt to create another environment results in an error.

Creates a new environment for private data. An environment must be created before collections can be created.

Note: You can create only one environment for private data per service instance. An attempt to create another environment results in an error.

Creates a new environment for private data. An environment must be created before collections can be created.

Note: You can create only one environment for private data per service instance. An attempt to create another environment results in an error.

POST /v1/environments
ServiceCall<Environment> createEnvironment(CreateEnvironmentOptions createEnvironmentOptions)
createEnvironment(params)
create_environment(
        self,
        name: str,
        *,
        description: str = None,
        size: str = None,
        **kwargs,
    ) -> DetailedResponse
CreateEnvironment(string name, string description = null, string size = null)

Request

Use the CreateEnvironmentOptions.Builder to create a CreateEnvironmentOptions object that contains the parameter values for the createEnvironment method.

Query Parameters

  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

An object that defines an environment name and optional description. The fields in this object are not approved for personal information and cannot be deleted based on customer ID.

Examples:
{
  "name": "Example Environment",
  "description": "Description of Environment."
}

The createEnvironment options.

parameters

  • Name that identifies the environment.

    Possible values: 0 ≤ length ≤ 255

  • Description of the environment.

    Default:

  • Size of the environment. In the Lite plan the default and only accepted value is LT, in all other plans the default is S.

    Allowable values: [LT,XS,S,MS,M,ML,L,XL,XXL,XXXL]

parameters

  • Name that identifies the environment.

    Possible values: 0 ≤ length ≤ 255

  • Description of the environment.

    Default:

  • Size of the environment. In the Lite plan the default and only accepted value is LT, in all other plans the default is S.

    Allowable values: [LT,XS,S,MS,M,ML,L,XL,XXL,XXXL]

parameters

  • Name that identifies the environment.

    Possible values: 0 ≤ length ≤ 255

  • Description of the environment.

    Default:

  • Size of the environment. In the Lite plan the default and only accepted value is LT, in all other plans the default is S.

    Allowable values: [LT,XS,S,MS,M,ML,L,XL,XXL,XXXL]

  • curl -X POST -u "apikey":"{apikey}" -H "Content-Type: application/json" -d '{
      "name": "my_environment",
      "description": "My environment"
    }' "{url}/v1/environments?version=2019-04-30"
  • IamAuthenticator authenticator = new IamAuthenticator(
        apikey: "{apikey}"
        );
    
    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
    discovery.SetServiceUrl("{url}");
    
    var result = discovery.CreateEnvironment(
        name: "my_environment",
        description: "My environment"
        );
    
    Console.WriteLine(result.Response);
  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
    Discovery discovery = new Discovery("2019-04-30", authenticator);
    discovery.setServiceUrl("{url}");
    
    String environmentName = "my_environment";
    String environmentDesc = "My environment";
    
    CreateEnvironmentOptions.Builder createOptionsBuilder = new CreateEnvironmentOptions.Builder(environmentName);
    createOptionsBuilder.description(environmentDesc);
    Environment createResponse = discovery.createEnvironment(createOptionsBuilder.build()).execute().getResult();
  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
    const { IamAuthenticator } = require('ibm-watson/auth');
    
    const discovery = new DiscoveryV1({
      version: '2019-04-30',
      authenticator: new IamAuthenticator({
        apikey: '{apikey}',
      }),
      serviceUrl: '{url}',
    });
    
    const createEnvironmentParams = {
      name: 'my_environment',
      description: 'My environment',
      size: 'LT',
    };
    
    discovery.createEnvironment(createEnvironmentParams)
      .then(environment => {
        console.log(JSON.stringify(environment, null, 2));
      })
      .catch(err => {
        console.log('error:', err);
      });
  • import json
    from ibm_watson import DiscoveryV1
    from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
    
    authenticator = IAMAuthenticator('{apikey}')
    discovery = DiscoveryV1(
        version='2019-04-30',
        authenticator=authenticator
    )
    
    discovery.set_service_url('{url}')
    
    response = discovery.create_environment(
        name="my_environment",
        description="My environment"
    ).get_result()
    
    print(json.dumps(response, indent=2))

Response

Details about an environment.

Details about an environment.

Examples:
{
  "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
  "name": "test_environment",
  "description": "Test environment",
  "created": "2016-06-16T10:56:54.957Z",
  "updated": "2017-05-16T13:56:54.957Z",
  "status": "active",
  "read_only": false,
  "size": "M",
  "index_capacity": {
    "documents": {
      "indexed": 0,
      "maximum_allowed": 1000000
    },
    "disk_usage": {
      "used_bytes": 0,
      "maximum_allowed_bytes": 85899345920
    },
    "collections": {
      "available": 1,
      "maximum_allowed": 4
    }
  },
  "search_status": [
    {
      "scope": "environment",
      "status": "NO_DATA",
      "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
    }
  ]
}

Details about an environment.

Examples:
{
  "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
  "name": "test_environment",
  "description": "Test environment",
  "created": "2016-06-16T10:56:54.957Z",
  "updated": "2017-05-16T13:56:54.957Z",
  "status": "active",
  "read_only": false,
  "size": "M",
  "index_capacity": {
    "documents": {
      "indexed": 0,
      "maximum_allowed": 1000000
    },
    "disk_usage": {
      "used_bytes": 0,
      "maximum_allowed_bytes": 85899345920
    },
    "collections": {
      "available": 1,
      "maximum_allowed": 4
    }
  },
  "search_status": [
    {
      "scope": "environment",
      "status": "NO_DATA",
      "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
    }
  ]
}

Details about an environment.

Examples:
{
  "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
  "name": "test_environment",
  "description": "Test environment",
  "created": "2016-06-16T10:56:54.957Z",
  "updated": "2017-05-16T13:56:54.957Z",
  "status": "active",
  "read_only": false,
  "size": "M",
  "index_capacity": {
    "documents": {
      "indexed": 0,
      "maximum_allowed": 1000000
    },
    "disk_usage": {
      "used_bytes": 0,
      "maximum_allowed_bytes": 85899345920
    },
    "collections": {
      "available": 1,
      "maximum_allowed": 4
    }
  },
  "search_status": [
    {
      "scope": "environment",
      "status": "NO_DATA",
      "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
    }
  ]
}

Details about an environment.

Examples:
{
  "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
  "name": "test_environment",
  "description": "Test environment",
  "created": "2016-06-16T10:56:54.957Z",
  "updated": "2017-05-16T13:56:54.957Z",
  "status": "active",
  "read_only": false,
  "size": "M",
  "index_capacity": {
    "documents": {
      "indexed": 0,
      "maximum_allowed": 1000000
    },
    "disk_usage": {
      "used_bytes": 0,
      "maximum_allowed_bytes": 85899345920
    },
    "collections": {
      "available": 1,
      "maximum_allowed": 4
    }
  },
  "search_status": [
    {
      "scope": "environment",
      "status": "NO_DATA",
      "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
    }
  ]
}

Status Code

  • Environment successfully added.

  • Bad request.

Example responses
  • {
      "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
      "name": "test_environment",
      "description": "Test environment",
      "created": "2016-06-16T10:56:54.957Z",
      "updated": "2017-05-16T13:56:54.957Z",
      "status": "active",
      "read_only": false,
      "size": "M",
      "index_capacity": {
        "documents": {
          "indexed": 0,
          "maximum_allowed": 1000000
        },
        "disk_usage": {
          "used_bytes": 0,
          "maximum_allowed_bytes": 85899345920
        },
        "collections": {
          "available": 1,
          "maximum_allowed": 4
        }
      },
      "search_status": [
        {
          "scope": "environment",
          "status": "NO_DATA",
          "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
        }
      ]
    }
  • {
      "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
      "name": "test_environment",
      "description": "Test environment",
      "created": "2016-06-16T10:56:54.957Z",
      "updated": "2017-05-16T13:56:54.957Z",
      "status": "active",
      "read_only": false,
      "size": "M",
      "index_capacity": {
        "documents": {
          "indexed": 0,
          "maximum_allowed": 1000000
        },
        "disk_usage": {
          "used_bytes": 0,
          "maximum_allowed_bytes": 85899345920
        },
        "collections": {
          "available": 1,
          "maximum_allowed": 4
        }
      },
      "search_status": [
        {
          "scope": "environment",
          "status": "NO_DATA",
          "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
        }
      ]
    }

List environments

List existing environments for the service instance.

List existing environments for the service instance.

List existing environments for the service instance.

List existing environments for the service instance.

List existing environments for the service instance.

GET /v1/environments
ServiceCall<ListEnvironmentsResponse> listEnvironments(ListEnvironmentsOptions listEnvironmentsOptions)
listEnvironments(params)
list_environments(
        self,
        *,
        name: str = None,
        **kwargs,
    ) -> DetailedResponse
ListEnvironments(string name = null)

Request

Use the ListEnvironmentsOptions.Builder to create a ListEnvironmentsOptions object that contains the parameter values for the listEnvironments method.

Query Parameters

  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

  • Show only the environment with the given name.

The listEnvironments options.

parameters

  • Show only the environment with the given name.

parameters

  • Show only the environment with the given name.

parameters

  • Show only the environment with the given name.

  • curl -u "apikey":"{apikey}" "{url}/v1/environments?version=2019-04-30"
  • IamAuthenticator authenticator = new IamAuthenticator(
        apikey: "{apikey}"
        );
    
    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
    discovery.SetServiceUrl("{url}");
    
    var result = discovery.ListEnvironments();
    
    Console.WriteLine(result.Response);
  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
    Discovery discovery = new Discovery("2019-04-30", authenticator);
    discovery.setServiceUrl("{url}");
    
    ListEnvironmentsOptions options = new ListEnvironmentsOptions.Builder().build();
    ListEnvironmentsResponse listResponse = discovery.listEnvironments(options).execute().getResult();
  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
    const { IamAuthenticator } = require('ibm-watson/auth');
    
    const discovery = new DiscoveryV1({
      version: '2019-04-30',
      authenticator: new IamAuthenticator({
        apikey: '{apikey}',
      }),
      serviceUrl: '{url}',
    });
    
    discovery.listEnvironments()
      .then(listEnvironmentsResponse => {
        console.log(JSON.stringify(listEnvironmentsResponse, null, 2));
      })
      .catch(err => {
        console.log('error:', err);
      });
  • import json
    from ibm_watson import DiscoveryV1
    from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
    
    authenticator = IAMAuthenticator('{apikey}')
    discovery = DiscoveryV1(
        version='2019-04-30',
        authenticator=authenticator
    )
    
    discovery.set_service_url('{url}')
    
    environments = discovery.list_environments().get_result()
    print(json.dumps(environments, indent=2))
    
    system_environments = [x for x in environments['environments'] if x['name'] == 'Watson System Environment']
    system_environment_id = system_environments[0]['environment_id']
    
    collections = discovery.list_collections(system_environment_id).get_result()
    system_collections = [x for x in collections['collections']]
    print(json.dumps(system_collections, indent=2))

Response

Response object containing an array of configured environments.

Response object containing an array of configured environments.

Examples:
{
  "environments": [
    {
      "environment_id": "ecbda78e-fb06-40b1-a43f-a039fac0adc6",
      "name": "byod_environment",
      "description": "Private Data Environment",
      "created": "2017-07-14T12:54:40.985Z",
      "updated": "2017-07-14T12:54:40.985Z",
      "read_only": false
    },
    {
      "environment_id": "system",
      "name": "Watson System Environment",
      "description": "Watson System environment",
      "created": "2017-07-13T01:14:20.761Z",
      "updated": "2017-07-13T01:14:20.761Z",
      "read_only": true
    }
  ]
}

Response object containing an array of configured environments.

Examples:
{
  "environments": [
    {
      "environment_id": "ecbda78e-fb06-40b1-a43f-a039fac0adc6",
      "name": "byod_environment",
      "description": "Private Data Environment",
      "created": "2017-07-14T12:54:40.985Z",
      "updated": "2017-07-14T12:54:40.985Z",
      "read_only": false
    },
    {
      "environment_id": "system",
      "name": "Watson System Environment",
      "description": "Watson System environment",
      "created": "2017-07-13T01:14:20.761Z",
      "updated": "2017-07-13T01:14:20.761Z",
      "read_only": true
    }
  ]
}

Response object containing an array of configured environments.

Examples:
{
  "environments": [
    {
      "environment_id": "ecbda78e-fb06-40b1-a43f-a039fac0adc6",
      "name": "byod_environment",
      "description": "Private Data Environment",
      "created": "2017-07-14T12:54:40.985Z",
      "updated": "2017-07-14T12:54:40.985Z",
      "read_only": false
    },
    {
      "environment_id": "system",
      "name": "Watson System Environment",
      "description": "Watson System environment",
      "created": "2017-07-13T01:14:20.761Z",
      "updated": "2017-07-13T01:14:20.761Z",
      "read_only": true
    }
  ]
}

Response object containing an array of configured environments.

Examples:
{
  "environments": [
    {
      "environment_id": "ecbda78e-fb06-40b1-a43f-a039fac0adc6",
      "name": "byod_environment",
      "description": "Private Data Environment",
      "created": "2017-07-14T12:54:40.985Z",
      "updated": "2017-07-14T12:54:40.985Z",
      "read_only": false
    },
    {
      "environment_id": "system",
      "name": "Watson System Environment",
      "description": "Watson System environment",
      "created": "2017-07-13T01:14:20.761Z",
      "updated": "2017-07-13T01:14:20.761Z",
      "read_only": true
    }
  ]
}

Status Code

  • Successful response.

  • Bad request.

Example responses
  • {
      "environments": [
        {
          "environment_id": "ecbda78e-fb06-40b1-a43f-a039fac0adc6",
          "name": "byod_environment",
          "description": "Private Data Environment",
          "created": "2017-07-14T12:54:40.985Z",
          "updated": "2017-07-14T12:54:40.985Z",
          "read_only": false
        },
        {
          "environment_id": "system",
          "name": "Watson System Environment",
          "description": "Watson System environment",
          "created": "2017-07-13T01:14:20.761Z",
          "updated": "2017-07-13T01:14:20.761Z",
          "read_only": true
        }
      ]
    }
  • {
      "environments": [
        {
          "environment_id": "ecbda78e-fb06-40b1-a43f-a039fac0adc6",
          "name": "byod_environment",
          "description": "Private Data Environment",
          "created": "2017-07-14T12:54:40.985Z",
          "updated": "2017-07-14T12:54:40.985Z",
          "read_only": false
        },
        {
          "environment_id": "system",
          "name": "Watson System Environment",
          "description": "Watson System environment",
          "created": "2017-07-13T01:14:20.761Z",
          "updated": "2017-07-13T01:14:20.761Z",
          "read_only": true
        }
      ]
    }

Get environment info

GET /v1/environments/{environment_id}
ServiceCall<Environment> getEnvironment(GetEnvironmentOptions getEnvironmentOptions)
getEnvironment(params)
get_environment(
        self,
        environment_id: str,
        **kwargs,
    ) -> DetailedResponse
GetEnvironment(string environmentId)

Request

Use the GetEnvironmentOptions.Builder to create a GetEnvironmentOptions object that contains the parameter values for the getEnvironment method.

Path Parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

Query Parameters

  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

The getEnvironment options.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}?version=2019-04-30"
  • IamAuthenticator authenticator = new IamAuthenticator(
        apikey: "{apikey}"
        );
    
    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
    discovery.SetServiceUrl("{url}");
    
    var result = discovery.GetEnvironment(
        environmentId: "{environmentId}"
        );
    
    Console.WriteLine(result.Response);
  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
    Discovery discovery = new Discovery("2019-04-30", authenticator);
    discovery.setServiceUrl("{url}");
    
    String environmentId = "{environment_id}";
    
    GetEnvironmentOptions getOptions = new GetEnvironmentOptions.Builder(environmentId).build();
    Environment getResponse = discovery.getEnvironment(getOptions).execute().getResult();
  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
    const { IamAuthenticator } = require('ibm-watson/auth');
    
    const discovery = new DiscoveryV1({
      version: '2019-04-30',
      authenticator: new IamAuthenticator({
        apikey: '{apikey}',
      }),
      serviceUrl: '{url}',
    });
    
    const getEnvironmentParams = {
      environmentId: '{environment_id}',
    };
    
    discovery.getEnvironment(getEnvironmentParams)
      .then(environment => {
        console.log(JSON.stringify(environment, null, 2));
      })
      .catch(err => {
        console.log('error:', err);
      });
  • import json
    from ibm_watson import DiscoveryV1
    from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
    
    authenticator = IAMAuthenticator('{apikey}')
    discovery = DiscoveryV1(
        version='2019-04-30',
        authenticator=authenticator
    )
    
    discovery.set_service_url('{url}')
    
    environment_info = discovery.get_environment(
        '{environment_id}').get_result()
    print(json.dumps(environment_info, indent=2))

Response

Details about an environment.

Details about an environment.

Examples:
{
  "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
  "name": "test_environment",
  "description": "Test environment",
  "created": "2016-06-16T10:56:54.957Z",
  "updated": "2017-05-16T13:56:54.957Z",
  "status": "active",
  "read_only": false,
  "size": "M",
  "index_capacity": {
    "documents": {
      "indexed": 0,
      "maximum_allowed": 1000000
    },
    "disk_usage": {
      "used_bytes": 0,
      "maximum_allowed_bytes": 85899345920
    },
    "collections": {
      "available": 1,
      "maximum_allowed": 4
    }
  },
  "search_status": [
    {
      "scope": "environment",
      "status": "NO_DATA",
      "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
    }
  ]
}

Details about an environment.

Examples:
{
  "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
  "name": "test_environment",
  "description": "Test environment",
  "created": "2016-06-16T10:56:54.957Z",
  "updated": "2017-05-16T13:56:54.957Z",
  "status": "active",
  "read_only": false,
  "size": "M",
  "index_capacity": {
    "documents": {
      "indexed": 0,
      "maximum_allowed": 1000000
    },
    "disk_usage": {
      "used_bytes": 0,
      "maximum_allowed_bytes": 85899345920
    },
    "collections": {
      "available": 1,
      "maximum_allowed": 4
    }
  },
  "search_status": [
    {
      "scope": "environment",
      "status": "NO_DATA",
      "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
    }
  ]
}

Details about an environment.

Examples:
{
  "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
  "name": "test_environment",
  "description": "Test environment",
  "created": "2016-06-16T10:56:54.957Z",
  "updated": "2017-05-16T13:56:54.957Z",
  "status": "active",
  "read_only": false,
  "size": "M",
  "index_capacity": {
    "documents": {
      "indexed": 0,
      "maximum_allowed": 1000000
    },
    "disk_usage": {
      "used_bytes": 0,
      "maximum_allowed_bytes": 85899345920
    },
    "collections": {
      "available": 1,
      "maximum_allowed": 4
    }
  },
  "search_status": [
    {
      "scope": "environment",
      "status": "NO_DATA",
      "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
    }
  ]
}

Details about an environment.

Examples:
{
  "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
  "name": "test_environment",
  "description": "Test environment",
  "created": "2016-06-16T10:56:54.957Z",
  "updated": "2017-05-16T13:56:54.957Z",
  "status": "active",
  "read_only": false,
  "size": "M",
  "index_capacity": {
    "documents": {
      "indexed": 0,
      "maximum_allowed": 1000000
    },
    "disk_usage": {
      "used_bytes": 0,
      "maximum_allowed_bytes": 85899345920
    },
    "collections": {
      "available": 1,
      "maximum_allowed": 4
    }
  },
  "search_status": [
    {
      "scope": "environment",
      "status": "NO_DATA",
      "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
    }
  ]
}

Status Code

  • Environment fetched.

  • Bad request.

Example responses
  • {
      "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
      "name": "test_environment",
      "description": "Test environment",
      "created": "2016-06-16T10:56:54.957Z",
      "updated": "2017-05-16T13:56:54.957Z",
      "status": "active",
      "read_only": false,
      "size": "M",
      "index_capacity": {
        "documents": {
          "indexed": 0,
          "maximum_allowed": 1000000
        },
        "disk_usage": {
          "used_bytes": 0,
          "maximum_allowed_bytes": 85899345920
        },
        "collections": {
          "available": 1,
          "maximum_allowed": 4
        }
      },
      "search_status": [
        {
          "scope": "environment",
          "status": "NO_DATA",
          "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
        }
      ]
    }
  • {
      "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
      "name": "test_environment",
      "description": "Test environment",
      "created": "2016-06-16T10:56:54.957Z",
      "updated": "2017-05-16T13:56:54.957Z",
      "status": "active",
      "read_only": false,
      "size": "M",
      "index_capacity": {
        "documents": {
          "indexed": 0,
          "maximum_allowed": 1000000
        },
        "disk_usage": {
          "used_bytes": 0,
          "maximum_allowed_bytes": 85899345920
        },
        "collections": {
          "available": 1,
          "maximum_allowed": 4
        }
      },
      "search_status": [
        {
          "scope": "environment",
          "status": "NO_DATA",
          "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
        }
      ]
    }

Update an environment

Updates an environment. The environment's name and description parameters can be changed. You must specify a name for the environment.

Updates an environment. The environment's name and description parameters can be changed. You must specify a name for the environment.

Updates an environment. The environment's name and description parameters can be changed. You must specify a name for the environment.

Updates an environment. The environment's name and description parameters can be changed. You must specify a name for the environment.

Updates an environment. The environment's name and description parameters can be changed. You must specify a name for the environment.

PUT /v1/environments/{environment_id}
ServiceCall<Environment> updateEnvironment(UpdateEnvironmentOptions updateEnvironmentOptions)
updateEnvironment(params)
update_environment(
        self,
        environment_id: str,
        *,
        name: str = None,
        description: str = None,
        size: str = None,
        **kwargs,
    ) -> DetailedResponse
UpdateEnvironment(string environmentId, string name = null, string description = null, string size = null)

Request

Use the UpdateEnvironmentOptions.Builder to create a UpdateEnvironmentOptions object that contains the parameter values for the updateEnvironment method.

Path Parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

Query Parameters

  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

An object that defines the environment's name and, optionally, description.

The updateEnvironment options.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • Name that identifies the environment.

    Possible values: 0 ≤ length ≤ 255

    Default:

  • Description of the environment.

    Default:

  • Size to change the environment to. Note: Lite plan users cannot change the environment size.

    Allowable values: [S,MS,M,ML,L,XL,XXL,XXXL]

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • Name that identifies the environment.

    Possible values: 0 ≤ length ≤ 255

    Default:

  • Description of the environment.

    Default:

  • Size to change the environment to. Note: Lite plan users cannot change the environment size.

    Allowable values: [S,MS,M,ML,L,XL,XXL,XXXL]

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • Name that identifies the environment.

    Possible values: 0 ≤ length ≤ 255

    Default:

  • Description of the environment.

    Default:

  • Size to change the environment to. Note: Lite plan users cannot change the environment size.

    Allowable values: [S,MS,M,ML,L,XL,XXL,XXXL]

  • curl -X PUT -u "apikey":"{apikey}" -H "Content-Type: application/json" -d '{
       "name": "Updated name",
       "description": "Updated description"
    }' "{url}/v1/environments/{environment_id}?version=2019-04-30"
  • IamAuthenticator authenticator = new IamAuthenticator(
        apikey: "{apikey}"
        );
    
    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
    discovery.SetServiceUrl("{url}");
    
    var result = discovery.UpdateEnvironment(
        environmentId: "{environmentId}",
        name: "Updated name",
        description: "Updated description"
        );
    
    Console.WriteLine(result.Response);
  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
    Discovery discovery = new Discovery("2019-04-30", authenticator);
    discovery.setServiceUrl("{url}");
    
    String environmentId = "{environment_id}";
    String environmentName = "Updated name";
    String envDescription = "Updated description";
    
    UpdateEnvironmentOptions.Builder updateBuilder = new UpdateEnvironmentOptions.Builder(environmentId, environmentName);
    updateBuilder.description(envDescription);
    Environment updateResponse = discovery.updateEnvironment(updateBuilder.build()).execute().getResult();
  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
    const { IamAuthenticator } = require('ibm-watson/auth');
    
    const discovery = new DiscoveryV1({
      version: '2019-04-30',
      authenticator: new IamAuthenticator({
        apikey: '{apikey}',
      }),
      serviceUrl: '{url}',
    });
    
    const updateEnvironmentParams = {
      environmentId: '{environment_id}',
      name: '{updated name OR current name if updating description (name is required)}',
      description: '{updated description OR current description if updating just name (description will be set to `null` if not given)}',
    };
    
    discovery.updateEnvironment(updateEnvironmentParams)
      .then(environment => {
        console.log(JSON.stringify(environment, null, 2));
      })
      .catch(err => {
        console.log('error:', err);
      });
  • import json
    from ibm_watson import DiscoveryV1
    from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
    
    authenticator = IAMAuthenticator('{apikey}')
    discovery = DiscoveryV1(
        version='2019-04-30',
        authenticator=authenticator
    )
    
    discovery.set_service_url('{url}')
    
    new_name = discovery.update_environment(
        '{environment_id}', 
         name='Updated name', 
         description='Updated description').get_result()
    
    print(json.dumps(new_name, indent=2))

Response

Details about an environment.

Details about an environment.

Examples:
{
  "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
  "name": "test_environment",
  "description": "Test environment",
  "created": "2016-06-16T10:56:54.957Z",
  "updated": "2017-05-16T13:56:54.957Z",
  "status": "active",
  "read_only": false,
  "size": "M",
  "index_capacity": {
    "documents": {
      "indexed": 0,
      "maximum_allowed": 1000000
    },
    "disk_usage": {
      "used_bytes": 0,
      "maximum_allowed_bytes": 85899345920
    },
    "collections": {
      "available": 1,
      "maximum_allowed": 4
    }
  },
  "search_status": [
    {
      "scope": "environment",
      "status": "NO_DATA",
      "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
    }
  ]
}

Details about an environment.

Examples:
{
  "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
  "name": "test_environment",
  "description": "Test environment",
  "created": "2016-06-16T10:56:54.957Z",
  "updated": "2017-05-16T13:56:54.957Z",
  "status": "active",
  "read_only": false,
  "size": "M",
  "index_capacity": {
    "documents": {
      "indexed": 0,
      "maximum_allowed": 1000000
    },
    "disk_usage": {
      "used_bytes": 0,
      "maximum_allowed_bytes": 85899345920
    },
    "collections": {
      "available": 1,
      "maximum_allowed": 4
    }
  },
  "search_status": [
    {
      "scope": "environment",
      "status": "NO_DATA",
      "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
    }
  ]
}

Details about an environment.

Examples:
{
  "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
  "name": "test_environment",
  "description": "Test environment",
  "created": "2016-06-16T10:56:54.957Z",
  "updated": "2017-05-16T13:56:54.957Z",
  "status": "active",
  "read_only": false,
  "size": "M",
  "index_capacity": {
    "documents": {
      "indexed": 0,
      "maximum_allowed": 1000000
    },
    "disk_usage": {
      "used_bytes": 0,
      "maximum_allowed_bytes": 85899345920
    },
    "collections": {
      "available": 1,
      "maximum_allowed": 4
    }
  },
  "search_status": [
    {
      "scope": "environment",
      "status": "NO_DATA",
      "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
    }
  ]
}

Details about an environment.

Examples:
{
  "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
  "name": "test_environment",
  "description": "Test environment",
  "created": "2016-06-16T10:56:54.957Z",
  "updated": "2017-05-16T13:56:54.957Z",
  "status": "active",
  "read_only": false,
  "size": "M",
  "index_capacity": {
    "documents": {
      "indexed": 0,
      "maximum_allowed": 1000000
    },
    "disk_usage": {
      "used_bytes": 0,
      "maximum_allowed_bytes": 85899345920
    },
    "collections": {
      "available": 1,
      "maximum_allowed": 4
    }
  },
  "search_status": [
    {
      "scope": "environment",
      "status": "NO_DATA",
      "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
    }
  ]
}

Status Code

  • Environment successfully updated.

  • Bad request.

  • Forbidden. Returned if you attempt to update a read-only environment.

Example responses
  • {
      "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
      "name": "test_environment",
      "description": "Test environment",
      "created": "2016-06-16T10:56:54.957Z",
      "updated": "2017-05-16T13:56:54.957Z",
      "status": "active",
      "read_only": false,
      "size": "M",
      "index_capacity": {
        "documents": {
          "indexed": 0,
          "maximum_allowed": 1000000
        },
        "disk_usage": {
          "used_bytes": 0,
          "maximum_allowed_bytes": 85899345920
        },
        "collections": {
          "available": 1,
          "maximum_allowed": 4
        }
      },
      "search_status": [
        {
          "scope": "environment",
          "status": "NO_DATA",
          "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
        }
      ]
    }
  • {
      "environment_id": "f822208e-e4c2-45f8-a0d6-c2be950fbcc8",
      "name": "test_environment",
      "description": "Test environment",
      "created": "2016-06-16T10:56:54.957Z",
      "updated": "2017-05-16T13:56:54.957Z",
      "status": "active",
      "read_only": false,
      "size": "M",
      "index_capacity": {
        "documents": {
          "indexed": 0,
          "maximum_allowed": 1000000
        },
        "disk_usage": {
          "used_bytes": 0,
          "maximum_allowed_bytes": 85899345920
        },
        "collections": {
          "available": 1,
          "maximum_allowed": 4
        }
      },
      "search_status": [
        {
          "scope": "environment",
          "status": "NO_DATA",
          "status_description": "The system is employing the default strategy for document search natural_language_query. Enable query and event logging so we can initiate relevancy training to improve search accuracy."
        }
      ]
    }

Delete environment

DELETE /v1/environments/{environment_id}
ServiceCall<DeleteEnvironmentResponse> deleteEnvironment(DeleteEnvironmentOptions deleteEnvironmentOptions)
deleteEnvironment(params)
delete_environment(
        self,
        environment_id: str,
        **kwargs,
    ) -> DetailedResponse
DeleteEnvironment(string environmentId)

Request

Use the DeleteEnvironmentOptions.Builder to create a DeleteEnvironmentOptions object that contains the parameter values for the deleteEnvironment method.

Path Parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

Query Parameters

  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

The deleteEnvironment options.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • curl -u "apikey":"{apikey}" -X DELETE "{url}/v1/environments/{environment_id}?version=2019-04-30"
  • IamAuthenticator authenticator = new IamAuthenticator(
        apikey: "{apikey}"
        );
    
    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
    discovery.SetServiceUrl("{url}");
    
    var result = discovery.DeleteEnvironment(
        environmentId: "{environmentId}"
        );
    
    Console.WriteLine(result.Response);
  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
    Discovery discovery = new Discovery("2019-04-30", authenticator);
    discovery.setServiceUrl("{url}");
    
    String environmentId = "{environment_id}";
    
    DeleteEnvironmentOptions deleteRequest = new DeleteEnvironmentOptions.Builder(environmentId).build();
    DeleteEnvironmentResponse deleteResponse = discovery.deleteEnvironment(deleteRequest).execute().getResult();
  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
    const { IamAuthenticator } = require('ibm-watson/auth');
    
    const discovery = new DiscoveryV1({
      version: '2019-04-30',
      authenticator: new IamAuthenticator({
        apikey: '{apikey}',
      }),
      serviceUrl: '{url}',
    });
    
    const deleteEnvironmentParams = {
      environmentId: '{environment_id}',
    };
    
    discovery.deleteEnvironment(deleteEnvironmentParams)
      .then(deleteEnvironmentResponse => {
        console.log(JSON.stringify(deleteEnvironmentResponse, null, 2));
      })
      .catch(err => {
        console.log('error:', err);
      });
  • import json
    from ibm_watson import DiscoveryV1
    from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
    
    authenticator = IAMAuthenticator('{apikey}')
    discovery = DiscoveryV1(
        version='2019-04-30',
        authenticator=authenticator
    )
    
    discovery.set_service_url('{url}')
    
    del_env = discovery.delete_environment('{environment_id}').get_result()
    print(json.dumps(del_env, indent=2))

Response

Response object returned when deleting an environment.

Response object returned when deleting an environment.

Response object returned when deleting an environment.

Response object returned when deleting an environment.

Response object returned when deleting an environment.

Status Code

  • Environment successfully deleted.

  • Bad request. Example error messages:

    • Invalid environment id. Please check if the format is correct.
  • Forbidden. Returned if you attempt to delete a read-only environment.

  • Returned any time the environment is not found (even immediately after the environment was successfully deleted).

    Example error message:

    An environment with ID '2cd8bc72-d737-46e3-b26b-05a585111111' was not found.

No Sample Response

This method does not specify any sample responses.

List fields across collections

Gets a list of the unique fields (and their types) stored in the indexes of the specified collections.

Gets a list of the unique fields (and their types) stored in the indexes of the specified collections.

Gets a list of the unique fields (and their types) stored in the indexes of the specified collections.

Gets a list of the unique fields (and their types) stored in the indexes of the specified collections.

Gets a list of the unique fields (and their types) stored in the indexes of the specified collections.

GET /v1/environments/{environment_id}/fields
ServiceCall<ListCollectionFieldsResponse> listFields(ListFieldsOptions listFieldsOptions)
listFields(params)
list_fields(
        self,
        environment_id: str,
        collection_ids: List[str],
        **kwargs,
    ) -> DetailedResponse
ListFields(string environmentId, List<string> collectionIds)

Request

Use the ListFieldsOptions.Builder to create a ListFieldsOptions object that contains the parameter values for the listFields method.

Path Parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

Query Parameters

  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

  • A comma-separated list of collection IDs to be queried against.

The listFields options.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • A comma-separated list of collection IDs to be queried against.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • A comma-separated list of collection IDs to be queried against.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • A comma-separated list of collection IDs to be queried against.

  • curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/fields?collection_ids={id1},{id2}&version=2019-04-30"
  • IamAuthenticator authenticator = new IamAuthenticator(
        apikey: "{apikey}"
        );
    
    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
    discovery.SetServiceUrl("{url}");
    
    var result = discovery.ListFields(
        environmentId: "{environmentId}",
        collectionIds: new List<string>() { "{collection_id1}", "{collection_id2}" }
        );
    
    Console.WriteLine(result.Response);
  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
    Discovery discovery = new Discovery("2019-04-30", authenticator);
    discovery.setServiceUrl("{url}");
    
    String environmentId = "{environment_id}";
    String collectionId = "{collection_id}";
    
    ListFieldsOptions options = new ListFieldsOptions.Builder()
      .environmentId(environmentId)
      .addCollectionIds(collectionId)
      .build();
    
    ListCollectionFieldsResponse response = discovery.listFields(options).execute().getResult();
  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
    const { IamAuthenticator } = require('ibm-watson/auth');
    
    const discovery = new DiscoveryV1({
      version: '2019-04-30',
      authenticator: new IamAuthenticator({
        apikey: '{apikey}',
      }),
      serviceUrl: '{url}',
    });
    
    const listFieldsParams = {
      environmentId: '{environment_id}',
      collectionIds: ['{collection id}'],
    };
    
    discovery.listFields(listFieldsParams)
      .then(listCollectionFieldsResponse => {
        console.log(JSON.stringify(listCollectionFieldsResponse, null, 2));
      })
      .catch(err => {
        console.log('error:', err);
      });
  • import os
    import json
    from ibm_watson import DiscoveryV1
    from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
    
    authenticator = IAMAuthenticator('{apikey}')
    discovery = DiscoveryV1(
        version='2019-04-30',
        authenticator=authenticator
    )
    
    discovery.set_service_url('{url}')
    
    fields = discovery.list_fields('{environment_id}', ['{collection_id1}','{collection_id2}']).get_result()
    print(json.dumps(fields, indent=2))

Response

The list of fetched fields.

The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.

  • Fields which contain nested JSON objects are assigned a type of "nested".

  • Fields which belong to a nested object are prefixed with .properties (for example, warnings.properties.severity means that the warnings object has a property called severity).

  • Fields returned from the News collection are prefixed with v{N}-fullnews-t3-{YEAR}.mappings (for example, v5-fullnews-t3-2016.mappings.text.properties.author).

The list of fetched fields.

The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.

  • Fields which contain nested JSON objects are assigned a type of "nested".

  • Fields which belong to a nested object are prefixed with .properties (for example, warnings.properties.severity means that the warnings object has a property called severity).

  • Fields returned from the News collection are prefixed with v{N}-fullnews-t3-{YEAR}.mappings (for example, v5-fullnews-t3-2016.mappings.text.properties.author).

Examples:
{
  "fields": [
    {
      "field": "warnings",
      "type": "nested"
    },
    {
      "field": "warnings.properties.description",
      "type": "string"
    },
    {
      "field": "warnings.properties.phase",
      "type": "string"
    },
    {
      "field": "warnings.properties.warning_id",
      "type": "string"
    }
  ]
}

The list of fetched fields.

The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.

  • Fields which contain nested JSON objects are assigned a type of "nested".

  • Fields which belong to a nested object are prefixed with .properties (for example, warnings.properties.severity means that the warnings object has a property called severity).

  • Fields returned from the News collection are prefixed with v{N}-fullnews-t3-{YEAR}.mappings (for example, v5-fullnews-t3-2016.mappings.text.properties.author).

Examples:
{
  "fields": [
    {
      "field": "warnings",
      "type": "nested"
    },
    {
      "field": "warnings.properties.description",
      "type": "string"
    },
    {
      "field": "warnings.properties.phase",
      "type": "string"
    },
    {
      "field": "warnings.properties.warning_id",
      "type": "string"
    }
  ]
}

The list of fetched fields.

The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.

  • Fields which contain nested JSON objects are assigned a type of "nested".

  • Fields which belong to a nested object are prefixed with .properties (for example, warnings.properties.severity means that the warnings object has a property called severity).

  • Fields returned from the News collection are prefixed with v{N}-fullnews-t3-{YEAR}.mappings (for example, v5-fullnews-t3-2016.mappings.text.properties.author).

Examples:
{
  "fields": [
    {
      "field": "warnings",
      "type": "nested"
    },
    {
      "field": "warnings.properties.description",
      "type": "string"
    },
    {
      "field": "warnings.properties.phase",
      "type": "string"
    },
    {
      "field": "warnings.properties.warning_id",
      "type": "string"
    }
  ]
}

The list of fetched fields.

The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.

  • Fields which contain nested JSON objects are assigned a type of "nested".

  • Fields which belong to a nested object are prefixed with .properties (for example, warnings.properties.severity means that the warnings object has a property called severity).

  • Fields returned from the News collection are prefixed with v{N}-fullnews-t3-{YEAR}.mappings (for example, v5-fullnews-t3-2016.mappings.text.properties.author).

Examples:
{
  "fields": [
    {
      "field": "warnings",
      "type": "nested"
    },
    {
      "field": "warnings.properties.description",
      "type": "string"
    },
    {
      "field": "warnings.properties.phase",
      "type": "string"
    },
    {
      "field": "warnings.properties.warning_id",
      "type": "string"
    }
  ]
}

Status Code

  • The list of fetched fields.

    The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations:

    • Fields which contain nested JSON objects are assigned a type of "nested".

    • Fields which belong to a nested object are prefixed with .properties (for example, warnings.properties.severity means that the warnings object has a property called severity).

    • Fields returned from the News collection are prefixed with v{N}-fullnews-t3-{YEAR}.mappings (for example, v5-fullnews-t3-2016.mappings.text.properties.author).

  • Bad request.

Example responses
  • {
      "fields": [
        {
          "field": "warnings",
          "type": "nested"
        },
        {
          "field": "warnings.properties.description",
          "type": "string"
        },
        {
          "field": "warnings.properties.phase",
          "type": "string"
        },
        {
          "field": "warnings.properties.warning_id",
          "type": "string"
        }
      ]
    }
  • {
      "fields": [
        {
          "field": "warnings",
          "type": "nested"
        },
        {
          "field": "warnings.properties.description",
          "type": "string"
        },
        {
          "field": "warnings.properties.phase",
          "type": "string"
        },
        {
          "field": "warnings.properties.warning_id",
          "type": "string"
        }
      ]
    }

Add configuration

Creates a new configuration.

If the input configuration contains the configuration_id, created, or updated properties, then they are ignored and overridden by the system, and an error is not returned so that the overridden fields do not need to be removed when copying a configuration.

The configuration can contain unrecognized JSON fields. Any such fields are ignored and do not generate an error. This makes it easier to use newer configuration files with older versions of the API and the service. It also makes it possible for the tooling to add additional metadata and information to the configuration.

Creates a new configuration.

If the input configuration contains the configuration_id, created, or updated properties, then they are ignored and overridden by the system, and an error is not returned so that the overridden fields do not need to be removed when copying a configuration.

The configuration can contain unrecognized JSON fields. Any such fields are ignored and do not generate an error. This makes it easier to use newer configuration files with older versions of the API and the service. It also makes it possible for the tooling to add additional metadata and information to the configuration.

Creates a new configuration.

If the input configuration contains the configuration_id, created, or updated properties, then they are ignored and overridden by the system, and an error is not returned so that the overridden fields do not need to be removed when copying a configuration.

The configuration can contain unrecognized JSON fields. Any such fields are ignored and do not generate an error. This makes it easier to use newer configuration files with older versions of the API and the service. It also makes it possible for the tooling to add additional metadata and information to the configuration.

Creates a new configuration.

If the input configuration contains the configuration_id, created, or updated properties, then they are ignored and overridden by the system, and an error is not returned so that the overridden fields do not need to be removed when copying a configuration.

The configuration can contain unrecognized JSON fields. Any such fields are ignored and do not generate an error. This makes it easier to use newer configuration files with older versions of the API and the service. It also makes it possible for the tooling to add additional metadata and information to the configuration.

Creates a new configuration.

If the input configuration contains the configuration_id, created, or updated properties, then they are ignored and overridden by the system, and an error is not returned so that the overridden fields do not need to be removed when copying a configuration.

The configuration can contain unrecognized JSON fields. Any such fields are ignored and do not generate an error. This makes it easier to use newer configuration files with older versions of the API and the service. It also makes it possible for the tooling to add additional metadata and information to the configuration.

POST /v1/environments/{environment_id}/configurations
ServiceCall<Configuration> createConfiguration(CreateConfigurationOptions createConfigurationOptions)
createConfiguration(params)
create_configuration(
        self,
        environment_id: str,
        name: str,
        *,
        description: str = None,
        conversions: 'Conversions' = None,
        enrichments: List['Enrichment'] = None,
        normalizations: List['NormalizationOperation'] = None,
        source: 'Source' = None,
        **kwargs,
    ) -> DetailedResponse
CreateConfiguration(string environmentId, string name, string description = null, Conversions conversions = null, List<Enrichment> enrichments = null, List<NormalizationOperation> normalizations = null, Source source = null)

Request

Use the CreateConfigurationOptions.Builder to create a CreateConfigurationOptions object that contains the parameter values for the createConfiguration method.

Path Parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

Query Parameters

  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

Input an object that enables you to customize how your content is ingested and what enrichments are added to your data.

name is required and must be unique within the current environment. All other properties are optional.

If the input configuration contains the configuration_id, created, or updated properties, then they will be ignored and overridden by the system (an error is not returned so that the overridden fields do not need to be removed when copying a configuration).

The configuration can contain unrecognized JSON fields. Any such fields will be ignored and will not generate an error. This makes it easier to use newer configuration files with older versions of the API and the service. It also makes it possible for the tooling to add additional metadata and information to the configuration.

Examples:
{
  "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
  "name": "IBM News",
  "created": "2015-08-24T18:42:25.324Z",
  "updated": "2015-08-24T18:42:25.324Z",
  "description": "A configuration useful for ingesting IBM press releases.",
  "conversions": {
    "html": {
      "exclude_tags_keep_content": [
        "span"
      ],
      "exclude_content": {
        "xpaths": [
          "/home"
        ]
      }
    },
    "segment": {
      "enabled": true,
      "annotated_fields": [
        "custom-field-1",
        "custom-field-2"
      ]
    },
    "json_normalizations": [
      {
        "operation": "move",
        "source_field": "extracted_metadata.title",
        "destination_field": "metadata.title"
      },
      {
        "operation": "move",
        "source_field": "extracted_metadata.author",
        "destination_field": "metadata.author"
      },
      {
        "operation": "remove",
        "source_field": "extracted_metadata"
      }
    ]
  },
  "enrichments": [
    {
      "enrichment": "natural_language_understanding",
      "source_field": "title",
      "destination_field": "enriched_title",
      "options": {
        "features": {
          "keywords": {
            "sentiment": true,
            "emotion": false,
            "limit": 50
          },
          "entities": {
            "sentiment": true,
            "emotion": false,
            "limit": 50,
            "mentions": true,
            "mention_types": true,
            "sentence_locations": true,
            "model": "WKS-model-id"
          },
          "sentiment": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "emotion": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "categories": {},
          "concepts": {
            "limit": 8
          },
          "semantic_roles": {
            "entities": true,
            "keywords": true,
            "limit": 50
          },
          "relations": {
            "model": "WKS-model-id"
          }
        }
      }
    }
  ],
  "normalizations": [
    {
      "operation": "move",
      "source_field": "metadata.title",
      "destination_field": "title"
    },
    {
      "operation": "move",
      "source_field": "metadata.author",
      "destination_field": "author"
    },
    {
      "operation": "remove",
      "source_field": "html"
    },
    {
      "operation": "remove_nulls"
    }
  ],
  "source": {
    "type": "salesforce",
    "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
    "schedule": {
      "enabled": true,
      "time_zone": "America/New_York",
      "frequency": "weekly"
    },
    "options": {
      "site_collections": [
        {
          "site_collection_path": "/sites/TestSiteA",
          "limit": 10
        }
      ]
    }
  }
}

The createConfiguration options.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The name of the configuration.

    Possible values: 0 ≤ length ≤ 255

  • The description of the configuration, if available.

  • Document conversion settings.

  • An array of document enrichment settings for the configuration.

  • Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.

  • Object containing source parameters for the configuration.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The name of the configuration.

    Possible values: 0 ≤ length ≤ 255

  • The description of the configuration, if available.

  • Document conversion settings.

  • An array of document enrichment settings for the configuration.

  • Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.

  • Object containing source parameters for the configuration.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The name of the configuration.

    Possible values: 0 ≤ length ≤ 255

  • The description of the configuration, if available.

  • Document conversion settings.

  • An array of document enrichment settings for the configuration.

  • Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.

  • Object containing source parameters for the configuration.

  • curl -X POST -u "apikey":"{apikey}" -H "Content-Type: application/json" -d @config.json "{url}/v1/environments/{environment_id}/configurations?version=2019-04-30"
  • IamAuthenticator authenticator = new IamAuthenticator(
        apikey: "{apikey}"
        );
    
    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
    discovery.SetServiceUrl("{url}");
    
    var result = discovery.CreateConfiguration(
        environmentId: "{environmentId}",
        name: "doc-config"
        );
    
    Console.WriteLine(result.Response);
  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
    Discovery discovery = new Discovery("2019-04-30", authenticator);
    discovery.setServiceUrl("{url}");
    
    String environmentId = "{environment_id"};
    String configurationName = "doc-config";
    
    CreateConfigurationOptions.Builder createBuilder = new CreateConfigurationOptions.Builder();
    Configuration configuration = GsonSingleton.getGson().fromJson(
        new FileReader("./config.json"),
        com.ibm.watson.internal.discovery.model.configuration.Configuration.class);
    configuration.setName(configurationName);
    createBuilder.configuration(configuration);
    createBuilder.environmentId(environmentId);
    Configuration createResponse = discovery.createConfiguration(createBuilder.build()).execute().getResult();
  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
    const { IamAuthenticator } = require('ibm-watson/auth');
    
    const discovery = new DiscoveryV1({
      version: '2019-04-30',
      authenticator: new IamAuthenticator({
        apikey: '{apikey}',
      }),
      serviceUrl: '{url}',
    });
    
    const createConfigurationParams = {
      environmentId: '{environment_id}',
      name: 'node-examples-test',
    };
    
    discovery.createConfiguration(createConfigurationParams)
      .then(configuration => {
        console.log(JSON.stringify(configuration, null, 2));
      })
      .catch(err => {
        console.log('error:', err);
      });
  • import os
    import json
    from ibm_watson import DiscoveryV1
    from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
    
    authenticator = IAMAuthenticator('{apikey}')
    discovery = DiscoveryV1(
        version='2019-04-30',
        authenticator=authenticator
    )
    
    discovery.set_service_url('{url}')
    
    with open(os.path.join(os.getcwd(), 'config.json')) as config_data:
        data = json.load(config_data)
        new_config = discovery.create_configuration(
            '{environment_id}',
            data['name'],
            description=data['description'], 
            conversions=data['conversions'],
            enrichments=data['enrichments'], 
            normalizations=data['normalizations']).get_result()
        print(json.dumps(new_config, indent=2))

Response

A custom configuration for the environment.

A custom configuration for the environment.

Examples:
{
  "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
  "name": "IBM News",
  "created": "2015-08-24T18:42:25.324Z",
  "updated": "2015-08-24T18:42:25.324Z",
  "description": "A configuration useful for ingesting IBM press releases.",
  "conversions": {
    "html": {
      "exclude_tags_keep_content": [
        "span"
      ],
      "exclude_content": {
        "xpaths": [
          "/home"
        ]
      }
    },
    "segment": {
      "enabled": true,
      "annotated_fields": [
        "custom-field-1",
        "custom-field-2"
      ]
    },
    "json_normalizations": [
      {
        "operation": "move",
        "source_field": "extracted_metadata.title",
        "destination_field": "metadata.title"
      },
      {
        "operation": "move",
        "source_field": "extracted_metadata.author",
        "destination_field": "metadata.author"
      },
      {
        "operation": "remove",
        "source_field": "extracted_metadata"
      }
    ]
  },
  "enrichments": [
    {
      "enrichment": "natural_language_understanding",
      "source_field": "title",
      "destination_field": "enriched_title",
      "options": {
        "features": {
          "keywords": {
            "sentiment": true,
            "emotion": false,
            "limit": 50
          },
          "entities": {
            "sentiment": true,
            "emotion": false,
            "limit": 50,
            "mentions": true,
            "mention_types": true,
            "sentence_locations": true,
            "model": "WKS-model-id"
          },
          "sentiment": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "emotion": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "categories": {},
          "concepts": {
            "limit": 8
          },
          "semantic_roles": {
            "entities": true,
            "keywords": true,
            "limit": 50
          },
          "relations": {
            "model": "WKS-model-id"
          }
        }
      }
    }
  ],
  "normalizations": [
    {
      "operation": "move",
      "source_field": "metadata.title",
      "destination_field": "title"
    },
    {
      "operation": "move",
      "source_field": "metadata.author",
      "destination_field": "author"
    },
    {
      "operation": "remove",
      "source_field": "html"
    },
    {
      "operation": "remove_nulls"
    }
  ],
  "source": {
    "type": "salesforce",
    "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
    "schedule": {
      "enabled": true,
      "time_zone": "America/New_York",
      "frequency": "weekly"
    },
    "options": {
      "site_collections": [
        {
          "site_collection_path": "/sites/TestSiteA",
          "limit": 10
        }
      ]
    }
  }
}

A custom configuration for the environment.

Examples:
{
  "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
  "name": "IBM News",
  "created": "2015-08-24T18:42:25.324Z",
  "updated": "2015-08-24T18:42:25.324Z",
  "description": "A configuration useful for ingesting IBM press releases.",
  "conversions": {
    "html": {
      "exclude_tags_keep_content": [
        "span"
      ],
      "exclude_content": {
        "xpaths": [
          "/home"
        ]
      }
    },
    "segment": {
      "enabled": true,
      "annotated_fields": [
        "custom-field-1",
        "custom-field-2"
      ]
    },
    "json_normalizations": [
      {
        "operation": "move",
        "source_field": "extracted_metadata.title",
        "destination_field": "metadata.title"
      },
      {
        "operation": "move",
        "source_field": "extracted_metadata.author",
        "destination_field": "metadata.author"
      },
      {
        "operation": "remove",
        "source_field": "extracted_metadata"
      }
    ]
  },
  "enrichments": [
    {
      "enrichment": "natural_language_understanding",
      "source_field": "title",
      "destination_field": "enriched_title",
      "options": {
        "features": {
          "keywords": {
            "sentiment": true,
            "emotion": false,
            "limit": 50
          },
          "entities": {
            "sentiment": true,
            "emotion": false,
            "limit": 50,
            "mentions": true,
            "mention_types": true,
            "sentence_locations": true,
            "model": "WKS-model-id"
          },
          "sentiment": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "emotion": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "categories": {},
          "concepts": {
            "limit": 8
          },
          "semantic_roles": {
            "entities": true,
            "keywords": true,
            "limit": 50
          },
          "relations": {
            "model": "WKS-model-id"
          }
        }
      }
    }
  ],
  "normalizations": [
    {
      "operation": "move",
      "source_field": "metadata.title",
      "destination_field": "title"
    },
    {
      "operation": "move",
      "source_field": "metadata.author",
      "destination_field": "author"
    },
    {
      "operation": "remove",
      "source_field": "html"
    },
    {
      "operation": "remove_nulls"
    }
  ],
  "source": {
    "type": "salesforce",
    "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
    "schedule": {
      "enabled": true,
      "time_zone": "America/New_York",
      "frequency": "weekly"
    },
    "options": {
      "site_collections": [
        {
          "site_collection_path": "/sites/TestSiteA",
          "limit": 10
        }
      ]
    }
  }
}

A custom configuration for the environment.

Examples:
{
  "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
  "name": "IBM News",
  "created": "2015-08-24T18:42:25.324Z",
  "updated": "2015-08-24T18:42:25.324Z",
  "description": "A configuration useful for ingesting IBM press releases.",
  "conversions": {
    "html": {
      "exclude_tags_keep_content": [
        "span"
      ],
      "exclude_content": {
        "xpaths": [
          "/home"
        ]
      }
    },
    "segment": {
      "enabled": true,
      "annotated_fields": [
        "custom-field-1",
        "custom-field-2"
      ]
    },
    "json_normalizations": [
      {
        "operation": "move",
        "source_field": "extracted_metadata.title",
        "destination_field": "metadata.title"
      },
      {
        "operation": "move",
        "source_field": "extracted_metadata.author",
        "destination_field": "metadata.author"
      },
      {
        "operation": "remove",
        "source_field": "extracted_metadata"
      }
    ]
  },
  "enrichments": [
    {
      "enrichment": "natural_language_understanding",
      "source_field": "title",
      "destination_field": "enriched_title",
      "options": {
        "features": {
          "keywords": {
            "sentiment": true,
            "emotion": false,
            "limit": 50
          },
          "entities": {
            "sentiment": true,
            "emotion": false,
            "limit": 50,
            "mentions": true,
            "mention_types": true,
            "sentence_locations": true,
            "model": "WKS-model-id"
          },
          "sentiment": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "emotion": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "categories": {},
          "concepts": {
            "limit": 8
          },
          "semantic_roles": {
            "entities": true,
            "keywords": true,
            "limit": 50
          },
          "relations": {
            "model": "WKS-model-id"
          }
        }
      }
    }
  ],
  "normalizations": [
    {
      "operation": "move",
      "source_field": "metadata.title",
      "destination_field": "title"
    },
    {
      "operation": "move",
      "source_field": "metadata.author",
      "destination_field": "author"
    },
    {
      "operation": "remove",
      "source_field": "html"
    },
    {
      "operation": "remove_nulls"
    }
  ],
  "source": {
    "type": "salesforce",
    "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
    "schedule": {
      "enabled": true,
      "time_zone": "America/New_York",
      "frequency": "weekly"
    },
    "options": {
      "site_collections": [
        {
          "site_collection_path": "/sites/TestSiteA",
          "limit": 10
        }
      ]
    }
  }
}

A custom configuration for the environment.

Examples:
{
  "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
  "name": "IBM News",
  "created": "2015-08-24T18:42:25.324Z",
  "updated": "2015-08-24T18:42:25.324Z",
  "description": "A configuration useful for ingesting IBM press releases.",
  "conversions": {
    "html": {
      "exclude_tags_keep_content": [
        "span"
      ],
      "exclude_content": {
        "xpaths": [
          "/home"
        ]
      }
    },
    "segment": {
      "enabled": true,
      "annotated_fields": [
        "custom-field-1",
        "custom-field-2"
      ]
    },
    "json_normalizations": [
      {
        "operation": "move",
        "source_field": "extracted_metadata.title",
        "destination_field": "metadata.title"
      },
      {
        "operation": "move",
        "source_field": "extracted_metadata.author",
        "destination_field": "metadata.author"
      },
      {
        "operation": "remove",
        "source_field": "extracted_metadata"
      }
    ]
  },
  "enrichments": [
    {
      "enrichment": "natural_language_understanding",
      "source_field": "title",
      "destination_field": "enriched_title",
      "options": {
        "features": {
          "keywords": {
            "sentiment": true,
            "emotion": false,
            "limit": 50
          },
          "entities": {
            "sentiment": true,
            "emotion": false,
            "limit": 50,
            "mentions": true,
            "mention_types": true,
            "sentence_locations": true,
            "model": "WKS-model-id"
          },
          "sentiment": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "emotion": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "categories": {},
          "concepts": {
            "limit": 8
          },
          "semantic_roles": {
            "entities": true,
            "keywords": true,
            "limit": 50
          },
          "relations": {
            "model": "WKS-model-id"
          }
        }
      }
    }
  ],
  "normalizations": [
    {
      "operation": "move",
      "source_field": "metadata.title",
      "destination_field": "title"
    },
    {
      "operation": "move",
      "source_field": "metadata.author",
      "destination_field": "author"
    },
    {
      "operation": "remove",
      "source_field": "html"
    },
    {
      "operation": "remove_nulls"
    }
  ],
  "source": {
    "type": "salesforce",
    "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
    "schedule": {
      "enabled": true,
      "time_zone": "America/New_York",
      "frequency": "weekly"
    },
    "options": {
      "site_collections": [
        {
          "site_collection_path": "/sites/TestSiteA",
          "limit": 10
        }
      ]
    }
  }
}

Status Code

  • Configuration successfully created.

  • Bad request.

  • Forbidden. Returned if you attempt to add a configuration to a read-only environment.

Example responses
  • {
      "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
      "name": "IBM News",
      "created": "2015-08-24T18:42:25.324Z",
      "updated": "2015-08-24T18:42:25.324Z",
      "description": "A configuration useful for ingesting IBM press releases.",
      "conversions": {
        "html": {
          "exclude_tags_keep_content": [
            "span"
          ],
          "exclude_content": {
            "xpaths": [
              "/home"
            ]
          }
        },
        "segment": {
          "enabled": true,
          "annotated_fields": [
            "custom-field-1",
            "custom-field-2"
          ]
        },
        "json_normalizations": [
          {
            "operation": "move",
            "source_field": "extracted_metadata.title",
            "destination_field": "metadata.title"
          },
          {
            "operation": "move",
            "source_field": "extracted_metadata.author",
            "destination_field": "metadata.author"
          },
          {
            "operation": "remove",
            "source_field": "extracted_metadata"
          }
        ]
      },
      "enrichments": [
        {
          "enrichment": "natural_language_understanding",
          "source_field": "title",
          "destination_field": "enriched_title",
          "options": {
            "features": {
              "keywords": {
                "sentiment": true,
                "emotion": false,
                "limit": 50
              },
              "entities": {
                "sentiment": true,
                "emotion": false,
                "limit": 50,
                "mentions": true,
                "mention_types": true,
                "sentence_locations": true,
                "model": "WKS-model-id"
              },
              "sentiment": {
                "document": true,
                "targets": [
                  "IBM",
                  "Watson"
                ]
              },
              "emotion": {
                "document": true,
                "targets": [
                  "IBM",
                  "Watson"
                ]
              },
              "categories": {},
              "concepts": {
                "limit": 8
              },
              "semantic_roles": {
                "entities": true,
                "keywords": true,
                "limit": 50
              },
              "relations": {
                "model": "WKS-model-id"
              }
            }
          }
        }
      ],
      "normalizations": [
        {
          "operation": "move",
          "source_field": "metadata.title",
          "destination_field": "title"
        },
        {
          "operation": "move",
          "source_field": "metadata.author",
          "destination_field": "author"
        },
        {
          "operation": "remove",
          "source_field": "html"
        },
        {
          "operation": "remove_nulls"
        }
      ],
      "source": {
        "type": "salesforce",
        "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
        "schedule": {
          "enabled": true,
          "time_zone": "America/New_York",
          "frequency": "weekly"
        },
        "options": {
          "site_collections": [
            {
              "site_collection_path": "/sites/TestSiteA",
              "limit": 10
            }
          ]
        }
      }
    }
  • {
      "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
      "name": "IBM News",
      "created": "2015-08-24T18:42:25.324Z",
      "updated": "2015-08-24T18:42:25.324Z",
      "description": "A configuration useful for ingesting IBM press releases.",
      "conversions": {
        "html": {
          "exclude_tags_keep_content": [
            "span"
          ],
          "exclude_content": {
            "xpaths": [
              "/home"
            ]
          }
        },
        "segment": {
          "enabled": true,
          "annotated_fields": [
            "custom-field-1",
            "custom-field-2"
          ]
        },
        "json_normalizations": [
          {
            "operation": "move",
            "source_field": "extracted_metadata.title",
            "destination_field": "metadata.title"
          },
          {
            "operation": "move",
            "source_field": "extracted_metadata.author",
            "destination_field": "metadata.author"
          },
          {
            "operation": "remove",
            "source_field": "extracted_metadata"
          }
        ]
      },
      "enrichments": [
        {
          "enrichment": "natural_language_understanding",
          "source_field": "title",
          "destination_field": "enriched_title",
          "options": {
            "features": {
              "keywords": {
                "sentiment": true,
                "emotion": false,
                "limit": 50
              },
              "entities": {
                "sentiment": true,
                "emotion": false,
                "limit": 50,
                "mentions": true,
                "mention_types": true,
                "sentence_locations": true,
                "model": "WKS-model-id"
              },
              "sentiment": {
                "document": true,
                "targets": [
                  "IBM",
                  "Watson"
                ]
              },
              "emotion": {
                "document": true,
                "targets": [
                  "IBM",
                  "Watson"
                ]
              },
              "categories": {},
              "concepts": {
                "limit": 8
              },
              "semantic_roles": {
                "entities": true,
                "keywords": true,
                "limit": 50
              },
              "relations": {
                "model": "WKS-model-id"
              }
            }
          }
        }
      ],
      "normalizations": [
        {
          "operation": "move",
          "source_field": "metadata.title",
          "destination_field": "title"
        },
        {
          "operation": "move",
          "source_field": "metadata.author",
          "destination_field": "author"
        },
        {
          "operation": "remove",
          "source_field": "html"
        },
        {
          "operation": "remove_nulls"
        }
      ],
      "source": {
        "type": "salesforce",
        "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
        "schedule": {
          "enabled": true,
          "time_zone": "America/New_York",
          "frequency": "weekly"
        },
        "options": {
          "site_collections": [
            {
              "site_collection_path": "/sites/TestSiteA",
              "limit": 10
            }
          ]
        }
      }
    }

List configurations

Lists existing configurations for the service instance.

Lists existing configurations for the service instance.

Lists existing configurations for the service instance.

Lists existing configurations for the service instance.

Lists existing configurations for the service instance.

GET /v1/environments/{environment_id}/configurations
ServiceCall<ListConfigurationsResponse> listConfigurations(ListConfigurationsOptions listConfigurationsOptions)
listConfigurations(params)
list_configurations(
        self,
        environment_id: str,
        *,
        name: str = None,
        **kwargs,
    ) -> DetailedResponse
ListConfigurations(string environmentId, string name = null)

Request

Use the ListConfigurationsOptions.Builder to create a ListConfigurationsOptions object that contains the parameter values for the listConfigurations method.

Path Parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

Query Parameters

  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

  • Find configurations with the given name.

The listConfigurations options.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • Find configurations with the given name.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • Find configurations with the given name.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • Find configurations with the given name.

  • curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/configurations?version=2019-04-30"
  • IamAuthenticator authenticator = new IamAuthenticator(
        apikey: "{apikey}"
        );
    
    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
    discovery.SetServiceUrl("{url}");
    
    var result = discovery.ListConfigurations(
        environmentId: "{environmentId}"
        );
    
    Console.WriteLine(result.Response);
  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
    Discovery discovery = new Discovery("2019-04-30", authenticator);
    discovery.setServiceUrl("{url}");
    
    String environmentId = "{environment_id}";
    
    ListConfigurationsOptions listOptions = new ListConfigurationsOptions.Builder(environmentId).build();
    ListConfigurationsResponse listResponse = discovery.listConfigurations(listOptions).execute().getResult();
  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
    const { IamAuthenticator } = require('ibm-watson/auth');
    
    const discovery = new DiscoveryV1({
      version: '2019-04-30',
      authenticator: new IamAuthenticator({
        apikey: '{apikey}',
      }),
      serviceUrl: '{url}',
    });
    
    const listConfigurationsParams = {
      environmentId: '{environment_id}',
    };
    
    discovery.listConfigurations(listConfigurationsParams)
      .then(listConfigurationsResponse => {
        console.log(JSON.stringify(listConfigurationsResponse, null, 2));
      })
      .catch(err => {
        console.log('error:', err);
      });
  • import json
    from ibm_watson import DiscoveryV1
    from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
    
    authenticator = IAMAuthenticator('{apikey}')
    discovery = DiscoveryV1(
        version='2019-04-30',
        authenticator=authenticator
    )
    
    discovery.set_service_url('{url}')
    
    configs = discovery.list_configurations('{environment_id}').get_result()
    print(json.dumps(configs, indent=2))

Response

Object containing an array of available configurations.

Object containing an array of available configurations.

Object containing an array of available configurations.

Object containing an array of available configurations.

Object containing an array of available configurations.

Status Code

  • Successful response.

  • Bad request.

No Sample Response

This method does not specify any sample responses.

Get configuration details

GET /v1/environments/{environment_id}/configurations/{configuration_id}
ServiceCall<Configuration> getConfiguration(GetConfigurationOptions getConfigurationOptions)
getConfiguration(params)
get_configuration(
        self,
        environment_id: str,
        configuration_id: str,
        **kwargs,
    ) -> DetailedResponse
GetConfiguration(string environmentId, string configurationId)

Request

Use the GetConfigurationOptions.Builder to create a GetConfigurationOptions object that contains the parameter values for the getConfiguration method.

Path Parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

  • The ID of the configuration.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

Query Parameters

  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

The getConfiguration options.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the configuration.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the configuration.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the configuration.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/configurations/{configuration_id}?version=2019-04-30"
  • IamAuthenticator authenticator = new IamAuthenticator(
        apikey: "{apikey}"
        );
    
    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
    discovery.SetServiceUrl("{url}");
    
    var result = discovery.GetConfiguration(
        environmentId: "{environmentId}",
        configurationId: "{configurationId}"
        );
    
    Console.WriteLine(result.Response);
  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
    Discovery discovery = new Discovery("2019-04-30", authenticator);
    discovery.setServiceUrl("{url}");
    
    String environmentId = "{environment_id}";
    String configurationId = "{configuration_id}";
    
    GetConfigurationOptions getOptions = new GetConfigurationOptions.Builder(environmentId, configurationId).build();
    Configuration getResponse = discovery.getConfiguration(getOptions).execute().getResult();
  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
    const { IamAuthenticator } = require('ibm-watson/auth');
    
    const discovery = new DiscoveryV1({
      version: '2019-04-30',
      authenticator: new IamAuthenticator({
        apikey: '{apikey}',
      }),
      serviceUrl: '{url}',
    });
    
    const getConfigurationParams = {
      environmentId: '{environment_id}',
      configurationId: '{configuration_id}',
    };
    
    discovery.getConfiguration(getConfigurationParams)
      .then(configuration => {
        console.log(JSON.stringify(configuration, null, 2));
      })
      .catch(err => {
        console.log('error:', err);
      });
  • import json
    from ibm_watson import DiscoveryV1
    from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
    
    authenticator = IAMAuthenticator('{apikey}')
    discovery = DiscoveryV1(
        version='2019-04-30',
        authenticator=authenticator
    )
    
    discovery.set_service_url('{url}')
    
    config = discovery.get_configuration(
        '{environment_id}', 
        '{configuration_id}').get_result()
    print(json.dumps(config, indent=2))

Response

A custom configuration for the environment.

A custom configuration for the environment.

Examples:
{
  "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
  "name": "IBM News",
  "created": "2015-08-24T18:42:25.324Z",
  "updated": "2015-08-24T18:42:25.324Z",
  "description": "A configuration useful for ingesting IBM press releases.",
  "conversions": {
    "html": {
      "exclude_tags_keep_content": [
        "span"
      ],
      "exclude_content": {
        "xpaths": [
          "/home"
        ]
      }
    },
    "segment": {
      "enabled": true,
      "annotated_fields": [
        "custom-field-1",
        "custom-field-2"
      ]
    },
    "json_normalizations": [
      {
        "operation": "move",
        "source_field": "extracted_metadata.title",
        "destination_field": "metadata.title"
      },
      {
        "operation": "move",
        "source_field": "extracted_metadata.author",
        "destination_field": "metadata.author"
      },
      {
        "operation": "remove",
        "source_field": "extracted_metadata"
      }
    ]
  },
  "enrichments": [
    {
      "enrichment": "natural_language_understanding",
      "source_field": "title",
      "destination_field": "enriched_title",
      "options": {
        "features": {
          "keywords": {
            "sentiment": true,
            "emotion": false,
            "limit": 50
          },
          "entities": {
            "sentiment": true,
            "emotion": false,
            "limit": 50,
            "mentions": true,
            "mention_types": true,
            "sentence_locations": true,
            "model": "WKS-model-id"
          },
          "sentiment": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "emotion": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "categories": {},
          "concepts": {
            "limit": 8
          },
          "semantic_roles": {
            "entities": true,
            "keywords": true,
            "limit": 50
          },
          "relations": {
            "model": "WKS-model-id"
          }
        }
      }
    }
  ],
  "normalizations": [
    {
      "operation": "move",
      "source_field": "metadata.title",
      "destination_field": "title"
    },
    {
      "operation": "move",
      "source_field": "metadata.author",
      "destination_field": "author"
    },
    {
      "operation": "remove",
      "source_field": "html"
    },
    {
      "operation": "remove_nulls"
    }
  ],
  "source": {
    "type": "salesforce",
    "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
    "schedule": {
      "enabled": true,
      "time_zone": "America/New_York",
      "frequency": "weekly"
    },
    "options": {
      "site_collections": [
        {
          "site_collection_path": "/sites/TestSiteA",
          "limit": 10
        }
      ]
    }
  }
}

A custom configuration for the environment.

Examples:
{
  "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
  "name": "IBM News",
  "created": "2015-08-24T18:42:25.324Z",
  "updated": "2015-08-24T18:42:25.324Z",
  "description": "A configuration useful for ingesting IBM press releases.",
  "conversions": {
    "html": {
      "exclude_tags_keep_content": [
        "span"
      ],
      "exclude_content": {
        "xpaths": [
          "/home"
        ]
      }
    },
    "segment": {
      "enabled": true,
      "annotated_fields": [
        "custom-field-1",
        "custom-field-2"
      ]
    },
    "json_normalizations": [
      {
        "operation": "move",
        "source_field": "extracted_metadata.title",
        "destination_field": "metadata.title"
      },
      {
        "operation": "move",
        "source_field": "extracted_metadata.author",
        "destination_field": "metadata.author"
      },
      {
        "operation": "remove",
        "source_field": "extracted_metadata"
      }
    ]
  },
  "enrichments": [
    {
      "enrichment": "natural_language_understanding",
      "source_field": "title",
      "destination_field": "enriched_title",
      "options": {
        "features": {
          "keywords": {
            "sentiment": true,
            "emotion": false,
            "limit": 50
          },
          "entities": {
            "sentiment": true,
            "emotion": false,
            "limit": 50,
            "mentions": true,
            "mention_types": true,
            "sentence_locations": true,
            "model": "WKS-model-id"
          },
          "sentiment": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "emotion": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "categories": {},
          "concepts": {
            "limit": 8
          },
          "semantic_roles": {
            "entities": true,
            "keywords": true,
            "limit": 50
          },
          "relations": {
            "model": "WKS-model-id"
          }
        }
      }
    }
  ],
  "normalizations": [
    {
      "operation": "move",
      "source_field": "metadata.title",
      "destination_field": "title"
    },
    {
      "operation": "move",
      "source_field": "metadata.author",
      "destination_field": "author"
    },
    {
      "operation": "remove",
      "source_field": "html"
    },
    {
      "operation": "remove_nulls"
    }
  ],
  "source": {
    "type": "salesforce",
    "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
    "schedule": {
      "enabled": true,
      "time_zone": "America/New_York",
      "frequency": "weekly"
    },
    "options": {
      "site_collections": [
        {
          "site_collection_path": "/sites/TestSiteA",
          "limit": 10
        }
      ]
    }
  }
}

A custom configuration for the environment.

Examples:
{
  "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
  "name": "IBM News",
  "created": "2015-08-24T18:42:25.324Z",
  "updated": "2015-08-24T18:42:25.324Z",
  "description": "A configuration useful for ingesting IBM press releases.",
  "conversions": {
    "html": {
      "exclude_tags_keep_content": [
        "span"
      ],
      "exclude_content": {
        "xpaths": [
          "/home"
        ]
      }
    },
    "segment": {
      "enabled": true,
      "annotated_fields": [
        "custom-field-1",
        "custom-field-2"
      ]
    },
    "json_normalizations": [
      {
        "operation": "move",
        "source_field": "extracted_metadata.title",
        "destination_field": "metadata.title"
      },
      {
        "operation": "move",
        "source_field": "extracted_metadata.author",
        "destination_field": "metadata.author"
      },
      {
        "operation": "remove",
        "source_field": "extracted_metadata"
      }
    ]
  },
  "enrichments": [
    {
      "enrichment": "natural_language_understanding",
      "source_field": "title",
      "destination_field": "enriched_title",
      "options": {
        "features": {
          "keywords": {
            "sentiment": true,
            "emotion": false,
            "limit": 50
          },
          "entities": {
            "sentiment": true,
            "emotion": false,
            "limit": 50,
            "mentions": true,
            "mention_types": true,
            "sentence_locations": true,
            "model": "WKS-model-id"
          },
          "sentiment": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "emotion": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "categories": {},
          "concepts": {
            "limit": 8
          },
          "semantic_roles": {
            "entities": true,
            "keywords": true,
            "limit": 50
          },
          "relations": {
            "model": "WKS-model-id"
          }
        }
      }
    }
  ],
  "normalizations": [
    {
      "operation": "move",
      "source_field": "metadata.title",
      "destination_field": "title"
    },
    {
      "operation": "move",
      "source_field": "metadata.author",
      "destination_field": "author"
    },
    {
      "operation": "remove",
      "source_field": "html"
    },
    {
      "operation": "remove_nulls"
    }
  ],
  "source": {
    "type": "salesforce",
    "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
    "schedule": {
      "enabled": true,
      "time_zone": "America/New_York",
      "frequency": "weekly"
    },
    "options": {
      "site_collections": [
        {
          "site_collection_path": "/sites/TestSiteA",
          "limit": 10
        }
      ]
    }
  }
}

A custom configuration for the environment.

Examples:
{
  "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
  "name": "IBM News",
  "created": "2015-08-24T18:42:25.324Z",
  "updated": "2015-08-24T18:42:25.324Z",
  "description": "A configuration useful for ingesting IBM press releases.",
  "conversions": {
    "html": {
      "exclude_tags_keep_content": [
        "span"
      ],
      "exclude_content": {
        "xpaths": [
          "/home"
        ]
      }
    },
    "segment": {
      "enabled": true,
      "annotated_fields": [
        "custom-field-1",
        "custom-field-2"
      ]
    },
    "json_normalizations": [
      {
        "operation": "move",
        "source_field": "extracted_metadata.title",
        "destination_field": "metadata.title"
      },
      {
        "operation": "move",
        "source_field": "extracted_metadata.author",
        "destination_field": "metadata.author"
      },
      {
        "operation": "remove",
        "source_field": "extracted_metadata"
      }
    ]
  },
  "enrichments": [
    {
      "enrichment": "natural_language_understanding",
      "source_field": "title",
      "destination_field": "enriched_title",
      "options": {
        "features": {
          "keywords": {
            "sentiment": true,
            "emotion": false,
            "limit": 50
          },
          "entities": {
            "sentiment": true,
            "emotion": false,
            "limit": 50,
            "mentions": true,
            "mention_types": true,
            "sentence_locations": true,
            "model": "WKS-model-id"
          },
          "sentiment": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "emotion": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "categories": {},
          "concepts": {
            "limit": 8
          },
          "semantic_roles": {
            "entities": true,
            "keywords": true,
            "limit": 50
          },
          "relations": {
            "model": "WKS-model-id"
          }
        }
      }
    }
  ],
  "normalizations": [
    {
      "operation": "move",
      "source_field": "metadata.title",
      "destination_field": "title"
    },
    {
      "operation": "move",
      "source_field": "metadata.author",
      "destination_field": "author"
    },
    {
      "operation": "remove",
      "source_field": "html"
    },
    {
      "operation": "remove_nulls"
    }
  ],
  "source": {
    "type": "salesforce",
    "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
    "schedule": {
      "enabled": true,
      "time_zone": "America/New_York",
      "frequency": "weekly"
    },
    "options": {
      "site_collections": [
        {
          "site_collection_path": "/sites/TestSiteA",
          "limit": 10
        }
      ]
    }
  }
}

Status Code

  • Configuration successfully fetched.

  • Bad request.

Example responses
  • {
      "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
      "name": "IBM News",
      "created": "2015-08-24T18:42:25.324Z",
      "updated": "2015-08-24T18:42:25.324Z",
      "description": "A configuration useful for ingesting IBM press releases.",
      "conversions": {
        "html": {
          "exclude_tags_keep_content": [
            "span"
          ],
          "exclude_content": {
            "xpaths": [
              "/home"
            ]
          }
        },
        "segment": {
          "enabled": true,
          "annotated_fields": [
            "custom-field-1",
            "custom-field-2"
          ]
        },
        "json_normalizations": [
          {
            "operation": "move",
            "source_field": "extracted_metadata.title",
            "destination_field": "metadata.title"
          },
          {
            "operation": "move",
            "source_field": "extracted_metadata.author",
            "destination_field": "metadata.author"
          },
          {
            "operation": "remove",
            "source_field": "extracted_metadata"
          }
        ]
      },
      "enrichments": [
        {
          "enrichment": "natural_language_understanding",
          "source_field": "title",
          "destination_field": "enriched_title",
          "options": {
            "features": {
              "keywords": {
                "sentiment": true,
                "emotion": false,
                "limit": 50
              },
              "entities": {
                "sentiment": true,
                "emotion": false,
                "limit": 50,
                "mentions": true,
                "mention_types": true,
                "sentence_locations": true,
                "model": "WKS-model-id"
              },
              "sentiment": {
                "document": true,
                "targets": [
                  "IBM",
                  "Watson"
                ]
              },
              "emotion": {
                "document": true,
                "targets": [
                  "IBM",
                  "Watson"
                ]
              },
              "categories": {},
              "concepts": {
                "limit": 8
              },
              "semantic_roles": {
                "entities": true,
                "keywords": true,
                "limit": 50
              },
              "relations": {
                "model": "WKS-model-id"
              }
            }
          }
        }
      ],
      "normalizations": [
        {
          "operation": "move",
          "source_field": "metadata.title",
          "destination_field": "title"
        },
        {
          "operation": "move",
          "source_field": "metadata.author",
          "destination_field": "author"
        },
        {
          "operation": "remove",
          "source_field": "html"
        },
        {
          "operation": "remove_nulls"
        }
      ],
      "source": {
        "type": "salesforce",
        "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
        "schedule": {
          "enabled": true,
          "time_zone": "America/New_York",
          "frequency": "weekly"
        },
        "options": {
          "site_collections": [
            {
              "site_collection_path": "/sites/TestSiteA",
              "limit": 10
            }
          ]
        }
      }
    }
  • {
      "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
      "name": "IBM News",
      "created": "2015-08-24T18:42:25.324Z",
      "updated": "2015-08-24T18:42:25.324Z",
      "description": "A configuration useful for ingesting IBM press releases.",
      "conversions": {
        "html": {
          "exclude_tags_keep_content": [
            "span"
          ],
          "exclude_content": {
            "xpaths": [
              "/home"
            ]
          }
        },
        "segment": {
          "enabled": true,
          "annotated_fields": [
            "custom-field-1",
            "custom-field-2"
          ]
        },
        "json_normalizations": [
          {
            "operation": "move",
            "source_field": "extracted_metadata.title",
            "destination_field": "metadata.title"
          },
          {
            "operation": "move",
            "source_field": "extracted_metadata.author",
            "destination_field": "metadata.author"
          },
          {
            "operation": "remove",
            "source_field": "extracted_metadata"
          }
        ]
      },
      "enrichments": [
        {
          "enrichment": "natural_language_understanding",
          "source_field": "title",
          "destination_field": "enriched_title",
          "options": {
            "features": {
              "keywords": {
                "sentiment": true,
                "emotion": false,
                "limit": 50
              },
              "entities": {
                "sentiment": true,
                "emotion": false,
                "limit": 50,
                "mentions": true,
                "mention_types": true,
                "sentence_locations": true,
                "model": "WKS-model-id"
              },
              "sentiment": {
                "document": true,
                "targets": [
                  "IBM",
                  "Watson"
                ]
              },
              "emotion": {
                "document": true,
                "targets": [
                  "IBM",
                  "Watson"
                ]
              },
              "categories": {},
              "concepts": {
                "limit": 8
              },
              "semantic_roles": {
                "entities": true,
                "keywords": true,
                "limit": 50
              },
              "relations": {
                "model": "WKS-model-id"
              }
            }
          }
        }
      ],
      "normalizations": [
        {
          "operation": "move",
          "source_field": "metadata.title",
          "destination_field": "title"
        },
        {
          "operation": "move",
          "source_field": "metadata.author",
          "destination_field": "author"
        },
        {
          "operation": "remove",
          "source_field": "html"
        },
        {
          "operation": "remove_nulls"
        }
      ],
      "source": {
        "type": "salesforce",
        "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
        "schedule": {
          "enabled": true,
          "time_zone": "America/New_York",
          "frequency": "weekly"
        },
        "options": {
          "site_collections": [
            {
              "site_collection_path": "/sites/TestSiteA",
              "limit": 10
            }
          ]
        }
      }
    }

Update a configuration

Replaces an existing configuration.

  • Completely replaces the original configuration.
  • The configuration_id, updated, and created fields are accepted in the request, but they are ignored, and an error is not generated. It is also acceptable for users to submit an updated configuration with none of the three properties.
  • Documents are processed with a snapshot of the configuration as it was at the time the document was submitted to be ingested. This means that already submitted documents will not see any updates made to the configuration.

Replaces an existing configuration.

  • Completely replaces the original configuration.
  • The configuration_id, updated, and created fields are accepted in the request, but they are ignored, and an error is not generated. It is also acceptable for users to submit an updated configuration with none of the three properties.
  • Documents are processed with a snapshot of the configuration as it was at the time the document was submitted to be ingested. This means that already submitted documents will not see any updates made to the configuration.

Replaces an existing configuration.

  • Completely replaces the original configuration.
  • The configuration_id, updated, and created fields are accepted in the request, but they are ignored, and an error is not generated. It is also acceptable for users to submit an updated configuration with none of the three properties.
  • Documents are processed with a snapshot of the configuration as it was at the time the document was submitted to be ingested. This means that already submitted documents will not see any updates made to the configuration.

Replaces an existing configuration.

  • Completely replaces the original configuration.
  • The configuration_id, updated, and created fields are accepted in the request, but they are ignored, and an error is not generated. It is also acceptable for users to submit an updated configuration with none of the three properties.
  • Documents are processed with a snapshot of the configuration as it was at the time the document was submitted to be ingested. This means that already submitted documents will not see any updates made to the configuration.

Replaces an existing configuration.

  • Completely replaces the original configuration.
  • The configuration_id, updated, and created fields are accepted in the request, but they are ignored, and an error is not generated. It is also acceptable for users to submit an updated configuration with none of the three properties.
  • Documents are processed with a snapshot of the configuration as it was at the time the document was submitted to be ingested. This means that already submitted documents will not see any updates made to the configuration.
PUT /v1/environments/{environment_id}/configurations/{configuration_id}
ServiceCall<Configuration> updateConfiguration(UpdateConfigurationOptions updateConfigurationOptions)
updateConfiguration(params)
update_configuration(
        self,
        environment_id: str,
        configuration_id: str,
        name: str,
        *,
        description: str = None,
        conversions: 'Conversions' = None,
        enrichments: List['Enrichment'] = None,
        normalizations: List['NormalizationOperation'] = None,
        source: 'Source' = None,
        **kwargs,
    ) -> DetailedResponse
UpdateConfiguration(string environmentId, string configurationId, string name, string description = null, Conversions conversions = null, List<Enrichment> enrichments = null, List<NormalizationOperation> normalizations = null, Source source = null)

Request

Use the UpdateConfigurationOptions.Builder to create a UpdateConfigurationOptions object that contains the parameter values for the updateConfiguration method.

Path Parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

  • The ID of the configuration.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

Query Parameters

  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

Input an object that enables you to update and customize how your data is ingested and what enrichments are added to your data. The name parameter is required and must be unique within the current environment. All other properties are optional, but if they are omitted the default values replace the current value of each omitted property.

If the input configuration contains the configuration_id, created, or updated properties, they are ignored and overridden by the system, and an error is not returned so that the overridden fields do not need to be removed when updating a configuration.

The configuration can contain unrecognized JSON fields. Any such fields are ignored and do not generate an error. This makes it easier to use newer configuration files with older versions of the API and the service. It also makes it possible for the tooling to add additional metadata and information to the configuration.

Examples:
{
  "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
  "name": "IBM News",
  "created": "2015-08-24T18:42:25.324Z",
  "updated": "2015-08-24T18:42:25.324Z",
  "description": "A configuration useful for ingesting IBM press releases.",
  "conversions": {
    "html": {
      "exclude_tags_keep_content": [
        "span"
      ],
      "exclude_content": {
        "xpaths": [
          "/home"
        ]
      }
    },
    "segment": {
      "enabled": true,
      "annotated_fields": [
        "custom-field-1",
        "custom-field-2"
      ]
    },
    "json_normalizations": [
      {
        "operation": "move",
        "source_field": "extracted_metadata.title",
        "destination_field": "metadata.title"
      },
      {
        "operation": "move",
        "source_field": "extracted_metadata.author",
        "destination_field": "metadata.author"
      },
      {
        "operation": "remove",
        "source_field": "extracted_metadata"
      }
    ]
  },
  "enrichments": [
    {
      "enrichment": "natural_language_understanding",
      "source_field": "title",
      "destination_field": "enriched_title",
      "options": {
        "features": {
          "keywords": {
            "sentiment": true,
            "emotion": false,
            "limit": 50
          },
          "entities": {
            "sentiment": true,
            "emotion": false,
            "limit": 50,
            "mentions": true,
            "mention_types": true,
            "sentence_locations": true,
            "model": "WKS-model-id"
          },
          "sentiment": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "emotion": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "categories": {},
          "concepts": {
            "limit": 8
          },
          "semantic_roles": {
            "entities": true,
            "keywords": true,
            "limit": 50
          },
          "relations": {
            "model": "WKS-model-id"
          }
        }
      }
    }
  ],
  "normalizations": [
    {
      "operation": "move",
      "source_field": "metadata.title",
      "destination_field": "title"
    },
    {
      "operation": "move",
      "source_field": "metadata.author",
      "destination_field": "author"
    },
    {
      "operation": "remove",
      "source_field": "html"
    },
    {
      "operation": "remove_nulls"
    }
  ],
  "source": {
    "type": "salesforce",
    "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
    "schedule": {
      "enabled": true,
      "time_zone": "America/New_York",
      "frequency": "weekly"
    },
    "options": {
      "site_collections": [
        {
          "site_collection_path": "/sites/TestSiteA",
          "limit": 10
        }
      ]
    }
  }
}

The updateConfiguration options.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the configuration.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The name of the configuration.

    Possible values: 0 ≤ length ≤ 255

  • The description of the configuration, if available.

  • Document conversion settings.

  • An array of document enrichment settings for the configuration.

  • Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.

  • Object containing source parameters for the configuration.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the configuration.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The name of the configuration.

    Possible values: 0 ≤ length ≤ 255

  • The description of the configuration, if available.

  • Document conversion settings.

  • An array of document enrichment settings for the configuration.

  • Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.

  • Object containing source parameters for the configuration.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the configuration.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The name of the configuration.

    Possible values: 0 ≤ length ≤ 255

  • The description of the configuration, if available.

  • Document conversion settings.

  • An array of document enrichment settings for the configuration.

  • Defines operations that can be used to transform the final output JSON into a normalized form. Operations are executed in the order that they appear in the array.

  • Object containing source parameters for the configuration.

  • curl -X PUT -u "apikey":"{apikey}" -H "Content-Type: application/json" -d @new_config.json "{url}/v1/environments/{environment_id}/configurations/{configuration_id}?version=2019-04-30"
  • IamAuthenticator authenticator = new IamAuthenticator(
        apikey: "{apikey}"
        );
    
    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
    discovery.SetServiceUrl("{url}");
    
    var result = discovery.UpdateConfiguration(
        environmentId: "{environmentId}",
        configurationId: "{configurationId}",
        name: "new-config"
        );
    
    Console.WriteLine(result.Response);
  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
    Discovery discovery = new Discovery("2019-04-30", authenticator);
    discovery.setServiceUrl("{url}");
    
    String environmentId = "{environment_id}";
    String configurationId = "{configuration_id}";
    String updatedConfigurationName = "new-config";
    Configuration updatedConfiguration = GsonSingleton.getGson().fromJson(
        new FileReader("{updatedConfigFilePath}"),
            com.ibm.watson.internal.discovery.model.configuration.Configuration.class);
    
    UpdateConfigurationOptions.Builder updateBuilder = new UpdateConfigurationOptions.Builder(environmentId, configurationId, updatedConfigurationName);
    updateBuilder.configuration(updatedConfiguration);
    Configuration updateResponse = discovery.updateConfiguration(updateBuilder.build()).execute().getResult();
  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
    const { IamAuthenticator } = require('ibm-watson/auth');
    
    const discovery = new DiscoveryV1({
      version: '2019-04-30',
      authenticator: new IamAuthenticator({
        apikey: '{apikey}',
      }),
      serviceUrl: '{url}',
    });
    
    const updateConfigurationParams = {
      environmentId: '{environment_id}',
      configurationId: '{configuration_id}',
      name: '{updated or original name if updating another parameter (name is required)}',
    };
    
    discovery.updateConfiguration(updateConfigurationParams)
      .then(configuration => {
        console.log(JSON.stringify(configuration, null, 2));
      })
      .catch(err => {
        console.log('error:', err);
      });
  • import os
    import json
    from ibm_watson import DiscoveryV1
    from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
    
    authenticator = IAMAuthenticator('{apikey}')
    discovery = DiscoveryV1(
        version='2019-04-30',
        authenticator=authenticator
    )
    
    discovery.set_service_url('{url}')
    
    with open(os.path.join(os.getcwd(), 'config_update.json')) as config_data:
        data = json.load(config_data)
        updated_config = discovery.update_configuration(
            '{environment_id}',
            '{configuration_id}',
            data['name'],
            description=data['description'], 
            conversions=data['conversions'], 
            enrichments=data['enrichments'], 
            normalizations=data['normalizations']).get_result()
    print(json.dumps(updated_config, indent=2))

Response

A custom configuration for the environment.

A custom configuration for the environment.

Examples:
{
  "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
  "name": "IBM News",
  "created": "2015-08-24T18:42:25.324Z",
  "updated": "2015-08-24T18:42:25.324Z",
  "description": "A configuration useful for ingesting IBM press releases.",
  "conversions": {
    "html": {
      "exclude_tags_keep_content": [
        "span"
      ],
      "exclude_content": {
        "xpaths": [
          "/home"
        ]
      }
    },
    "segment": {
      "enabled": true,
      "annotated_fields": [
        "custom-field-1",
        "custom-field-2"
      ]
    },
    "json_normalizations": [
      {
        "operation": "move",
        "source_field": "extracted_metadata.title",
        "destination_field": "metadata.title"
      },
      {
        "operation": "move",
        "source_field": "extracted_metadata.author",
        "destination_field": "metadata.author"
      },
      {
        "operation": "remove",
        "source_field": "extracted_metadata"
      }
    ]
  },
  "enrichments": [
    {
      "enrichment": "natural_language_understanding",
      "source_field": "title",
      "destination_field": "enriched_title",
      "options": {
        "features": {
          "keywords": {
            "sentiment": true,
            "emotion": false,
            "limit": 50
          },
          "entities": {
            "sentiment": true,
            "emotion": false,
            "limit": 50,
            "mentions": true,
            "mention_types": true,
            "sentence_locations": true,
            "model": "WKS-model-id"
          },
          "sentiment": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "emotion": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "categories": {},
          "concepts": {
            "limit": 8
          },
          "semantic_roles": {
            "entities": true,
            "keywords": true,
            "limit": 50
          },
          "relations": {
            "model": "WKS-model-id"
          }
        }
      }
    }
  ],
  "normalizations": [
    {
      "operation": "move",
      "source_field": "metadata.title",
      "destination_field": "title"
    },
    {
      "operation": "move",
      "source_field": "metadata.author",
      "destination_field": "author"
    },
    {
      "operation": "remove",
      "source_field": "html"
    },
    {
      "operation": "remove_nulls"
    }
  ],
  "source": {
    "type": "salesforce",
    "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
    "schedule": {
      "enabled": true,
      "time_zone": "America/New_York",
      "frequency": "weekly"
    },
    "options": {
      "site_collections": [
        {
          "site_collection_path": "/sites/TestSiteA",
          "limit": 10
        }
      ]
    }
  }
}

A custom configuration for the environment.

Examples:
{
  "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
  "name": "IBM News",
  "created": "2015-08-24T18:42:25.324Z",
  "updated": "2015-08-24T18:42:25.324Z",
  "description": "A configuration useful for ingesting IBM press releases.",
  "conversions": {
    "html": {
      "exclude_tags_keep_content": [
        "span"
      ],
      "exclude_content": {
        "xpaths": [
          "/home"
        ]
      }
    },
    "segment": {
      "enabled": true,
      "annotated_fields": [
        "custom-field-1",
        "custom-field-2"
      ]
    },
    "json_normalizations": [
      {
        "operation": "move",
        "source_field": "extracted_metadata.title",
        "destination_field": "metadata.title"
      },
      {
        "operation": "move",
        "source_field": "extracted_metadata.author",
        "destination_field": "metadata.author"
      },
      {
        "operation": "remove",
        "source_field": "extracted_metadata"
      }
    ]
  },
  "enrichments": [
    {
      "enrichment": "natural_language_understanding",
      "source_field": "title",
      "destination_field": "enriched_title",
      "options": {
        "features": {
          "keywords": {
            "sentiment": true,
            "emotion": false,
            "limit": 50
          },
          "entities": {
            "sentiment": true,
            "emotion": false,
            "limit": 50,
            "mentions": true,
            "mention_types": true,
            "sentence_locations": true,
            "model": "WKS-model-id"
          },
          "sentiment": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "emotion": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "categories": {},
          "concepts": {
            "limit": 8
          },
          "semantic_roles": {
            "entities": true,
            "keywords": true,
            "limit": 50
          },
          "relations": {
            "model": "WKS-model-id"
          }
        }
      }
    }
  ],
  "normalizations": [
    {
      "operation": "move",
      "source_field": "metadata.title",
      "destination_field": "title"
    },
    {
      "operation": "move",
      "source_field": "metadata.author",
      "destination_field": "author"
    },
    {
      "operation": "remove",
      "source_field": "html"
    },
    {
      "operation": "remove_nulls"
    }
  ],
  "source": {
    "type": "salesforce",
    "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
    "schedule": {
      "enabled": true,
      "time_zone": "America/New_York",
      "frequency": "weekly"
    },
    "options": {
      "site_collections": [
        {
          "site_collection_path": "/sites/TestSiteA",
          "limit": 10
        }
      ]
    }
  }
}

A custom configuration for the environment.

Examples:
{
  "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
  "name": "IBM News",
  "created": "2015-08-24T18:42:25.324Z",
  "updated": "2015-08-24T18:42:25.324Z",
  "description": "A configuration useful for ingesting IBM press releases.",
  "conversions": {
    "html": {
      "exclude_tags_keep_content": [
        "span"
      ],
      "exclude_content": {
        "xpaths": [
          "/home"
        ]
      }
    },
    "segment": {
      "enabled": true,
      "annotated_fields": [
        "custom-field-1",
        "custom-field-2"
      ]
    },
    "json_normalizations": [
      {
        "operation": "move",
        "source_field": "extracted_metadata.title",
        "destination_field": "metadata.title"
      },
      {
        "operation": "move",
        "source_field": "extracted_metadata.author",
        "destination_field": "metadata.author"
      },
      {
        "operation": "remove",
        "source_field": "extracted_metadata"
      }
    ]
  },
  "enrichments": [
    {
      "enrichment": "natural_language_understanding",
      "source_field": "title",
      "destination_field": "enriched_title",
      "options": {
        "features": {
          "keywords": {
            "sentiment": true,
            "emotion": false,
            "limit": 50
          },
          "entities": {
            "sentiment": true,
            "emotion": false,
            "limit": 50,
            "mentions": true,
            "mention_types": true,
            "sentence_locations": true,
            "model": "WKS-model-id"
          },
          "sentiment": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "emotion": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "categories": {},
          "concepts": {
            "limit": 8
          },
          "semantic_roles": {
            "entities": true,
            "keywords": true,
            "limit": 50
          },
          "relations": {
            "model": "WKS-model-id"
          }
        }
      }
    }
  ],
  "normalizations": [
    {
      "operation": "move",
      "source_field": "metadata.title",
      "destination_field": "title"
    },
    {
      "operation": "move",
      "source_field": "metadata.author",
      "destination_field": "author"
    },
    {
      "operation": "remove",
      "source_field": "html"
    },
    {
      "operation": "remove_nulls"
    }
  ],
  "source": {
    "type": "salesforce",
    "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
    "schedule": {
      "enabled": true,
      "time_zone": "America/New_York",
      "frequency": "weekly"
    },
    "options": {
      "site_collections": [
        {
          "site_collection_path": "/sites/TestSiteA",
          "limit": 10
        }
      ]
    }
  }
}

A custom configuration for the environment.

Examples:
{
  "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
  "name": "IBM News",
  "created": "2015-08-24T18:42:25.324Z",
  "updated": "2015-08-24T18:42:25.324Z",
  "description": "A configuration useful for ingesting IBM press releases.",
  "conversions": {
    "html": {
      "exclude_tags_keep_content": [
        "span"
      ],
      "exclude_content": {
        "xpaths": [
          "/home"
        ]
      }
    },
    "segment": {
      "enabled": true,
      "annotated_fields": [
        "custom-field-1",
        "custom-field-2"
      ]
    },
    "json_normalizations": [
      {
        "operation": "move",
        "source_field": "extracted_metadata.title",
        "destination_field": "metadata.title"
      },
      {
        "operation": "move",
        "source_field": "extracted_metadata.author",
        "destination_field": "metadata.author"
      },
      {
        "operation": "remove",
        "source_field": "extracted_metadata"
      }
    ]
  },
  "enrichments": [
    {
      "enrichment": "natural_language_understanding",
      "source_field": "title",
      "destination_field": "enriched_title",
      "options": {
        "features": {
          "keywords": {
            "sentiment": true,
            "emotion": false,
            "limit": 50
          },
          "entities": {
            "sentiment": true,
            "emotion": false,
            "limit": 50,
            "mentions": true,
            "mention_types": true,
            "sentence_locations": true,
            "model": "WKS-model-id"
          },
          "sentiment": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "emotion": {
            "document": true,
            "targets": [
              "IBM",
              "Watson"
            ]
          },
          "categories": {},
          "concepts": {
            "limit": 8
          },
          "semantic_roles": {
            "entities": true,
            "keywords": true,
            "limit": 50
          },
          "relations": {
            "model": "WKS-model-id"
          }
        }
      }
    }
  ],
  "normalizations": [
    {
      "operation": "move",
      "source_field": "metadata.title",
      "destination_field": "title"
    },
    {
      "operation": "move",
      "source_field": "metadata.author",
      "destination_field": "author"
    },
    {
      "operation": "remove",
      "source_field": "html"
    },
    {
      "operation": "remove_nulls"
    }
  ],
  "source": {
    "type": "salesforce",
    "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
    "schedule": {
      "enabled": true,
      "time_zone": "America/New_York",
      "frequency": "weekly"
    },
    "options": {
      "site_collections": [
        {
          "site_collection_path": "/sites/TestSiteA",
          "limit": 10
        }
      ]
    }
  }
}

Status Code

  • Configuration successfully updated.

  • Bad request.

  • Forbidden. Returned if you attempt to update a read-only configuration or if you attempt to update a configuration in a read-only environment.

Example responses
  • {
      "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
      "name": "IBM News",
      "created": "2015-08-24T18:42:25.324Z",
      "updated": "2015-08-24T18:42:25.324Z",
      "description": "A configuration useful for ingesting IBM press releases.",
      "conversions": {
        "html": {
          "exclude_tags_keep_content": [
            "span"
          ],
          "exclude_content": {
            "xpaths": [
              "/home"
            ]
          }
        },
        "segment": {
          "enabled": true,
          "annotated_fields": [
            "custom-field-1",
            "custom-field-2"
          ]
        },
        "json_normalizations": [
          {
            "operation": "move",
            "source_field": "extracted_metadata.title",
            "destination_field": "metadata.title"
          },
          {
            "operation": "move",
            "source_field": "extracted_metadata.author",
            "destination_field": "metadata.author"
          },
          {
            "operation": "remove",
            "source_field": "extracted_metadata"
          }
        ]
      },
      "enrichments": [
        {
          "enrichment": "natural_language_understanding",
          "source_field": "title",
          "destination_field": "enriched_title",
          "options": {
            "features": {
              "keywords": {
                "sentiment": true,
                "emotion": false,
                "limit": 50
              },
              "entities": {
                "sentiment": true,
                "emotion": false,
                "limit": 50,
                "mentions": true,
                "mention_types": true,
                "sentence_locations": true,
                "model": "WKS-model-id"
              },
              "sentiment": {
                "document": true,
                "targets": [
                  "IBM",
                  "Watson"
                ]
              },
              "emotion": {
                "document": true,
                "targets": [
                  "IBM",
                  "Watson"
                ]
              },
              "categories": {},
              "concepts": {
                "limit": 8
              },
              "semantic_roles": {
                "entities": true,
                "keywords": true,
                "limit": 50
              },
              "relations": {
                "model": "WKS-model-id"
              }
            }
          }
        }
      ],
      "normalizations": [
        {
          "operation": "move",
          "source_field": "metadata.title",
          "destination_field": "title"
        },
        {
          "operation": "move",
          "source_field": "metadata.author",
          "destination_field": "author"
        },
        {
          "operation": "remove",
          "source_field": "html"
        },
        {
          "operation": "remove_nulls"
        }
      ],
      "source": {
        "type": "salesforce",
        "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
        "schedule": {
          "enabled": true,
          "time_zone": "America/New_York",
          "frequency": "weekly"
        },
        "options": {
          "site_collections": [
            {
              "site_collection_path": "/sites/TestSiteA",
              "limit": 10
            }
          ]
        }
      }
    }
  • {
      "configuration_id": "448e3545-51ca-4530-a03b-6ff282ceac2e",
      "name": "IBM News",
      "created": "2015-08-24T18:42:25.324Z",
      "updated": "2015-08-24T18:42:25.324Z",
      "description": "A configuration useful for ingesting IBM press releases.",
      "conversions": {
        "html": {
          "exclude_tags_keep_content": [
            "span"
          ],
          "exclude_content": {
            "xpaths": [
              "/home"
            ]
          }
        },
        "segment": {
          "enabled": true,
          "annotated_fields": [
            "custom-field-1",
            "custom-field-2"
          ]
        },
        "json_normalizations": [
          {
            "operation": "move",
            "source_field": "extracted_metadata.title",
            "destination_field": "metadata.title"
          },
          {
            "operation": "move",
            "source_field": "extracted_metadata.author",
            "destination_field": "metadata.author"
          },
          {
            "operation": "remove",
            "source_field": "extracted_metadata"
          }
        ]
      },
      "enrichments": [
        {
          "enrichment": "natural_language_understanding",
          "source_field": "title",
          "destination_field": "enriched_title",
          "options": {
            "features": {
              "keywords": {
                "sentiment": true,
                "emotion": false,
                "limit": 50
              },
              "entities": {
                "sentiment": true,
                "emotion": false,
                "limit": 50,
                "mentions": true,
                "mention_types": true,
                "sentence_locations": true,
                "model": "WKS-model-id"
              },
              "sentiment": {
                "document": true,
                "targets": [
                  "IBM",
                  "Watson"
                ]
              },
              "emotion": {
                "document": true,
                "targets": [
                  "IBM",
                  "Watson"
                ]
              },
              "categories": {},
              "concepts": {
                "limit": 8
              },
              "semantic_roles": {
                "entities": true,
                "keywords": true,
                "limit": 50
              },
              "relations": {
                "model": "WKS-model-id"
              }
            }
          }
        }
      ],
      "normalizations": [
        {
          "operation": "move",
          "source_field": "metadata.title",
          "destination_field": "title"
        },
        {
          "operation": "move",
          "source_field": "metadata.author",
          "destination_field": "author"
        },
        {
          "operation": "remove",
          "source_field": "html"
        },
        {
          "operation": "remove_nulls"
        }
      ],
      "source": {
        "type": "salesforce",
        "credential_id": "00ad0000-0000-11e8-ba89-0ed5f00f718b",
        "schedule": {
          "enabled": true,
          "time_zone": "America/New_York",
          "frequency": "weekly"
        },
        "options": {
          "site_collections": [
            {
              "site_collection_path": "/sites/TestSiteA",
              "limit": 10
            }
          ]
        }
      }
    }

Delete a configuration

The deletion is performed unconditionally. A configuration deletion request succeeds even if the configuration is referenced by a collection or document ingestion. However, documents that have already been submitted for processing continue to use the deleted configuration. Documents are always processed with a snapshot of the configuration as it existed at the time the document was submitted.

The deletion is performed unconditionally. A configuration deletion request succeeds even if the configuration is referenced by a collection or document ingestion. However, documents that have already been submitted for processing continue to use the deleted configuration. Documents are always processed with a snapshot of the configuration as it existed at the time the document was submitted.

The deletion is performed unconditionally. A configuration deletion request succeeds even if the configuration is referenced by a collection or document ingestion. However, documents that have already been submitted for processing continue to use the deleted configuration. Documents are always processed with a snapshot of the configuration as it existed at the time the document was submitted.

The deletion is performed unconditionally. A configuration deletion request succeeds even if the configuration is referenced by a collection or document ingestion. However, documents that have already been submitted for processing continue to use the deleted configuration. Documents are always processed with a snapshot of the configuration as it existed at the time the document was submitted.

The deletion is performed unconditionally. A configuration deletion request succeeds even if the configuration is referenced by a collection or document ingestion. However, documents that have already been submitted for processing continue to use the deleted configuration. Documents are always processed with a snapshot of the configuration as it existed at the time the document was submitted.

DELETE /v1/environments/{environment_id}/configurations/{configuration_id}
ServiceCall<DeleteConfigurationResponse> deleteConfiguration(DeleteConfigurationOptions deleteConfigurationOptions)
deleteConfiguration(params)
delete_configuration(
        self,
        environment_id: str,
        configuration_id: str,
        **kwargs,
    ) -> DetailedResponse
DeleteConfiguration(string environmentId, string configurationId)

Request

Use the DeleteConfigurationOptions.Builder to create a DeleteConfigurationOptions object that contains the parameter values for the deleteConfiguration method.

Path Parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

  • The ID of the configuration.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

Query Parameters

  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

The deleteConfiguration options.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the configuration.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the configuration.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the configuration.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • curl -X DELETE -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/configurations/{configuration_id}?version=2019-04-30"
  • IamAuthenticator authenticator = new IamAuthenticator(
        apikey: "{apikey}"
        );
    
    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
    discovery.SetServiceUrl("{url}");
    
    var result = discovery.DeleteConfiguration(
        environmentId: "{environmentId}",
        configurationId: "{configurationId}"
        );
    
    Console.WriteLine(result.Response);
  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
    Discovery discovery = new Discovery("2019-04-30", authenticator);
    discovery.setServiceUrl("{url}");
    
    String environmentId = "{environment_id}";
    String configurationId = "{configuration_id}";
    
    DeleteConfigurationOptions deleteRequest = new DeleteConfigurationOptions.Builder(environmentId, configurationId).build();
    DeleteConfigurationResponse deleteResponse = discovery.deleteConfiguration(deleteRequest).execute().getResult();
  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
    const { IamAuthenticator } = require('ibm-watson/auth');
    
    const discovery = new DiscoveryV1({
      version: '2019-04-30',
      authenticator: new IamAuthenticator({
        apikey: '{apikey}',
      }),
      serviceUrl: '{url}',
    });
    
    const deleteConfigurationParams = {
      environmentId: '{environment_id}',
      configurationId: '{configuration_id}',
    };
    
    discovery.deleteConfiguration(deleteConfigurationParams)
      .then(deleteConfigurationResponse => {
        console.log(JSON.stringify(deleteConfigurationResponse, null, 2));
      })
      .catch(err => {
        console.log('error:', err);
      });
  • import json
    from ibm_watson import DiscoveryV1
    from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
    
    authenticator = IAMAuthenticator('{apikey}')
    discovery = DiscoveryV1(
        version='2019-04-30',
        authenticator=authenticator
    )
    
    discovery.set_service_url('{url}')
    
    config_delete = discovery.delete_configuration('{environment_id}', '{configuration_id}').get_result()
    print(json.dumps(config_delete, indent=2))

Response

Information returned when a configuration is deleted.

Information returned when a configuration is deleted.

Examples:
{
  "configuration_id": "123abc",
  "status": "deleted",
  "notices": [
    {
      "notice_id": "configuration_in_use",
      "created": "2016-09-28T12:34:00.000Z",
      "severity": "warning",
      "description": "The configuration was deleted, but it is referenced by one or more collections."
    }
  ]
}

Information returned when a configuration is deleted.

Examples:
{
  "configuration_id": "123abc",
  "status": "deleted",
  "notices": [
    {
      "notice_id": "configuration_in_use",
      "created": "2016-09-28T12:34:00.000Z",
      "severity": "warning",
      "description": "The configuration was deleted, but it is referenced by one or more collections."
    }
  ]
}

Information returned when a configuration is deleted.

Examples:
{
  "configuration_id": "123abc",
  "status": "deleted",
  "notices": [
    {
      "notice_id": "configuration_in_use",
      "created": "2016-09-28T12:34:00.000Z",
      "severity": "warning",
      "description": "The configuration was deleted, but it is referenced by one or more collections."
    }
  ]
}

Information returned when a configuration is deleted.

Examples:
{
  "configuration_id": "123abc",
  "status": "deleted",
  "notices": [
    {
      "notice_id": "configuration_in_use",
      "created": "2016-09-28T12:34:00.000Z",
      "severity": "warning",
      "description": "The configuration was deleted, but it is referenced by one or more collections."
    }
  ]
}

Status Code

  • Configuration successfully deleted. The response contains a warning if the configuration was referenced by at least one collection.

  • Bad request.

    A bad request is returned any time there is a problem with the request itself.

    Example error messages:

    • Invalid Configuration ID - if the configuration ID is not correctly formatted.
    • Invalid configurationId: 2c3a981b-dade-488c-b8c6-01ae8d111111 - if the configuration is not found.
  • Forbidden. Returned if you attempt to delete a read-only configuration, or if you attempt to delete a configuration from a read-only environment.

Example responses
  • {
      "configuration_id": "123abc",
      "status": "deleted",
      "notices": [
        {
          "notice_id": "configuration_in_use",
          "created": "2016-09-28T12:34:00.000Z",
          "severity": "warning",
          "description": "The configuration was deleted, but it is referenced by one or more collections."
        }
      ]
    }
  • {
      "configuration_id": "123abc",
      "status": "deleted",
      "notices": [
        {
          "notice_id": "configuration_in_use",
          "created": "2016-09-28T12:34:00.000Z",
          "severity": "warning",
          "description": "The configuration was deleted, but it is referenced by one or more collections."
        }
      ]
    }

Create a collection

POST /v1/environments/{environment_id}/collections
ServiceCall<Collection> createCollection(CreateCollectionOptions createCollectionOptions)
createCollection(params)
create_collection(
        self,
        environment_id: str,
        name: str,
        *,
        description: str = None,
        configuration_id: str = None,
        language: str = None,
        **kwargs,
    ) -> DetailedResponse
CreateCollection(string environmentId, string name, string description = null, string configurationId = null, string language = null)

Request

Use the CreateCollectionOptions.Builder to create a CreateCollectionOptions object that contains the parameter values for the createCollection method.

Path Parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

Query Parameters

  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

Input an object that allows you to add a collection.

The createCollection options.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The name of the collection to be created.

    Possible values: 0 ≤ length ≤ 255

  • A description of the collection.

    Default:

  • The ID of the configuration in which the collection is to be created.

    Default:

  • The language of the documents stored in the collection, in the form of an ISO 639-1 language code.

    Allowable values: [en,es,de,ar,fr,it,ja,ko,pt,nl,zh-CN]

    Default: en

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The name of the collection to be created.

    Possible values: 0 ≤ length ≤ 255

  • A description of the collection.

    Default:

  • The ID of the configuration in which the collection is to be created.

    Default:

  • The language of the documents stored in the collection, in the form of an ISO 639-1 language code.

    Allowable values: [en,es,de,ar,fr,it,ja,ko,pt,nl,zh-CN]

    Default: en

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The name of the collection to be created.

    Possible values: 0 ≤ length ≤ 255

  • A description of the collection.

    Default:

  • The ID of the configuration in which the collection is to be created.

    Default:

  • The language of the documents stored in the collection, in the form of an ISO 639-1 language code.

    Allowable values: [en,es,de,ar,fr,it,ja,ko,pt,nl,zh-CN]

    Default: en

  •       curl -X POST -u "apikey":"{apikey}" -H "Content-Type: application/json" -d '{
      "name": "test_collection",
      "description": "My test collection",
      "configuration_id": "{configuration_id}",
      "language": "en"
    }' "{url}/v1/environments/{environment_id}/collections?version=2019-04-30"
  • {
      "name": "{collection_name}",
      "description": "{description}",
      "configuration_id": "{configuration_id}",
      "language": "en"
    }
  • IamAuthenticator authenticator = new IamAuthenticator(
        apikey: "{apikey}"
        );
    
    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
    discovery.SetServiceUrl("{url}");
    
    var result = discovery.CreateCollection(
        environmentId: "{environmentId}",
        configurationId: "{configurationId}",
        name: "{collectionName}",
        language: "{language}"
        );
    
    Console.WriteLine(result.Response);
  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
    Discovery discovery = new Discovery("2019-04-30", authenticator);
    discovery.setServiceUrl("{url}");
    
    String environmentId = "{environment_id}";
    String configurationId = "{configuration_id}";
    String collectionName = "{collection_name}";
    String languageCode = "{language}";
    
    CreateCollectionOptions.Builder createCollectionBuilder = new CreateCollectionOptions.Builder(environmentId, configurationId, collectionName, languageCode);
    Collection createResponse = discovery.createCollection(createCollectionBuilder.build()).execute().getResult();
  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
    const { IamAuthenticator } = require('ibm-watson/auth');
    
    const discovery = new DiscoveryV1({
      version: '2019-04-30',
      authenticator: new IamAuthenticator({
        apikey: '{apikey}',
      }),
      serviceUrl: '{url}',
    });
    
    const createCollectionParams = {
      environmentId: '{environment_id}',
      name: 'node-examples-test',
      language: 'ja',
    };
    
    discovery.createCollection(createCollectionParams)
      .then(collection => {
        console.log(JSON.stringify(collection, null, 2));
      })
      .catch(err => {
        console.log('error:', err);
      });
  • import json
    from ibm_watson import DiscoveryV1
    from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
    
    authenticator = IAMAuthenticator('{apikey}')
    discovery = DiscoveryV1(
        version='2019-04-30',
        authenticator=authenticator
    )
    
    discovery.set_service_url('{url}')
    
    new_collection = discovery.create_collection(
        environment_id='{environment_id}',
        configuration_id='{configuration_id}', 
        name='{collection_name}', 
        description='{collection_desc}',
         language='{collection_lang}').get_result()
    print(json.dumps(new_collection, indent=2))

Response

A collection for storing documents.

A collection for storing documents.

Examples:
{
  "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
  "name": "test-collection",
  "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
  "language": "de",
  "status": "active",
  "description": "A test collection to show as an example",
  "created": "2017-07-14T12:55:40.652Z",
  "updated": "2017-07-14T12:55:40.652Z",
  "document_counts": {
    "available": 0,
    "processing": 0,
    "failed": 0
  },
  "disk_usage": {
    "used_bytes": 260
  },
  "training_status": {
    "data_updated": "",
    "total_examples": 0,
    "sufficient_label_diversity": false,
    "processing": false,
    "minimum_examples_added": false,
    "successfully_trained": "",
    "available": false,
    "notices": 0,
    "minimum_queries_added": false
  },
  "crawl_status": {
    "source_crawl": {
      "status": "complete",
      "last_updated": "2018-01-05T12:55:40.652Z"
    }
  },
  "smart_document_understanding": {
    "enabled": true,
    "total_annotated_pages": 0,
    "total_pages": 0,
    "total_documents": 0,
    "custom_fields": {
      "maximum_allowed": 5
    }
  }
}

A collection for storing documents.

Examples:
{
  "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
  "name": "test-collection",
  "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
  "language": "de",
  "status": "active",
  "description": "A test collection to show as an example",
  "created": "2017-07-14T12:55:40.652Z",
  "updated": "2017-07-14T12:55:40.652Z",
  "document_counts": {
    "available": 0,
    "processing": 0,
    "failed": 0
  },
  "disk_usage": {
    "used_bytes": 260
  },
  "training_status": {
    "data_updated": "",
    "total_examples": 0,
    "sufficient_label_diversity": false,
    "processing": false,
    "minimum_examples_added": false,
    "successfully_trained": "",
    "available": false,
    "notices": 0,
    "minimum_queries_added": false
  },
  "crawl_status": {
    "source_crawl": {
      "status": "complete",
      "last_updated": "2018-01-05T12:55:40.652Z"
    }
  },
  "smart_document_understanding": {
    "enabled": true,
    "total_annotated_pages": 0,
    "total_pages": 0,
    "total_documents": 0,
    "custom_fields": {
      "maximum_allowed": 5
    }
  }
}

A collection for storing documents.

Examples:
{
  "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
  "name": "test-collection",
  "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
  "language": "de",
  "status": "active",
  "description": "A test collection to show as an example",
  "created": "2017-07-14T12:55:40.652Z",
  "updated": "2017-07-14T12:55:40.652Z",
  "document_counts": {
    "available": 0,
    "processing": 0,
    "failed": 0
  },
  "disk_usage": {
    "used_bytes": 260
  },
  "training_status": {
    "data_updated": "",
    "total_examples": 0,
    "sufficient_label_diversity": false,
    "processing": false,
    "minimum_examples_added": false,
    "successfully_trained": "",
    "available": false,
    "notices": 0,
    "minimum_queries_added": false
  },
  "crawl_status": {
    "source_crawl": {
      "status": "complete",
      "last_updated": "2018-01-05T12:55:40.652Z"
    }
  },
  "smart_document_understanding": {
    "enabled": true,
    "total_annotated_pages": 0,
    "total_pages": 0,
    "total_documents": 0,
    "custom_fields": {
      "maximum_allowed": 5
    }
  }
}

A collection for storing documents.

Examples:
{
  "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
  "name": "test-collection",
  "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
  "language": "de",
  "status": "active",
  "description": "A test collection to show as an example",
  "created": "2017-07-14T12:55:40.652Z",
  "updated": "2017-07-14T12:55:40.652Z",
  "document_counts": {
    "available": 0,
    "processing": 0,
    "failed": 0
  },
  "disk_usage": {
    "used_bytes": 260
  },
  "training_status": {
    "data_updated": "",
    "total_examples": 0,
    "sufficient_label_diversity": false,
    "processing": false,
    "minimum_examples_added": false,
    "successfully_trained": "",
    "available": false,
    "notices": 0,
    "minimum_queries_added": false
  },
  "crawl_status": {
    "source_crawl": {
      "status": "complete",
      "last_updated": "2018-01-05T12:55:40.652Z"
    }
  },
  "smart_document_understanding": {
    "enabled": true,
    "total_annotated_pages": 0,
    "total_pages": 0,
    "total_documents": 0,
    "custom_fields": {
      "maximum_allowed": 5
    }
  }
}

Status Code

  • Collection successfully created.

  • Bad request if the collection body does not match the expected format or if the configuration_id references a configuration that does not exist. The error string will describe why the request was rejected.

  • Forbidden. Returned if you attempt to add a collection to a read-only environment.

Example responses
  • {
      "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
      "name": "test-collection",
      "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
      "language": "de",
      "status": "active",
      "description": "A test collection to show as an example",
      "created": "2017-07-14T12:55:40.652Z",
      "updated": "2017-07-14T12:55:40.652Z",
      "document_counts": {
        "available": 0,
        "processing": 0,
        "failed": 0
      },
      "disk_usage": {
        "used_bytes": 260
      },
      "training_status": {
        "data_updated": "",
        "total_examples": 0,
        "sufficient_label_diversity": false,
        "processing": false,
        "minimum_examples_added": false,
        "successfully_trained": "",
        "available": false,
        "notices": 0,
        "minimum_queries_added": false
      },
      "crawl_status": {
        "source_crawl": {
          "status": "complete",
          "last_updated": "2018-01-05T12:55:40.652Z"
        }
      },
      "smart_document_understanding": {
        "enabled": true,
        "total_annotated_pages": 0,
        "total_pages": 0,
        "total_documents": 0,
        "custom_fields": {
          "maximum_allowed": 5
        }
      }
    }
  • {
      "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
      "name": "test-collection",
      "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
      "language": "de",
      "status": "active",
      "description": "A test collection to show as an example",
      "created": "2017-07-14T12:55:40.652Z",
      "updated": "2017-07-14T12:55:40.652Z",
      "document_counts": {
        "available": 0,
        "processing": 0,
        "failed": 0
      },
      "disk_usage": {
        "used_bytes": 260
      },
      "training_status": {
        "data_updated": "",
        "total_examples": 0,
        "sufficient_label_diversity": false,
        "processing": false,
        "minimum_examples_added": false,
        "successfully_trained": "",
        "available": false,
        "notices": 0,
        "minimum_queries_added": false
      },
      "crawl_status": {
        "source_crawl": {
          "status": "complete",
          "last_updated": "2018-01-05T12:55:40.652Z"
        }
      },
      "smart_document_understanding": {
        "enabled": true,
        "total_annotated_pages": 0,
        "total_pages": 0,
        "total_documents": 0,
        "custom_fields": {
          "maximum_allowed": 5
        }
      }
    }

List collections

Lists existing collections for the service instance.

Lists existing collections for the service instance.

Lists existing collections for the service instance.

Lists existing collections for the service instance.

Lists existing collections for the service instance.

GET /v1/environments/{environment_id}/collections
ServiceCall<ListCollectionsResponse> listCollections(ListCollectionsOptions listCollectionsOptions)
listCollections(params)
list_collections(
        self,
        environment_id: str,
        *,
        name: str = None,
        **kwargs,
    ) -> DetailedResponse
ListCollections(string environmentId, string name = null)

Request

Use the ListCollectionsOptions.Builder to create a ListCollectionsOptions object that contains the parameter values for the listCollections method.

Path Parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

Query Parameters

  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

  • Find collections with the given name.

The listCollections options.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • Find collections with the given name.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • Find collections with the given name.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • Find collections with the given name.

  • curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections?version=2019-04-30"
  • IamAuthenticator authenticator = new IamAuthenticator(
        apikey: "{apikey}"
        );
    
    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
    discovery.SetServiceUrl("{url}");
    
    var result = discovery.ListCollections(
        environmentId: "{environmentId}"
        );
    
    Console.WriteLine(result.Response);
  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
    Discovery discovery = new Discovery("2019-04-30", authenticator);
    discovery.setServiceUrl("{url}");
    
    String environmentId = "{environment_id}";
    
    ListCollectionsOptions listOptions = new ListCollectionsOptions.Builder(environmentId).build();
    ListCollectionsResponse listResponse = discovery.listCollections(listOptions).execute().getResult();
  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
    const { IamAuthenticator } = require('ibm-watson/auth');
    
    const discovery = new DiscoveryV1({
      version: '2019-04-30',
      authenticator: new IamAuthenticator({
        apikey: '{apikey}',
      }),
      serviceUrl: '{url}',
    });
    
    const listCollectionsParams = {
      environmentId: '{environment_id}',
    };
    
    discovery.listCollections(listCollectionsParams)
      .then(listCollectionsResponse => {
        console.log(JSON.stringify(listCollectionsResponse, null, 2));
      })
      .catch(err => {
        console.log('error:', err);
      });
  • import json
    from ibm_watson import DiscoveryV1
    from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
    
    authenticator = IAMAuthenticator('{apikey}')
    discovery = DiscoveryV1(
        version='2019-04-30',
        authenticator=authenticator
    )
    
    discovery.set_service_url('{url}')
    
    collections = discovery.list_collections('{environment_id}').get_result()
    print(json.dumps(collections, indent=2))

Response

Response object containing an array of collection details.

Response object containing an array of collection details.

Examples:
{
  "collections": [
    {
      "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
      "name": "example",
      "description": "this is a demo collection",
      "created": "2015-08-24T18:42:25.324Z",
      "updated": "2015-08-24T18:42:25.324Z",
      "status": "active",
      "configuration_id": "6963be41-2dea-4f79-8f52-127c63c479b0",
      "language": "en"
    }
  ]
}

Response object containing an array of collection details.

Examples:
{
  "collections": [
    {
      "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
      "name": "example",
      "description": "this is a demo collection",
      "created": "2015-08-24T18:42:25.324Z",
      "updated": "2015-08-24T18:42:25.324Z",
      "status": "active",
      "configuration_id": "6963be41-2dea-4f79-8f52-127c63c479b0",
      "language": "en"
    }
  ]
}

Response object containing an array of collection details.

Examples:
{
  "collections": [
    {
      "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
      "name": "example",
      "description": "this is a demo collection",
      "created": "2015-08-24T18:42:25.324Z",
      "updated": "2015-08-24T18:42:25.324Z",
      "status": "active",
      "configuration_id": "6963be41-2dea-4f79-8f52-127c63c479b0",
      "language": "en"
    }
  ]
}

Response object containing an array of collection details.

Examples:
{
  "collections": [
    {
      "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
      "name": "example",
      "description": "this is a demo collection",
      "created": "2015-08-24T18:42:25.324Z",
      "updated": "2015-08-24T18:42:25.324Z",
      "status": "active",
      "configuration_id": "6963be41-2dea-4f79-8f52-127c63c479b0",
      "language": "en"
    }
  ]
}

Status Code

  • Successful response.

  • Bad request.

Example responses
  • {
      "collections": [
        {
          "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
          "name": "example",
          "description": "this is a demo collection",
          "created": "2015-08-24T18:42:25.324Z",
          "updated": "2015-08-24T18:42:25.324Z",
          "status": "active",
          "configuration_id": "6963be41-2dea-4f79-8f52-127c63c479b0",
          "language": "en"
        }
      ]
    }
  • {
      "collections": [
        {
          "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
          "name": "example",
          "description": "this is a demo collection",
          "created": "2015-08-24T18:42:25.324Z",
          "updated": "2015-08-24T18:42:25.324Z",
          "status": "active",
          "configuration_id": "6963be41-2dea-4f79-8f52-127c63c479b0",
          "language": "en"
        }
      ]
    }

Get collection details

GET /v1/environments/{environment_id}/collections/{collection_id}
ServiceCall<Collection> getCollection(GetCollectionOptions getCollectionOptions)
getCollection(params)
get_collection(
        self,
        environment_id: str,
        collection_id: str,
        **kwargs,
    ) -> DetailedResponse
GetCollection(string environmentId, string collectionId)

Request

Use the GetCollectionOptions.Builder to create a GetCollectionOptions object that contains the parameter values for the getCollection method.

Path Parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

Query Parameters

  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

The getCollection options.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}?version=2019-04-30"
  • IamAuthenticator authenticator = new IamAuthenticator(
        apikey: "{apikey}"
        );
    
    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
    discovery.SetServiceUrl("{url}");
    
    var result = discovery.GetCollection(
        environmentId: "{environmentId}",
        collectionId: "{collectionId}"
        );
    
    Console.WriteLine(result.Response);
  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
    Discovery discovery = new Discovery("2019-04-30", authenticator);
    discovery.setServiceUrl("{url}");
    
    String environmentId = "{environment_id}";
    String collectionId = "{collection_id}";
    
    GetCollectionOptions getOptions = new GetCollectionOptions.Builder(environmentId, collectionId).build();
    Collection getResponse = discovery.getCollection(getOptions).execute().getResult();
  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
    const { IamAuthenticator } = require('ibm-watson/auth');
    
    const discovery = new DiscoveryV1({
      version: '2019-04-30',
      authenticator: new IamAuthenticator({
        apikey: '{apikey}',
      }),
      serviceUrl: '{url}',
    });
    
    const getCollectionParams = {
      environmentId: '{environment_id}',
      collectionId: '{collection_id}',
    };
    
    discovery.getCollection(getCollectionParams)
      .then(collection => {
        console.log(JSON.stringify(collection, null, 2));
      })
      .catch(err => {
        console.log('error:', err);
      });
  • import json
    from ibm_watson import DiscoveryV1
    from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
    
    authenticator = IAMAuthenticator('{apikey}')
    discovery = DiscoveryV1(
        version='2019-04-30',
        authenticator=authenticator
    )
    
    discovery.set_service_url('{url}')
    
    collection = discovery.get_collection(
        '{environment_id}', 
        '{collection_id}').get_result()
    print(json.dumps(collection, indent=2))

Response

A collection for storing documents.

A collection for storing documents.

Examples:
{
  "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
  "name": "test-collection",
  "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
  "language": "de",
  "status": "active",
  "description": "A test collection to show as an example",
  "created": "2017-07-14T12:55:40.652Z",
  "updated": "2017-07-14T12:55:40.652Z",
  "document_counts": {
    "available": 0,
    "processing": 0,
    "failed": 0
  },
  "disk_usage": {
    "used_bytes": 260
  },
  "training_status": {
    "data_updated": "",
    "total_examples": 0,
    "sufficient_label_diversity": false,
    "processing": false,
    "minimum_examples_added": false,
    "successfully_trained": "",
    "available": false,
    "notices": 0,
    "minimum_queries_added": false
  },
  "crawl_status": {
    "source_crawl": {
      "status": "complete",
      "last_updated": "2018-01-05T12:55:40.652Z"
    }
  },
  "smart_document_understanding": {
    "enabled": true,
    "total_annotated_pages": 0,
    "total_pages": 0,
    "total_documents": 0,
    "custom_fields": {
      "maximum_allowed": 5
    }
  }
}

A collection for storing documents.

Examples:
{
  "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
  "name": "test-collection",
  "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
  "language": "de",
  "status": "active",
  "description": "A test collection to show as an example",
  "created": "2017-07-14T12:55:40.652Z",
  "updated": "2017-07-14T12:55:40.652Z",
  "document_counts": {
    "available": 0,
    "processing": 0,
    "failed": 0
  },
  "disk_usage": {
    "used_bytes": 260
  },
  "training_status": {
    "data_updated": "",
    "total_examples": 0,
    "sufficient_label_diversity": false,
    "processing": false,
    "minimum_examples_added": false,
    "successfully_trained": "",
    "available": false,
    "notices": 0,
    "minimum_queries_added": false
  },
  "crawl_status": {
    "source_crawl": {
      "status": "complete",
      "last_updated": "2018-01-05T12:55:40.652Z"
    }
  },
  "smart_document_understanding": {
    "enabled": true,
    "total_annotated_pages": 0,
    "total_pages": 0,
    "total_documents": 0,
    "custom_fields": {
      "maximum_allowed": 5
    }
  }
}

A collection for storing documents.

Examples:
{
  "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
  "name": "test-collection",
  "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
  "language": "de",
  "status": "active",
  "description": "A test collection to show as an example",
  "created": "2017-07-14T12:55:40.652Z",
  "updated": "2017-07-14T12:55:40.652Z",
  "document_counts": {
    "available": 0,
    "processing": 0,
    "failed": 0
  },
  "disk_usage": {
    "used_bytes": 260
  },
  "training_status": {
    "data_updated": "",
    "total_examples": 0,
    "sufficient_label_diversity": false,
    "processing": false,
    "minimum_examples_added": false,
    "successfully_trained": "",
    "available": false,
    "notices": 0,
    "minimum_queries_added": false
  },
  "crawl_status": {
    "source_crawl": {
      "status": "complete",
      "last_updated": "2018-01-05T12:55:40.652Z"
    }
  },
  "smart_document_understanding": {
    "enabled": true,
    "total_annotated_pages": 0,
    "total_pages": 0,
    "total_documents": 0,
    "custom_fields": {
      "maximum_allowed": 5
    }
  }
}

A collection for storing documents.

Examples:
{
  "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
  "name": "test-collection",
  "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
  "language": "de",
  "status": "active",
  "description": "A test collection to show as an example",
  "created": "2017-07-14T12:55:40.652Z",
  "updated": "2017-07-14T12:55:40.652Z",
  "document_counts": {
    "available": 0,
    "processing": 0,
    "failed": 0
  },
  "disk_usage": {
    "used_bytes": 260
  },
  "training_status": {
    "data_updated": "",
    "total_examples": 0,
    "sufficient_label_diversity": false,
    "processing": false,
    "minimum_examples_added": false,
    "successfully_trained": "",
    "available": false,
    "notices": 0,
    "minimum_queries_added": false
  },
  "crawl_status": {
    "source_crawl": {
      "status": "complete",
      "last_updated": "2018-01-05T12:55:40.652Z"
    }
  },
  "smart_document_understanding": {
    "enabled": true,
    "total_annotated_pages": 0,
    "total_pages": 0,
    "total_documents": 0,
    "custom_fields": {
      "maximum_allowed": 5
    }
  }
}

Status Code

  • Collection fetched.

  • Bad request.

Example responses
  • {
      "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
      "name": "test-collection",
      "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
      "language": "de",
      "status": "active",
      "description": "A test collection to show as an example",
      "created": "2017-07-14T12:55:40.652Z",
      "updated": "2017-07-14T12:55:40.652Z",
      "document_counts": {
        "available": 0,
        "processing": 0,
        "failed": 0
      },
      "disk_usage": {
        "used_bytes": 260
      },
      "training_status": {
        "data_updated": "",
        "total_examples": 0,
        "sufficient_label_diversity": false,
        "processing": false,
        "minimum_examples_added": false,
        "successfully_trained": "",
        "available": false,
        "notices": 0,
        "minimum_queries_added": false
      },
      "crawl_status": {
        "source_crawl": {
          "status": "complete",
          "last_updated": "2018-01-05T12:55:40.652Z"
        }
      },
      "smart_document_understanding": {
        "enabled": true,
        "total_annotated_pages": 0,
        "total_pages": 0,
        "total_documents": 0,
        "custom_fields": {
          "maximum_allowed": 5
        }
      }
    }
  • {
      "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
      "name": "test-collection",
      "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
      "language": "de",
      "status": "active",
      "description": "A test collection to show as an example",
      "created": "2017-07-14T12:55:40.652Z",
      "updated": "2017-07-14T12:55:40.652Z",
      "document_counts": {
        "available": 0,
        "processing": 0,
        "failed": 0
      },
      "disk_usage": {
        "used_bytes": 260
      },
      "training_status": {
        "data_updated": "",
        "total_examples": 0,
        "sufficient_label_diversity": false,
        "processing": false,
        "minimum_examples_added": false,
        "successfully_trained": "",
        "available": false,
        "notices": 0,
        "minimum_queries_added": false
      },
      "crawl_status": {
        "source_crawl": {
          "status": "complete",
          "last_updated": "2018-01-05T12:55:40.652Z"
        }
      },
      "smart_document_understanding": {
        "enabled": true,
        "total_annotated_pages": 0,
        "total_pages": 0,
        "total_documents": 0,
        "custom_fields": {
          "maximum_allowed": 5
        }
      }
    }

Update a collection

PUT /v1/environments/{environment_id}/collections/{collection_id}
ServiceCall<Collection> updateCollection(UpdateCollectionOptions updateCollectionOptions)
updateCollection(params)
update_collection(
        self,
        environment_id: str,
        collection_id: str,
        name: str,
        *,
        description: str = None,
        configuration_id: str = None,
        **kwargs,
    ) -> DetailedResponse
UpdateCollection(string environmentId, string collectionId, string name, string description = null, string configurationId = null)

Request

Use the UpdateCollectionOptions.Builder to create a UpdateCollectionOptions object that contains the parameter values for the updateCollection method.

Path Parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

Query Parameters

  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

Input an object that allows you to update a collection.

The updateCollection options.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The name of the collection.

    Possible values: 0 ≤ length ≤ 255

  • A description of the collection.

    Default:

  • The ID of the configuration in which the collection is to be updated.

    Default:

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The name of the collection.

    Possible values: 0 ≤ length ≤ 255

  • A description of the collection.

    Default:

  • The ID of the configuration in which the collection is to be updated.

    Default:

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The name of the collection.

    Possible values: 0 ≤ length ≤ 255

  • A description of the collection.

    Default:

  • The ID of the configuration in which the collection is to be updated.

    Default:

  •       curl -X PUT -u "apikey":"{apikey}" -H "Content-Type: application/json" -d '{
      "name": "test_collection",
      "description": "My test collection",
      "configuration_id": "{configuration_id}"
    }' "{url}/v1/environments/{environment_id}/collections/{collection_id}?version=2019-04-30"
  • {
      "name": "{collection_name}",
      "description": "{description}",
      "configuration_id": "{configuration_id}"
    }
  • IamAuthenticator authenticator = new IamAuthenticator(
        apikey: "{apikey}"
        );
    
    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
    discovery.SetServiceUrl("{url}");
    
    var result = discovery.UpdateCollection(
        environmentId: "{environmentId}",
        collectionId: "{collectionId}",
        name: "new_name"
        );
    
    Console.WriteLine(result.Response);
  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
    Discovery discovery = new Discovery("2019-04-30", authenticator);
    discovery.setServiceUrl("{url}");
    
    String environmentId = "{environment_id}";
    String collectionId = "{collection_id}";
    String newCollectionName = "new_name";
    
    UpdateCollectionOptions updateOptions = new UpdateCollectionOptions.Builder(environmentId, collectionId)
      .name(newCollectionName)
      .build();
    
    Collection updatedCollection = discovery.updateCollection(updateOptions).execute().getResult();
  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
    const { IamAuthenticator } = require('ibm-watson/auth');
    
    const discovery = new DiscoveryV1({
      version: '2019-04-30',
      authenticator: new IamAuthenticator({
        apikey: '{apikey}',
      }),
      serviceUrl: '{url}',
    });
    
    const updateCollectionParams = {
      environmentId: '{environment_id}',
      collectionId: '{collection_id}',
      name: '{updated name or current name if updating description (name is required)}',
      description: '{updated description}',
    };
    
    discovery.updateCollection(updateCollectionParams)
      .then(collection => {
        console.log(JSON.stringify(collection, null, 2));
      })
      .catch(err => {
        console.log('error:', err);
      });
  • import json
    from ibm_watson import DiscoveryV1
    from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
    
    authenticator = IAMAuthenticator('{apikey}')
    discovery = DiscoveryV1(
        version='2019-04-30',
        authenticator=authenticator
    )
    
    discovery.set_service_url('{url}')
    
    updated_collection = discovery.update_collection(
        environment_id='{environment_id}',
        collection_id='{collection_id}',
        configuration_id='{configuration_id}', 
        name='{collection_name}',
        description='{collection_desc}',).get_result()
    print(json.dumps(updated_collection, indent=2))

Response

A collection for storing documents.

A collection for storing documents.

Examples:
{
  "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
  "name": "test-collection",
  "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
  "language": "de",
  "status": "active",
  "description": "A test collection to show as an example",
  "created": "2017-07-14T12:55:40.652Z",
  "updated": "2017-07-14T12:55:40.652Z",
  "document_counts": {
    "available": 0,
    "processing": 0,
    "failed": 0
  },
  "disk_usage": {
    "used_bytes": 260
  },
  "training_status": {
    "data_updated": "",
    "total_examples": 0,
    "sufficient_label_diversity": false,
    "processing": false,
    "minimum_examples_added": false,
    "successfully_trained": "",
    "available": false,
    "notices": 0,
    "minimum_queries_added": false
  },
  "crawl_status": {
    "source_crawl": {
      "status": "complete",
      "last_updated": "2018-01-05T12:55:40.652Z"
    }
  },
  "smart_document_understanding": {
    "enabled": true,
    "total_annotated_pages": 0,
    "total_pages": 0,
    "total_documents": 0,
    "custom_fields": {
      "maximum_allowed": 5
    }
  }
}

A collection for storing documents.

Examples:
{
  "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
  "name": "test-collection",
  "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
  "language": "de",
  "status": "active",
  "description": "A test collection to show as an example",
  "created": "2017-07-14T12:55:40.652Z",
  "updated": "2017-07-14T12:55:40.652Z",
  "document_counts": {
    "available": 0,
    "processing": 0,
    "failed": 0
  },
  "disk_usage": {
    "used_bytes": 260
  },
  "training_status": {
    "data_updated": "",
    "total_examples": 0,
    "sufficient_label_diversity": false,
    "processing": false,
    "minimum_examples_added": false,
    "successfully_trained": "",
    "available": false,
    "notices": 0,
    "minimum_queries_added": false
  },
  "crawl_status": {
    "source_crawl": {
      "status": "complete",
      "last_updated": "2018-01-05T12:55:40.652Z"
    }
  },
  "smart_document_understanding": {
    "enabled": true,
    "total_annotated_pages": 0,
    "total_pages": 0,
    "total_documents": 0,
    "custom_fields": {
      "maximum_allowed": 5
    }
  }
}

A collection for storing documents.

Examples:
{
  "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
  "name": "test-collection",
  "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
  "language": "de",
  "status": "active",
  "description": "A test collection to show as an example",
  "created": "2017-07-14T12:55:40.652Z",
  "updated": "2017-07-14T12:55:40.652Z",
  "document_counts": {
    "available": 0,
    "processing": 0,
    "failed": 0
  },
  "disk_usage": {
    "used_bytes": 260
  },
  "training_status": {
    "data_updated": "",
    "total_examples": 0,
    "sufficient_label_diversity": false,
    "processing": false,
    "minimum_examples_added": false,
    "successfully_trained": "",
    "available": false,
    "notices": 0,
    "minimum_queries_added": false
  },
  "crawl_status": {
    "source_crawl": {
      "status": "complete",
      "last_updated": "2018-01-05T12:55:40.652Z"
    }
  },
  "smart_document_understanding": {
    "enabled": true,
    "total_annotated_pages": 0,
    "total_pages": 0,
    "total_documents": 0,
    "custom_fields": {
      "maximum_allowed": 5
    }
  }
}

A collection for storing documents.

Examples:
{
  "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
  "name": "test-collection",
  "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
  "language": "de",
  "status": "active",
  "description": "A test collection to show as an example",
  "created": "2017-07-14T12:55:40.652Z",
  "updated": "2017-07-14T12:55:40.652Z",
  "document_counts": {
    "available": 0,
    "processing": 0,
    "failed": 0
  },
  "disk_usage": {
    "used_bytes": 260
  },
  "training_status": {
    "data_updated": "",
    "total_examples": 0,
    "sufficient_label_diversity": false,
    "processing": false,
    "minimum_examples_added": false,
    "successfully_trained": "",
    "available": false,
    "notices": 0,
    "minimum_queries_added": false
  },
  "crawl_status": {
    "source_crawl": {
      "status": "complete",
      "last_updated": "2018-01-05T12:55:40.652Z"
    }
  },
  "smart_document_understanding": {
    "enabled": true,
    "total_annotated_pages": 0,
    "total_pages": 0,
    "total_documents": 0,
    "custom_fields": {
      "maximum_allowed": 5
    }
  }
}

Status Code

  • Collection successfully updated.

  • Bad request if the collection body does not match the expected format or if the configuration_id references a configuration that does not exist. The error string will describe why the request was rejected.

  • Forbidden. Returned if you attempt to update a collection in a read-only environment.

Example responses
  • {
      "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
      "name": "test-collection",
      "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
      "language": "de",
      "status": "active",
      "description": "A test collection to show as an example",
      "created": "2017-07-14T12:55:40.652Z",
      "updated": "2017-07-14T12:55:40.652Z",
      "document_counts": {
        "available": 0,
        "processing": 0,
        "failed": 0
      },
      "disk_usage": {
        "used_bytes": 260
      },
      "training_status": {
        "data_updated": "",
        "total_examples": 0,
        "sufficient_label_diversity": false,
        "processing": false,
        "minimum_examples_added": false,
        "successfully_trained": "",
        "available": false,
        "notices": 0,
        "minimum_queries_added": false
      },
      "crawl_status": {
        "source_crawl": {
          "status": "complete",
          "last_updated": "2018-01-05T12:55:40.652Z"
        }
      },
      "smart_document_understanding": {
        "enabled": true,
        "total_annotated_pages": 0,
        "total_pages": 0,
        "total_documents": 0,
        "custom_fields": {
          "maximum_allowed": 5
        }
      }
    }
  • {
      "collection_id": "800e58e4-198d-45eb-be87-74e1d6df4e96",
      "name": "test-collection",
      "configuration_id": "3c4fff84-1500-455c-b125-eaa2d319f6d3",
      "language": "de",
      "status": "active",
      "description": "A test collection to show as an example",
      "created": "2017-07-14T12:55:40.652Z",
      "updated": "2017-07-14T12:55:40.652Z",
      "document_counts": {
        "available": 0,
        "processing": 0,
        "failed": 0
      },
      "disk_usage": {
        "used_bytes": 260
      },
      "training_status": {
        "data_updated": "",
        "total_examples": 0,
        "sufficient_label_diversity": false,
        "processing": false,
        "minimum_examples_added": false,
        "successfully_trained": "",
        "available": false,
        "notices": 0,
        "minimum_queries_added": false
      },
      "crawl_status": {
        "source_crawl": {
          "status": "complete",
          "last_updated": "2018-01-05T12:55:40.652Z"
        }
      },
      "smart_document_understanding": {
        "enabled": true,
        "total_annotated_pages": 0,
        "total_pages": 0,
        "total_documents": 0,
        "custom_fields": {
          "maximum_allowed": 5
        }
      }
    }

Delete a collection

DELETE /v1/environments/{environment_id}/collections/{collection_id}
ServiceCall<DeleteCollectionResponse> deleteCollection(DeleteCollectionOptions deleteCollectionOptions)
deleteCollection(params)
delete_collection(
        self,
        environment_id: str,
        collection_id: str,
        **kwargs,
    ) -> DetailedResponse
DeleteCollection(string environmentId, string collectionId)

Request

Use the DeleteCollectionOptions.Builder to create a DeleteCollectionOptions object that contains the parameter values for the deleteCollection method.

Path Parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

Query Parameters

  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

The deleteCollection options.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • curl -u "apikey":"{apikey}" -X DELETE  "{url}/v1/environments/{environment_id}/collections/{collection_id}?version=2019-04-30"
  • IamAuthenticator authenticator = new IamAuthenticator(
        apikey: "{apikey}"
        );
    
    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
    discovery.SetServiceUrl("{url}");
    
    var result = discovery.DeleteCollection(
        environmentId: "{environmentId}",
        collectionId: "{collectionId}"
        );
    
    Console.WriteLine(result.Response);
  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
    Discovery discovery = new Discovery("2019-04-30", authenticator);
    discovery.setServiceUrl("{url}");
    
    String environmentId = "{environment_id}";
    String collectionId = "{collection_id}";
    
    DeleteCollectionOptions deleteRequest = new DeleteCollectionOptions.Builder(environmentId, collectionId).build();
    DeleteCollectionResponse deleteResponse = discovery.deleteCollection(deleteRequest).execute().getResult();
  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
    const { IamAuthenticator } = require('ibm-watson/auth');
    
    const discovery = new DiscoveryV1({
      version: '2019-04-30',
      authenticator: new IamAuthenticator({
        apikey: '{apikey}',
      }),
      serviceUrl: '{url}',
    });
    
    const deleteCollectionParams = {
      environmentId: '{environment_id}',
      collectionId: '{collection_id}',
    };
    
    discovery.deleteCollection(deleteCollectionParams)
      .then(deleteCollectionResponse => {
        console.log(JSON.stringify(deleteCollectionResponse, null, 2));
      })
      .catch(err => {
        console.log('error:', err);
      });
  • import json
    from ibm_watson import DiscoveryV1
    from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
    
    authenticator = IAMAuthenticator('{apikey}')
    discovery = DiscoveryV1(
        version='2019-04-30',
        authenticator=authenticator
    )
    
    discovery.set_service_url('{url}')
    
    delete_collection = discovery.delete_collection(
        '{environment_id}', 
        '{collection_id}').get_result()
    print(json.dumps(delete_collection, indent=2))

Response

Response object returned when deleting a colleciton.

Response object returned when deleting a colleciton.

Response object returned when deleting a colleciton.

Response object returned when deleting a colleciton.

Response object returned when deleting a colleciton.

Status Code

  • Collection successfully deleted.

  • Bad request.

    A bad request is returned any time there is a problem with the request itself.

    Example error messages:

    • Could not find listed collection - if the ID is incorrectly formatted.
  • Forbidden. Returned if you attempt to delete a collection in a read-only environment.

  • Returned any time the collection is not found (even immediately after the collection was successfully deleted).

    Example error message:

    A collection with ID '2cd8bc72-d737-46e3-b26b-05a585111111' was not found.

No Sample Response

This method does not specify any sample responses.

List collection fields

Gets a list of the unique fields (and their types) stored in the index.

Gets a list of the unique fields (and their types) stored in the index.

Gets a list of the unique fields (and their types) stored in the index.

Gets a list of the unique fields (and their types) stored in the index.

Gets a list of the unique fields (and their types) stored in the index.

GET /v1/environments/{environment_id}/collections/{collection_id}/fields
ServiceCall<ListCollectionFieldsResponse> listCollectionFields(ListCollectionFieldsOptions listCollectionFieldsOptions)
listCollectionFields(params)
list_collection_fields(
        self,
        environment_id: str,
        collection_id: str,
        **kwargs,
    ) -> DetailedResponse
ListCollectionFields(string environmentId, string collectionId)

Request

Use the ListCollectionFieldsOptions.Builder to create a ListCollectionFieldsOptions object that contains the parameter values for the listCollectionFields method.

Path Parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

Query Parameters

  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

The listCollectionFields options.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/fields?version=2019-04-30"
  • IamAuthenticator authenticator = new IamAuthenticator(
        apikey: "{apikey}"
        );
    
    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
    discovery.SetServiceUrl("{url}");
    
    var result = discovery.ListCollectionFields(
        environmentId: "{environmentId}",
        collectionId: "{collectionId}"
        );
    
    Console.WriteLine(result.Response);
  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
    Discovery discovery = new Discovery("2019-04-30", authenticator);
    discovery.setServiceUrl("{url}");
    
    String environmentId = "{environment_id}";
    String collectionId = "{collection_id}";
    
    ListCollectionFieldsOptions listOptions = new ListCollectionFieldsOptions.Builder(environmentId, collectionId).build();
    ListCollectionFieldsResponse listResponse = discovery.listCollectionFields(listOptions).execute().getResult();
  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
    const { IamAuthenticator } = require('ibm-watson/auth');
    
    const discovery = new DiscoveryV1({
      version: '2019-04-30',
      authenticator: new IamAuthenticator({
        apikey: '{apikey}',
      }),
      serviceUrl: '{url}',
    });
    
    const listCollectionFieldsParams = {
      environmentId: '{environment_id}',
      collectionId: '{collection_id}',
    };
    
    discovery.listCollectionFields(listCollectionFieldsParams)
      .then(listCollectionFieldsResponse => {
        console.log(JSON.stringify(listCollectionFieldsResponse, null, 2));
      })
      .catch(err => {
        console.log('error:', err);
      });
  • import json
    from ibm_watson import DiscoveryV1
    from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
    
    authenticator = IAMAuthenticator('{apikey}')
    discovery = DiscoveryV1(
        version='2019-04-30',
        authenticator=authenticator
    )
    
    discovery.set_service_url('{url}')
    
    collection_fields = discovery.list_collection_fields(
        '{environment_id}',
        '{collection_id}').get_result()
    print(json.dumps(collection_fields, indent=2))

Response

The list of fetched fields.

The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.

  • Fields which contain nested JSON objects are assigned a type of "nested".

  • Fields which belong to a nested object are prefixed with .properties (for example, warnings.properties.severity means that the warnings object has a property called severity).

  • Fields returned from the News collection are prefixed with v{N}-fullnews-t3-{YEAR}.mappings (for example, v5-fullnews-t3-2016.mappings.text.properties.author).

The list of fetched fields.

The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.

  • Fields which contain nested JSON objects are assigned a type of "nested".

  • Fields which belong to a nested object are prefixed with .properties (for example, warnings.properties.severity means that the warnings object has a property called severity).

  • Fields returned from the News collection are prefixed with v{N}-fullnews-t3-{YEAR}.mappings (for example, v5-fullnews-t3-2016.mappings.text.properties.author).

Examples:
{
  "fields": [
    {
      "field": "warnings",
      "type": "nested"
    },
    {
      "field": "warnings.properties.description",
      "type": "string"
    },
    {
      "field": "warnings.properties.phase",
      "type": "string"
    },
    {
      "field": "warnings.properties.warning_id",
      "type": "string"
    }
  ]
}

The list of fetched fields.

The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.

  • Fields which contain nested JSON objects are assigned a type of "nested".

  • Fields which belong to a nested object are prefixed with .properties (for example, warnings.properties.severity means that the warnings object has a property called severity).

  • Fields returned from the News collection are prefixed with v{N}-fullnews-t3-{YEAR}.mappings (for example, v5-fullnews-t3-2016.mappings.text.properties.author).

Examples:
{
  "fields": [
    {
      "field": "warnings",
      "type": "nested"
    },
    {
      "field": "warnings.properties.description",
      "type": "string"
    },
    {
      "field": "warnings.properties.phase",
      "type": "string"
    },
    {
      "field": "warnings.properties.warning_id",
      "type": "string"
    }
  ]
}

The list of fetched fields.

The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.

  • Fields which contain nested JSON objects are assigned a type of "nested".

  • Fields which belong to a nested object are prefixed with .properties (for example, warnings.properties.severity means that the warnings object has a property called severity).

  • Fields returned from the News collection are prefixed with v{N}-fullnews-t3-{YEAR}.mappings (for example, v5-fullnews-t3-2016.mappings.text.properties.author).

Examples:
{
  "fields": [
    {
      "field": "warnings",
      "type": "nested"
    },
    {
      "field": "warnings.properties.description",
      "type": "string"
    },
    {
      "field": "warnings.properties.phase",
      "type": "string"
    },
    {
      "field": "warnings.properties.warning_id",
      "type": "string"
    }
  ]
}

The list of fetched fields.

The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations.

  • Fields which contain nested JSON objects are assigned a type of "nested".

  • Fields which belong to a nested object are prefixed with .properties (for example, warnings.properties.severity means that the warnings object has a property called severity).

  • Fields returned from the News collection are prefixed with v{N}-fullnews-t3-{YEAR}.mappings (for example, v5-fullnews-t3-2016.mappings.text.properties.author).

Examples:
{
  "fields": [
    {
      "field": "warnings",
      "type": "nested"
    },
    {
      "field": "warnings.properties.description",
      "type": "string"
    },
    {
      "field": "warnings.properties.phase",
      "type": "string"
    },
    {
      "field": "warnings.properties.warning_id",
      "type": "string"
    }
  ]
}

Status Code

  • The list of fetched fields.

    The fields are returned using a fully qualified name format, however, the format differs slightly from that used by the query operations:

    • Fields which contain nested JSON objects are assigned a type of "nested".

    • Fields which belong to a nested object are prefixed with .properties (for example, warnings.properties.severity means that the warnings object has a property called severity).

    • Fields returned from the News collection are prefixed with v{N}-fullnews-t3-{YEAR}.mappings (for example, v5-fullnews-t3-2016.mappings.text.properties.author).

  • Bad request.

Example responses
  • {
      "fields": [
        {
          "field": "warnings",
          "type": "nested"
        },
        {
          "field": "warnings.properties.description",
          "type": "string"
        },
        {
          "field": "warnings.properties.phase",
          "type": "string"
        },
        {
          "field": "warnings.properties.warning_id",
          "type": "string"
        }
      ]
    }
  • {
      "fields": [
        {
          "field": "warnings",
          "type": "nested"
        },
        {
          "field": "warnings.properties.description",
          "type": "string"
        },
        {
          "field": "warnings.properties.phase",
          "type": "string"
        },
        {
          "field": "warnings.properties.warning_id",
          "type": "string"
        }
      ]
    }

Get the expansion list

Returns the current expansion list for the specified collection. If an expansion list is not specified, an object with empty expansion arrays is returned.

Returns the current expansion list for the specified collection. If an expansion list is not specified, an object with empty expansion arrays is returned.

Returns the current expansion list for the specified collection. If an expansion list is not specified, an object with empty expansion arrays is returned.

Returns the current expansion list for the specified collection. If an expansion list is not specified, an object with empty expansion arrays is returned.

Returns the current expansion list for the specified collection. If an expansion list is not specified, an object with empty expansion arrays is returned.

GET /v1/environments/{environment_id}/collections/{collection_id}/expansions
ServiceCall<Expansions> listExpansions(ListExpansionsOptions listExpansionsOptions)
listExpansions(params)
list_expansions(
        self,
        environment_id: str,
        collection_id: str,
        **kwargs,
    ) -> DetailedResponse
ListExpansions(string environmentId, string collectionId)

Request

Use the ListExpansionsOptions.Builder to create a ListExpansionsOptions object that contains the parameter values for the listExpansions method.

Path Parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

Query Parameters

  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

The listExpansions options.

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

parameters

  • The ID of the environment.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • The ID of the collection.

    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

  • curl -u "apikey":"{apikey}" -X GET "{url}/v1/environments/{environment_id}/collections/{collection_id}/expansions?version=2019-04-30"
  • IamAuthenticator authenticator = new IamAuthenticator(
        apikey: "{apikey}"
        );
    
    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
    discovery.SetServiceUrl("{url}");
    
    var result = discovery.ListExpansions(
        environmentId: "{environmentId}",
        collectionId: "{collectionId}"
        );
    
    Console.WriteLine(result.Response);
  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
    Discovery discovery = new Discovery("2019-04-30", authenticator);
    discovery.setServiceUrl("{url}");
    
    String environmentId = "{environment_id}";
    String collectionId = "{collection_id}";
    
    ListExpansionsOptions listOptions = new ListExpansionsOptions.Builder()
      .environmentId(environmentId)
      .collectionId(collectionId)
      .build();
    
    Expansions listResults = discovery.listExpansions(listOptions).execute().getResult();
  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
    const { IamAuthenticator } = require('ibm-watson/auth');
    
    const discovery = new DiscoveryV1({
      version: '2019-04-30',
      authenticator: new IamAuthenticator({
        apikey: '{apikey}',
      }),
      serviceUrl: '{url}',
    });
    
    const listExpansionsParams = {
      environmentId: '{environment_id}',
      collectionId: '{collection_id}',
    };
    
    discovery.listExpansions(listExpansionsParams)
      .then(expansions => {
        console.log(JSON.stringify(expansions, null, 2));
      })
      .catch(err => {
        console.log('error:', err);
      });

    Response

    The query expansion definitions for the specified collection.

    The query expansion definitions for the specified collection.

    The query expansion definitions for the specified collection.

    The query expansion definitions for the specified collection.

    The query expansion definitions for the specified collection.

    Status Code

    • Successfully fetched expansions details.

    • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

    No Sample Response

    This method does not specify any sample responses.

    Create or update expansion list

    Create or replace the Expansion list for this collection. The maximum number of expanded terms per collection is 500. The current expansion list is replaced with the uploaded content.

    Create or replace the Expansion list for this collection. The maximum number of expanded terms per collection is 500. The current expansion list is replaced with the uploaded content.

    Create or replace the Expansion list for this collection. The maximum number of expanded terms per collection is 500. The current expansion list is replaced with the uploaded content.

    Create or replace the Expansion list for this collection. The maximum number of expanded terms per collection is 500. The current expansion list is replaced with the uploaded content.

    Create or replace the Expansion list for this collection. The maximum number of expanded terms per collection is 500. The current expansion list is replaced with the uploaded content.

    POST /v1/environments/{environment_id}/collections/{collection_id}/expansions
    ServiceCall<Expansions> createExpansions(CreateExpansionsOptions createExpansionsOptions)
    createExpansions(params)
    create_expansions(
            self,
            environment_id: str,
            collection_id: str,
            expansions: List['Expansion'],
            **kwargs,
        ) -> DetailedResponse
    CreateExpansions(string environmentId, string collectionId, List<Expansion> expansions)

    Request

    Use the CreateExpansionsOptions.Builder to create a CreateExpansionsOptions object that contains the parameter values for the createExpansions method.

    Path Parameters

    • The ID of the environment.

      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

    • The ID of the collection.

      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

    Query Parameters

    • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

    An object that defines the expansion list.

    The createExpansions options.

    parameters

    • The ID of the environment.

      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

    • The ID of the collection.

      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

    • An array of query expansion definitions.

      Each object in the expansions array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.

      To create a bi-directional expansion specify an expanded_terms array. When found in a query, all items in the expanded_terms array are then expanded to the other items in the same array.

      To create a uni-directional expansion, specify both an array of input_terms and an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.

    parameters

    • The ID of the environment.

      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

    • The ID of the collection.

      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

    • An array of query expansion definitions.

      Each object in the expansions array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.

      To create a bi-directional expansion specify an expanded_terms array. When found in a query, all items in the expanded_terms array are then expanded to the other items in the same array.

      To create a uni-directional expansion, specify both an array of input_terms and an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.

    parameters

    • The ID of the environment.

      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

    • The ID of the collection.

      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

    • An array of query expansion definitions.

      Each object in the expansions array represents a term or set of terms that will be expanded into other terms. Each expansion object can be configured as bidirectional or unidirectional. Bidirectional means that all terms are expanded to all other terms in the object. Unidirectional means that a set list of terms can be expanded into a second list of terms.

      To create a bi-directional expansion specify an expanded_terms array. When found in a query, all items in the expanded_terms array are then expanded to the other items in the same array.

      To create a uni-directional expansion, specify both an array of input_terms and an array of expanded_terms. When items in the input_terms array are present in a query, they are expanded using the items listed in the expanded_terms array.

    • curl -X POST -u "apikey":"{apikey}" -H "Content-Type: application/json" -d @expansions.json "{url}/v1/environments/{environment_id}/collections/{collection_id}/expansions?version=2019-04-30"
    • IamAuthenticator authenticator = new IamAuthenticator(
          apikey: "{apikey}"
          );
      
      DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
      discovery.SetServiceUrl("{url}");
      
      var expansions = new List<Expansion>()
      {
          new Expansion()
          {
              InputTerms = new List<string>()
              {
                  "input-term"
              },
              ExpandedTerms = new List<string>()
              {
                  "expanded-term"
              }
          }
      };
      
      var result = discovery.CreateExpansions(
          environmentId: "{environmentId}",
          collectionId: "{collectionId}",
          expansions: expansions
          );
      
      Console.WriteLine(result.Response);
    • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
      Discovery discovery = new Discovery("2019-04-30", authenticator);
      discovery.setServiceUrl("{url}");
      
      String environmentId = "{environment_id}";
      String collectionId = "{collection_id}";
      
      List<String> expansion1InputTerms = Arrays.asList("weekday", "week day");
      List<String> expansion1ExpandedTerms = Arrays.asList("monday", "tuesday", "wednesday", "thursday", "friday");
      List<String> expansion2InputTerms = Arrays.asList("weekend", "week end");
      List<String> expansion2ExpandedTerms = Arrays.asList("saturday", "sunday");
      Expansion expansion1 = new Expansion();
      expansion1.setInputTerms(expansion1InputTerms);
      expansion1.setExpandedTerms(expansion1ExpandedTerms);
      Expansion expansion2 = new Expansion();
      expansion2.setInputTerms(expansion2InputTerms);
      expansion2.setExpandedTerms(expansion2ExpandedTerms);
      Expansions expansions = new Expansions();
      expansions.setExpansions(Arrays.asList(expansion1, expansion2));
      
      CreateExpansionsOptions createOptions = new CreateExpansionsOptions.Builder()
        .environmentId(environmentId)
        .collectionId(collectionId)
        .expansions(expansions)
        .build();
      
      Expansions createResults = discovery.createExpansions(createOptions).execute().getResult();
    • const DiscoveryV1 = require('ibm-watson/discovery/v1');
      const { IamAuthenticator } = require('ibm-watson/auth');
      
      const discovery = new DiscoveryV1({
        version: '2019-04-30',
        authenticator: new IamAuthenticator({
          apikey: '{apikey}',
        }),
        serviceUrl: '{url}',
      });
      
      const createExpansionsParams = {
        environmentId: '{environment_id}',
        collectionId: '{collection_id}',
        expansions: [{
          expanded_terms: ['{expanded term}'],
        }],
      };
      
      discovery.createExpansions(createExpansionsParams)
        .then(expansions => {
          console.log(JSON.stringify(expansions, null, 2));
        })
        .catch(err => {
          console.log('error:', err);
        });

      Response

      The query expansion definitions for the specified collection.

      The query expansion definitions for the specified collection.

      The query expansion definitions for the specified collection.

      The query expansion definitions for the specified collection.

      The query expansion definitions for the specified collection.

      Status Code

      • The expansion list has been accepted and it will used for all future queries

      • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

      • Timeout when uploading the expansion list.

      No Sample Response

      This method does not specify any sample responses.

      Delete the expansion list

      Remove the expansion information for this collection. The expansion list must be deleted to disable query expansion for a collection.

      Remove the expansion information for this collection. The expansion list must be deleted to disable query expansion for a collection.

      Remove the expansion information for this collection. The expansion list must be deleted to disable query expansion for a collection.

      Remove the expansion information for this collection. The expansion list must be deleted to disable query expansion for a collection.

      Remove the expansion information for this collection. The expansion list must be deleted to disable query expansion for a collection.

      DELETE /v1/environments/{environment_id}/collections/{collection_id}/expansions
      ServiceCall<Void> deleteExpansions(DeleteExpansionsOptions deleteExpansionsOptions)
      deleteExpansions(params)
      delete_expansions(
              self,
              environment_id: str,
              collection_id: str,
              **kwargs,
          ) -> DetailedResponse
      DeleteExpansions(string environmentId, string collectionId)

      Request

      Use the DeleteExpansionsOptions.Builder to create a DeleteExpansionsOptions object that contains the parameter values for the deleteExpansions method.

      Path Parameters

      • The ID of the environment.

        Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

      • The ID of the collection.

        Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

      Query Parameters

      • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

      The deleteExpansions options.

      parameters

      • The ID of the environment.

        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

      • The ID of the collection.

        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

      parameters

      • The ID of the environment.

        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

      • The ID of the collection.

        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

      parameters

      • The ID of the environment.

        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

      • The ID of the collection.

        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

      • curl -X DELETE -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/expansions?version=2019-04-30"
      • IamAuthenticator authenticator = new IamAuthenticator(
            apikey: "{apikey}"
            );
        
        DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
        discovery.SetServiceUrl("{url}");
        
        var result = discovery.DeleteExpansions(
            environmentId: "{environmentId}",
            collectionId: "{collectionId}"
            );
        
        Console.WriteLine(result.Response);
      • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
        Discovery discovery = new Discovery("2019-04-30", authenticator);
        discovery.setServiceUrl("{url}");
        
        String environmentId = "{environment_id}";
        String collectionId = "{collection_id}";
        
        DeleteExpansionsOptions deleteOptions = new DeleteExpansionsOptions.Builder()
          .environmentId(environmentId)
          .collectionId(collectionId)
          .build();
        
        discovery.deleteExpansions(deleteOptions).execute();
      • const DiscoveryV1 = require('ibm-watson/discovery/v1');
        const { IamAuthenticator } = require('ibm-watson/auth');
        
        const discovery = new DiscoveryV1({
          version: '2019-04-30',
          authenticator: new IamAuthenticator({
            apikey: '{apikey}',
          }),
          serviceUrl: '{url}',
        });
        
        const deleteExpansionsParams = {
          environmentId: '{environment_id}',
          collectionId: '{collection_id}',
          expansions: [{
            expanded_terms: ['{expanded term}'],
          }],
        };
        
        discovery.deleteExpansions(deleteExpansionsParams)
          .then(result => {
            console.log(JSON.stringify(result, null, 2));
          })
          .catch(err => {
            console.log('error:', err);
          });

        Response

        Response type: object

        Status Code

        • The expansion list was successfully deleted.

        • Bad request.

          A bad request is returned any time there is a problem with the request itself.

        No Sample Response

        This method does not specify any sample responses.

        Get tokenization dictionary status

        Returns the current status of the tokenization dictionary for the specified collection.

        Returns the current status of the tokenization dictionary for the specified collection.

        Returns the current status of the tokenization dictionary for the specified collection.

        Returns the current status of the tokenization dictionary for the specified collection.

        Returns the current status of the tokenization dictionary for the specified collection.

        GET /v1/environments/{environment_id}/collections/{collection_id}/word_lists/tokenization_dictionary
        ServiceCall<TokenDictStatusResponse> getTokenizationDictionaryStatus(GetTokenizationDictionaryStatusOptions getTokenizationDictionaryStatusOptions)
        getTokenizationDictionaryStatus(params)
        get_tokenization_dictionary_status(
                self,
                environment_id: str,
                collection_id: str,
                **kwargs,
            ) -> DetailedResponse
        GetTokenizationDictionaryStatus(string environmentId, string collectionId)

        Request

        Use the GetTokenizationDictionaryStatusOptions.Builder to create a GetTokenizationDictionaryStatusOptions object that contains the parameter values for the getTokenizationDictionaryStatus method.

        Path Parameters

        • The ID of the environment.

          Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

        • The ID of the collection.

          Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

        Query Parameters

        • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

        The getTokenizationDictionaryStatus options.

        parameters

        • The ID of the environment.

          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

        • The ID of the collection.

          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

        parameters

        • The ID of the environment.

          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

        • The ID of the collection.

          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

        parameters

        • The ID of the environment.

          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

        • The ID of the collection.

          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

        • curl -u "apikey":"{apikey}" -X GET "{url}/v1/environments/{environment_id}/collections/{collection_id}/word_lists/tokenization_dictionary?version=2019-04-30"
        • IamAuthenticator authenticator = new IamAuthenticator(
              apikey: "{apikey}"
              );
          
          DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
          discovery.SetServiceUrl("{url}");
          
          var result = discovery.GetTokenizationDictionaryStatus(
              environmentId: "{environmentId}",
              collectionId: "{collectionId}"
              );
          
          Console.WriteLine(result.Response);
        • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
          Discovery discovery = new Discovery("2019-04-30", authenticator);
          discovery.setServiceUrl("{url}");
          
          String environmentId = "{environment_id}";
          String collectionId = "{collection_id}";
          
          GetTokenizationDictionaryStatusOptions getOptions = new GetTokenizationDictionaryStatusOptions.Builder()
            .environmentId(environmentId)
            .collectionId(collectionId)
            .build();
          
          TokenDictStatusResponse response = discovery.getTokenizationDictionaryStatus(getOptions).execute().getResult();
        • const DiscoveryV1 = require('ibm-watson/discovery/v1');
          const { IamAuthenticator } = require('ibm-watson/auth');
          
          const discovery = new DiscoveryV1({
            version: '2019-04-30',
            authenticator: new IamAuthenticator({
              apikey: '{apikey}',
            }),
            serviceUrl: '{url}',
          });
          
          const getTokenizationDictionaryStatusParams = {
            environmentId: '{environment_id}',
            collectionId: '{collection_id}',
          };
          
          discovery.getTokenizationDictionaryStatus(getTokenizationDictionaryStatusParams)
            .then(tokenDictStatusResponse => {
              console.log(JSON.stringify(tokenDictStatusResponse, null, 2));
            })
            .catch(err => {
              console.log('error:', err);
            });

          Response

          Object describing the current status of the wordlist.

          Object describing the current status of the wordlist.

          Examples:
          {
            "status": "pending",
            "type": "tokenization_dictionary"
          }

          Object describing the current status of the wordlist.

          Examples:
          {
            "status": "pending",
            "type": "tokenization_dictionary"
          }

          Object describing the current status of the wordlist.

          Examples:
          {
            "status": "pending",
            "type": "tokenization_dictionary"
          }

          Object describing the current status of the wordlist.

          Examples:
          {
            "status": "pending",
            "type": "tokenization_dictionary"
          }

          Status Code

          • Tokenization dictionary found and is pending or active.

          • Tokenization dictionary for this collection not found.

          • Unexpected error, try again.

          Example responses
          • {
              "status": "pending",
              "type": "tokenization_dictionary"
            }
          • {
              "status": "pending",
              "type": "tokenization_dictionary"
            }
          • {
              "status": "pending",
              "type": "tokenization_dictionary"
            }
          • {
              "status": "pending",
              "type": "tokenization_dictionary"
            }

          Create tokenization dictionary

          Upload a custom tokenization dictionary to use with the specified collection.

          Upload a custom tokenization dictionary to use with the specified collection.

          Upload a custom tokenization dictionary to use with the specified collection.

          Upload a custom tokenization dictionary to use with the specified collection.

          Upload a custom tokenization dictionary to use with the specified collection.

          POST /v1/environments/{environment_id}/collections/{collection_id}/word_lists/tokenization_dictionary
          ServiceCall<TokenDictStatusResponse> createTokenizationDictionary(CreateTokenizationDictionaryOptions createTokenizationDictionaryOptions)
          createTokenizationDictionary(params)
          create_tokenization_dictionary(
                  self,
                  environment_id: str,
                  collection_id: str,
                  *,
                  tokenization_rules: List['TokenDictRule'] = None,
                  **kwargs,
              ) -> DetailedResponse
          CreateTokenizationDictionary(string environmentId, string collectionId, List<TokenDictRule> tokenizationRules = null)

          Request

          Use the CreateTokenizationDictionaryOptions.Builder to create a CreateTokenizationDictionaryOptions object that contains the parameter values for the createTokenizationDictionary method.

          Path Parameters

          • The ID of the environment.

            Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

          • The ID of the collection.

            Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

          Query Parameters

          • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

          An object that represents the tokenization dictionary to be uploaded.

          Examples:
          {
            "tokenization_rules": [
              {
                "text": "すしネコ",
                "tokens": [
                  "すし",
                  "ネコ"
                ],
                "readings": [
                  "寿司",
                  "ネコ"
                ],
                "part_of_speech": "カスタム名詞"
              }
            ]
          }

          The createTokenizationDictionary options.

          parameters

          • The ID of the environment.

            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

          • The ID of the collection.

            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

          • An array of tokenization rules. Each rule contains, the original text string, component tokens, any alternate character set readings, and which part_of_speech the text is from.

          parameters

          • The ID of the environment.

            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

          • The ID of the collection.

            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

          • An array of tokenization rules. Each rule contains, the original text string, component tokens, any alternate character set readings, and which part_of_speech the text is from.

          parameters

          • The ID of the environment.

            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

          • The ID of the collection.

            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

          • An array of tokenization rules. Each rule contains, the original text string, component tokens, any alternate character set readings, and which part_of_speech the text is from.

          • curl -u "apikey":"{apikey}" -X POST -H "Content-Type: application/json" -d @tokendict.json "{url}/v1/environments/{environment_id}/collections/{collection_id}/word_lists/tokenization_dictionary?version=2019-04-30"
          • IamAuthenticator authenticator = new IamAuthenticator(
                apikey: "{apikey}"
                );
            
            DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
            discovery.SetServiceUrl("{url}");
            
            var tokenizationRules = new List<TokenDictRule>()
            {
                new TokenDictRule()
                {
                    Text = "すしネコ",
                    Tokens = new List<string>()
                    {
                        "すし", "ネコ"
                    },
                    Readings = new List<string>()
                    {
                        "寿司", "ネコ"
                    },
                    PartOfSpeech = "カスタム名詞"
                }
            };
            
            var result = discovery.CreateTokenizationDictionary(
                    environmentId: "{environmentId}",
                    collectionId: "{collectionId}",
                    tokenizationRules: tokenizationRules
                    );
            
            Console.WriteLine(result.Response);
          • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
            Discovery discovery = new Discovery("2019-04-30", authenticator);
            discovery.setServiceUrl("{url}");
            
            String environmentId = "{environment_id}";
            String collectionId = "{collection_id}";
            
            TokenDictRule tokenDictRule = new TokenDictRule();
            tokenDictRule.setText("token");
            tokenDictRule.setPartOfSpeech("noun");
            tokenDictRule.setReadings(Arrays.asList("reading 1", "reading 2"));
            tokenDictRule.setTokens(Arrays.asList("token 1", "token 2"));
            
            CreateTokenizationDictionaryOptions createOptions = new CreateTokenizationDictionaryOptions.Builder()
              .environmentId(environmentId)
              .collectionId(collectionId)
              .addTokenizationRules(tokenDictRule)
              .build();
            
            TokenDictStatusResponse response = discovery.createTokenizationDictionary(createOptions).execute().getResult();
          • const DiscoveryV1 = require('ibm-watson/discovery/v1');
            const { IamAuthenticator } = require('ibm-watson/auth');
            
            const discovery = new DiscoveryV1({
              version: '2019-04-30',
              authenticator: new IamAuthenticator({
                apikey: '{apikey}',
              }),
              serviceUrl: '{url}',
            });
            
            const createTokenizationDictionaryParams = {
              environmentId: '{environment_id}',
              collectionId: '{collection_id}',
              tokenizationRules: [
                {
                  text: 'すしネコ',
                  tokens: ['すし', 'ネコ'],
                  readings: ['寿司', 'ネコ'],
                  part_of_speech: 'カスタム名詞',
                },
              ],
            };
            
            discovery.createTokenizationDictionary(createTokenizationDictionaryParams)
              .then(tokenDictStatusResponse => {
                console.log(JSON.stringify(tokenDictStatusResponse, null, 2));
              })
              .catch(err => {
                console.log('error:', err);
              });

            Response

            Object describing the current status of the wordlist.

            Object describing the current status of the wordlist.

            Examples:
            {
              "status": "pending",
              "type": "tokenization_dictionary"
            }

            Object describing the current status of the wordlist.

            Examples:
            {
              "status": "pending",
              "type": "tokenization_dictionary"
            }

            Object describing the current status of the wordlist.

            Examples:
            {
              "status": "pending",
              "type": "tokenization_dictionary"
            }

            Object describing the current status of the wordlist.

            Examples:
            {
              "status": "pending",
              "type": "tokenization_dictionary"
            }

            Status Code

            • Uploaded successfully, pending update to the collection.

            • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

            • Word list too large

            • Unexpected error, try again.

            Example responses
            • {
                "status": "pending",
                "type": "tokenization_dictionary"
              }
            • {
                "status": "pending",
                "type": "tokenization_dictionary"
              }

            Delete tokenization dictionary

            Delete the tokenization dictionary from the collection.

            Delete the tokenization dictionary from the collection.

            Delete the tokenization dictionary from the collection.

            Delete the tokenization dictionary from the collection.

            Delete the tokenization dictionary from the collection.

            DELETE /v1/environments/{environment_id}/collections/{collection_id}/word_lists/tokenization_dictionary
            ServiceCall<Void> deleteTokenizationDictionary(DeleteTokenizationDictionaryOptions deleteTokenizationDictionaryOptions)
            deleteTokenizationDictionary(params)
            delete_tokenization_dictionary(
                    self,
                    environment_id: str,
                    collection_id: str,
                    **kwargs,
                ) -> DetailedResponse
            DeleteTokenizationDictionary(string environmentId, string collectionId)

            Request

            Use the DeleteTokenizationDictionaryOptions.Builder to create a DeleteTokenizationDictionaryOptions object that contains the parameter values for the deleteTokenizationDictionary method.

            Path Parameters

            • The ID of the environment.

              Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

            • The ID of the collection.

              Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

            Query Parameters

            • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

            The deleteTokenizationDictionary options.

            parameters

            • The ID of the environment.

              Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

            • The ID of the collection.

              Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

            parameters

            • The ID of the environment.

              Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

            • The ID of the collection.

              Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

            parameters

            • The ID of the environment.

              Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

            • The ID of the collection.

              Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

            • curl -u "apikey":"{apikey}" -X DELETE "{url}/v1/environments/{environment_id}/collections/{collection_id}/word_lists/tokenization_dictionary?version=2019-04-30"
            • IamAuthenticator authenticator = new IamAuthenticator(
                  apikey: "{apikey}"
                  );
              
              DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
              discovery.SetServiceUrl("{url}");
              
              var result = discovery.DeleteTokenizationDictionary(
                  environmentId: "{environmentId}",
                  collectionId: "{collectionId}"
                  );
              
              Console.WriteLine(result.Response);
            • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
              Discovery discovery = new Discovery("2019-04-30", authenticator);
              discovery.setServiceUrl("{url}");
              
              String environmentId = "{environment_id}";
              String collectionId = "{collection_id}";
              
              DeleteTokenizationDictionaryOptions deleteOptions = new DeleteTokenizationDictionaryOptions.Builder()
                .environmentId(environmentId)
                .collectionId(collectionId)
                .build();
              
              discovery.deleteTokenizationDictionary(deleteOptions).execute();
            • const DiscoveryV1 = require('ibm-watson/discovery/v1');
              const { IamAuthenticator } = require('ibm-watson/auth');
              
              const discovery = new DiscoveryV1({
                version: '2019-04-30',
                authenticator: new IamAuthenticator({
                  apikey: '{apikey}',
                }),
                serviceUrl: '{url}',
              });
              
              const deleteTokenizationDictionaryParams = {
                environmentId: '{environment_id}',
                collectionId: '{collection_id}',
              };
              
              discovery.deleteTokenizationDictionary(deleteTokenizationDictionaryParams)
                .then(result => {
                  console.log(JSON.stringify(result, null, 2));
                })
                .catch(err => {
                  console.log('error:', err);
                });

              Response

              Response type: object

              Status Code

              • Success

              • Unexpected error, try again.

              No Sample Response

              This method does not specify any sample responses.

              Get stopword list status

              Returns the current status of the stopword list for the specified collection.

              Returns the current status of the stopword list for the specified collection.

              Returns the current status of the stopword list for the specified collection.

              Returns the current status of the stopword list for the specified collection.

              Returns the current status of the stopword list for the specified collection.

              GET /v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords
              ServiceCall<TokenDictStatusResponse> getStopwordListStatus(GetStopwordListStatusOptions getStopwordListStatusOptions)
              getStopwordListStatus(params)
              get_stopword_list_status(
                      self,
                      environment_id: str,
                      collection_id: str,
                      **kwargs,
                  ) -> DetailedResponse
              GetStopwordListStatus(string environmentId, string collectionId)

              Request

              Use the GetStopwordListStatusOptions.Builder to create a GetStopwordListStatusOptions object that contains the parameter values for the getStopwordListStatus method.

              Path Parameters

              • The ID of the environment.

                Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

              • The ID of the collection.

                Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

              Query Parameters

              • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

              The getStopwordListStatus options.

              parameters

              • The ID of the environment.

                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

              • The ID of the collection.

                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

              parameters

              • The ID of the environment.

                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

              • The ID of the collection.

                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

              parameters

              • The ID of the environment.

                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

              • The ID of the collection.

                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

              • curl -u "apikey":"{apikey}" -X GET "{url}/v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords?version=2019-04-30"
              • IamAuthenticator authenticator = new IamAuthenticator(
                    apikey: "{apikey}"
                    );
                
                DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                discovery.SetServiceUrl("{url}");
                
                var result = discovery.GetStopwordListStatus(
                    environmentId: "{environmentId}",
                    collectionId: "{collectionId}"
                    );
                
                Console.WriteLine(result.Response);
              • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                Discovery discovery = new Discovery("2019-04-30", authenticator);
                discovery.setServiceUrl("{url}");
                
                String environmentId = "{environment_id}";
                String collectionId = "{collection_id}";
                
                GetStopwordListStatusOptions options = new GetStopwordListStatusOptions.Builder()
                  .environmentId(environmentId)
                  .collectionId(collectionId)
                  .build();
                
                TokenDictStatusResponse response = discovery.getStopwordListStatus(options).execute().getResult();
              • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                const { IamAuthenticator } = require('ibm-watson/auth');
                
                const discovery = new DiscoveryV1({
                  version: '2019-04-30',
                  authenticator: new IamAuthenticator({
                    apikey: '{apikey}',
                  }),
                  serviceUrl: '{url}',
                });
                
                const getStopwordListStatusParams = {
                  environmentId: '{environment_id}',
                  collectionId: '{collection_id}',
                };
                
                discovery.getStopwordListStatus(getStopwordListStatusParams)
                  .then(tokenDictStatusResponse => {
                    console.log(JSON.stringify(tokenDictStatusResponse, null, 2));
                  })
                  .catch(err => {
                    console.log('error:', err);
                  });

                Response

                Object describing the current status of the wordlist.

                Object describing the current status of the wordlist.

                Examples:
                {
                  "status": "pending",
                  "type": "tokenization_dictionary"
                }

                Object describing the current status of the wordlist.

                Examples:
                {
                  "status": "pending",
                  "type": "tokenization_dictionary"
                }

                Object describing the current status of the wordlist.

                Examples:
                {
                  "status": "pending",
                  "type": "tokenization_dictionary"
                }

                Object describing the current status of the wordlist.

                Examples:
                {
                  "status": "pending",
                  "type": "tokenization_dictionary"
                }

                Status Code

                • Stopword list found and is pending or active.

                • Stopword list for this collection not found.

                • Unexpected error, try again.

                Example responses
                • {
                    "status": "pending",
                    "type": "tokenization_dictionary"
                  }
                • {
                    "status": "pending",
                    "type": "tokenization_dictionary"
                  }
                • {
                    "status": "pending",
                    "type": "tokenization_dictionary"
                  }
                • {
                    "status": "pending",
                    "type": "tokenization_dictionary"
                  }

                Create stopword list

                Upload a custom stopword list to use with the specified collection.

                Upload a custom stopword list to use with the specified collection.

                Upload a custom stopword list to use with the specified collection.

                Upload a custom stopword list to use with the specified collection.

                Upload a custom stopword list to use with the specified collection.

                POST /v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords
                ServiceCall<TokenDictStatusResponse> createStopwordList(CreateStopwordListOptions createStopwordListOptions)
                createStopwordList(params)
                create_stopword_list(
                        self,
                        environment_id: str,
                        collection_id: str,
                        stopword_file: BinaryIO,
                        *,
                        stopword_filename: str = None,
                        **kwargs,
                    ) -> DetailedResponse
                CreateStopwordList(string environmentId, string collectionId, System.IO.MemoryStream stopwordFile, string stopwordFilename)

                Request

                Use the CreateStopwordListOptions.Builder to create a CreateStopwordListOptions object that contains the parameter values for the createStopwordList method.

                Path Parameters

                • The ID of the environment.

                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                • The ID of the collection.

                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                Query Parameters

                • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                Form Parameters

                • The content of the stopword list to ingest.

                The createStopwordList options.

                parameters

                • The ID of the environment.

                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                • The ID of the collection.

                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                • The content of the stopword list to ingest.

                • The filename for stopwordFile.

                parameters

                • The ID of the environment.

                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                • The ID of the collection.

                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                • The content of the stopword list to ingest.

                • The filename for stopword_file.

                parameters

                • The ID of the environment.

                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                • The ID of the collection.

                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                • The content of the stopword list to ingest.

                • The filename for stopwordFile.

                • curl -u "apikey":"{apikey}" -X POST --data-binary @stopwords.txt "{url}/v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords?version=2019-04-30"
                • IamAuthenticator authenticator = new IamAuthenticator(
                      apikey: "{apikey}"
                      );
                  
                  DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                  discovery.SetServiceUrl("{url}");
                  
                  DetailedResponse<TokenDictStatusResponse> result;
                  using (FileStream fs = File.OpenRead("{filepath}"))
                  {
                      using (MemoryStream ms = new MemoryStream())
                      {
                          fs.CopyTo(ms);
                          result = discovery.CreateStopwordList(
                              environmentId: "{environmentId}",
                              collectionId: "{collectionId}",
                              stopwordFile: ms,
                              stopwordFilename: "{filepath}"
                              );
                      }
                  }
                  
                  Console.WriteLine(result.Response);
                • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                  Discovery discovery = new Discovery("2019-04-30", authenticator);
                  discovery.setServiceUrl("{url}");
                  
                  String environmentId = "{environment_id}";
                  String collectionId = "{collection_id}";
                  File stopwordFile = new File("{path_to_file}");
                  String stopwordFilename = "stopword_file";
                  
                  CreateStopwordListOptions options = new CreateStopwordListOptions.Builder()
                    .environmentId(environmentId)
                    .collectionId(collectionId)
                    .stopwordFile(stopwordFile)
                    .stopwordFilename(stopwordFilename)
                    .build();
                  
                  TokenDictStatusResponse response = discovery.createStopwordList(options).execute().getResult();
                • const fs = require('fs');
                  const DiscoveryV1 = require('ibm-watson/discovery/v1');
                  const { IamAuthenticator } = require('ibm-watson/auth');
                  
                  const discovery = new DiscoveryV1({
                    version: '2019-04-30',
                    authenticator: new IamAuthenticator({
                      apikey: '{apikey}',
                    }),
                    serviceUrl: '{url}',
                  });
                  
                  const createStopwordListParams = {
                    environmentId: '{environment_id}',
                    collectionId: '{collection_id}',
                    stopwordFile: fs.createReadStream('./stopwords.txt'),
                    stopwordFilename: 'stopwords.txt',
                  };
                  
                  discovery.createStopwordList(createStopwordListParams)
                    .then(tokenDictStatusResponse => {
                      console.log(JSON.stringify(tokenDictStatusResponse, null, 2));
                    })
                    .catch(err => {
                      console.log('error:', err);
                    });

                  Response

                  Object describing the current status of the wordlist.

                  Object describing the current status of the wordlist.

                  Examples:
                  {
                    "status": "pending",
                    "type": "tokenization_dictionary"
                  }

                  Object describing the current status of the wordlist.

                  Examples:
                  {
                    "status": "pending",
                    "type": "tokenization_dictionary"
                  }

                  Object describing the current status of the wordlist.

                  Examples:
                  {
                    "status": "pending",
                    "type": "tokenization_dictionary"
                  }

                  Object describing the current status of the wordlist.

                  Examples:
                  {
                    "status": "pending",
                    "type": "tokenization_dictionary"
                  }

                  Status Code

                  • Stopword list uploaded successfully, pending update to the collection.

                  • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                  • Word list too large

                  • Unexpected error, try again.

                  Example responses
                  • {
                      "status": "pending",
                      "type": "tokenization_dictionary"
                    }
                  • {
                      "status": "pending",
                      "type": "tokenization_dictionary"
                    }

                  Delete a custom stopword list

                  Delete a custom stopword list from the collection. After a custom stopword list is deleted, the default list is used for the collection.

                  Delete a custom stopword list from the collection. After a custom stopword list is deleted, the default list is used for the collection.

                  Delete a custom stopword list from the collection. After a custom stopword list is deleted, the default list is used for the collection.

                  Delete a custom stopword list from the collection. After a custom stopword list is deleted, the default list is used for the collection.

                  Delete a custom stopword list from the collection. After a custom stopword list is deleted, the default list is used for the collection.

                  DELETE /v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords
                  ServiceCall<Void> deleteStopwordList(DeleteStopwordListOptions deleteStopwordListOptions)
                  deleteStopwordList(params)
                  delete_stopword_list(
                          self,
                          environment_id: str,
                          collection_id: str,
                          **kwargs,
                      ) -> DetailedResponse
                  DeleteStopwordList(string environmentId, string collectionId)

                  Request

                  Use the DeleteStopwordListOptions.Builder to create a DeleteStopwordListOptions object that contains the parameter values for the deleteStopwordList method.

                  Path Parameters

                  • The ID of the environment.

                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                  • The ID of the collection.

                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                  Query Parameters

                  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                  The deleteStopwordList options.

                  parameters

                  • The ID of the environment.

                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                  • The ID of the collection.

                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                  parameters

                  • The ID of the environment.

                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                  • The ID of the collection.

                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                  parameters

                  • The ID of the environment.

                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                  • The ID of the collection.

                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                  • curl -u "apikey":"{apikey}" -X DELETE "{url}/v1/environments/{environment_id}/collections/{collection_id}/word_lists/stopwords?version=2019-04-30"
                  • IamAuthenticator authenticator = new IamAuthenticator(
                        apikey: "{apikey}"
                        );
                    
                    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                    discovery.SetServiceUrl("{url}");
                    
                    var result = discovery.DeleteStopwordList(
                        environmentId: "{environmentId}",
                        collectionId: "{collectionId}"
                        );
                    
                    Console.WriteLine(result.Response);
                  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                    Discovery discovery = new Discovery("2019-04-30", authenticator);
                    discovery.setServiceUrl("{url}");
                    
                    String environmentId = "{environment_id}";
                    String collectionId = "{collection_id}";
                    
                    DeleteStopwordListOptions options = new DeleteStopwordListOptions.Builder()
                      .environmentId(environmentId)
                      .collectionId(collectionId)
                      .build();
                    
                    discovery.deleteStopwordList(options).execute();
                  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                    const { IamAuthenticator } = require('ibm-watson/auth');
                    
                    const discovery = new DiscoveryV1({
                      version: '2019-04-30',
                      authenticator: new IamAuthenticator({
                        apikey: '{apikey}',
                      }),
                      serviceUrl: '{url}',
                    });
                    
                    const deleteStopwordListParams = {
                      environmentId: '{environment_id}',
                      collectionId: '{collection_id}',
                    };
                    
                    discovery.deleteStopwordList(deleteStopwordListParams)
                      .then(result => {
                        console.log(JSON.stringify(result, null, 2));
                      })
                      .catch(err => {
                        console.log('error:', err);
                      });

                    Response

                    Response type: object

                    Status Code

                    • Success

                    • Unsupported word list

                    • No word list for type

                    • Unexpected error, try again.

                    No Sample Response

                    This method does not specify any sample responses.

                    Add a document

                    Add a document to a collection with optional metadata.

                    • The version query parameter is still required.

                    • Returns immediately after the system has accepted the document for processing.

                    • The user must provide document content, metadata, or both. If the request is missing both document content and metadata, it is rejected.

                    • The user can set the Content-Type parameter on the file part to indicate the media type of the document. If the Content-Type parameter is missing or is one of the generic media types (for example, application/octet-stream), then the service attempts to automatically detect the document's media type.

                    • The following field names are reserved and will be filtered out if present after normalization: id, score, highlight, and any field with the prefix of: _, +, or -

                    • Fields with empty name values after normalization are filtered out before indexing.

                    • Fields containing the following characters after normalization are filtered out before indexing: # and ,

                    Note: Documents can be added with a specific document_id by using the /v1/environments/{environment_id}/collections/{collection_id}/documents method.

                    Add a document to a collection with optional metadata.

                    • The version query parameter is still required.

                    • Returns immediately after the system has accepted the document for processing.

                    • The user must provide document content, metadata, or both. If the request is missing both document content and metadata, it is rejected.

                    • The user can set the Content-Type parameter on the file part to indicate the media type of the document. If the Content-Type parameter is missing or is one of the generic media types (for example, application/octet-stream), then the service attempts to automatically detect the document's media type.

                    • The following field names are reserved and will be filtered out if present after normalization: id, score, highlight, and any field with the prefix of: _, +, or -

                    • Fields with empty name values after normalization are filtered out before indexing.

                    • Fields containing the following characters after normalization are filtered out before indexing: # and ,

                    Note: Documents can be added with a specific document_id by using the _/v1/environments/{environment_id}/collections/{collection_id}/documents method.

                    Add a document to a collection with optional metadata.

                    • The version query parameter is still required.

                    • Returns immediately after the system has accepted the document for processing.

                    • The user must provide document content, metadata, or both. If the request is missing both document content and metadata, it is rejected.

                    • The user can set the Content-Type parameter on the file part to indicate the media type of the document. If the Content-Type parameter is missing or is one of the generic media types (for example, application/octet-stream), then the service attempts to automatically detect the document's media type.

                    • The following field names are reserved and will be filtered out if present after normalization: id, score, highlight, and any field with the prefix of: _, +, or -

                    • Fields with empty name values after normalization are filtered out before indexing.

                    • Fields containing the following characters after normalization are filtered out before indexing: # and ,

                    Note: Documents can be added with a specific document_id by using the _/v1/environments/{environment_id}/collections/{collection_id}/documents method.

                    Add a document to a collection with optional metadata.

                    • The version query parameter is still required.

                    • Returns immediately after the system has accepted the document for processing.

                    • The user must provide document content, metadata, or both. If the request is missing both document content and metadata, it is rejected.

                    • The user can set the Content-Type parameter on the file part to indicate the media type of the document. If the Content-Type parameter is missing or is one of the generic media types (for example, application/octet-stream), then the service attempts to automatically detect the document's media type.

                    • The following field names are reserved and will be filtered out if present after normalization: id, score, highlight, and any field with the prefix of: _, +, or -

                    • Fields with empty name values after normalization are filtered out before indexing.

                    • Fields containing the following characters after normalization are filtered out before indexing: # and ,

                    Note: Documents can be added with a specific document_id by using the /v1/environments/{environment_id}/collections/{collection_id}/documents method.

                    Add a document to a collection with optional metadata.

                    • The version query parameter is still required.

                    • Returns immediately after the system has accepted the document for processing.

                    • The user must provide document content, metadata, or both. If the request is missing both document content and metadata, it is rejected.

                    • The user can set the Content-Type parameter on the file part to indicate the media type of the document. If the Content-Type parameter is missing or is one of the generic media types (for example, application/octet-stream), then the service attempts to automatically detect the document's media type.

                    • The following field names are reserved and will be filtered out if present after normalization: id, score, highlight, and any field with the prefix of: _, +, or -

                    • Fields with empty name values after normalization are filtered out before indexing.

                    • Fields containing the following characters after normalization are filtered out before indexing: # and ,

                    Note: Documents can be added with a specific document_id by using the _/v1/environments/{environment_id}/collections/{collection_id}/documents method.

                    POST /v1/environments/{environment_id}/collections/{collection_id}/documents
                    ServiceCall<DocumentAccepted> addDocument(AddDocumentOptions addDocumentOptions)
                    addDocument(params)
                    add_document(
                            self,
                            environment_id: str,
                            collection_id: str,
                            *,
                            file: BinaryIO = None,
                            filename: str = None,
                            file_content_type: str = None,
                            metadata: str = None,
                            **kwargs,
                        ) -> DetailedResponse
                    AddDocument(string environmentId, string collectionId, System.IO.MemoryStream file = null, string filename = null, string fileContentType = null, string metadata = null)

                    Request

                    Use the AddDocumentOptions.Builder to create a AddDocumentOptions object that contains the parameter values for the addDocument method.

                    Path Parameters

                    • The ID of the environment.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                    • The ID of the collection.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                    Query Parameters

                    • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                    Form Parameters

                    • The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected.

                    • The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example: { "Creator": "Johnny Appleseed", "Subject": "Apples" }

                    The addDocument options.

                    parameters

                    • The ID of the environment.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the collection.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected.

                    • The filename for file.

                    • The content type of file.

                      Allowable values: [application/json,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf,text/html,application/xhtml+xml]

                    • The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example: { "Creator": "Johnny Appleseed", "Subject": "Apples" }.

                    parameters

                    • The ID of the environment.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the collection.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected.

                    • The filename for file.

                    • The content type of file.

                      Allowable values: [application/json,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf,text/html,application/xhtml+xml]

                    • The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example: { "Creator": "Johnny Appleseed", "Subject": "Apples" }.

                    parameters

                    • The ID of the environment.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the collection.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected.

                    • The filename for file.

                    • The content type of file.

                      Allowable values: [application/json,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf,text/html,application/xhtml+xml]

                    • The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example: { "Creator": "Johnny Appleseed", "Subject": "Apples" }.

                    • curl -X POST -u "apikey":"{apikey}" -F file=@sample1.html "{url}/v1/environments/{environment_id}/collections/{collection_id}/documents?version=2019-04-30"

                      Download example document sample1.html

                    • IamAuthenticator authenticator = new IamAuthenticator(
                          apikey: "{apikey}"
                          );
                      
                      DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                      discovery.SetServiceUrl("{url}");
                      
                      DetailedResponse<DocumentAccepted> result;
                      using (FileStream fs = File.OpenRead("{filePath}"))
                      {
                          using (MemoryStream ms = new MemoryStream())
                          {
                              fs.CopyTo(ms);
                              result = discovery.AddDocument(
                              environmentId: "{environmentId}",
                              collectionId: "{collectionId}",
                              file: ms,
                              filename: "{fileName}",
                              fileContentType: "{fileContentType}",
                              metadata: metadata
                              );
                      
                              documentId = result.Result.DocumentId;
                          }
                      }
                      
                      Console.WriteLine(result.Response);
                    • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                      Discovery discovery = new Discovery("2019-04-30", authenticator);
                      discovery.setServiceUrl("{url}");
                      
                      String environmentId = "{environment_id}";
                      String collectionId = "{collection_id}";
                      InputStream documentStream = new ByteArrayInputStream(documentJson.getBytes());
                      
                      AddDocumentOptions.Builder builder = new AddDocumentOptions.Builder(environmentId, collectionId);
                      builder.file(documentStream);
                      builder.fileContentType(HttpMediaType.APPLICATION_JSON);
                      DocumentAccepted response = discovery.addDocument(builder.build()).execute().getResult();

                      Download example document sample1.html

                    • const fs = require('fs');
                      const DiscoveryV1 = require('ibm-watson/discovery/v1');
                      const { IamAuthenticator } = require('ibm-watson/auth');
                      
                      const discovery = new DiscoveryV1({
                        version: '2019-04-30',
                        authenticator: new IamAuthenticator({
                          apikey: '{apikey}',
                        }),
                        serviceUrl: '{url}',
                      });
                      
                      const addDocumentParams = {
                        environmentId: '{environment_id}',
                        collectionId: '{collection_id}',
                        file: fs.createReadStream('./sampleWord.docx'),
                      };
                      
                      discovery.addDocument(addDocumentParams)
                        .then(documentAccepted => {
                          const documentAccepted = response.result;
                          console.log(JSON.stringify(documentAccepted, null, 2));
                        })
                        .catch(err => {
                          console.log('error:', err);
                        });

                      Download example document sample1.html

                    • import os
                      import json
                      from ibm_watson import DiscoveryV1
                      from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
                      
                      authenticator = IAMAuthenticator('{apikey}')
                      discovery = DiscoveryV1(
                          version='2019-04-30',
                          authenticator=authenticator
                      )
                      
                      discovery.set_service_url('{url}')
                      
                      with open(os.path.join(os.getcwd(), '{path_element}', '{filename}')) as fileinfo:
                          add_doc = discovery.add_document(
                              '{environment_id}', 
                              '{collection_id}',
                              file=fileinfo).get_result()
                      print(json.dumps(add_doc, indent=2))

                      Download example document sample1.html

                    Response

                    Information returned after an uploaded document is accepted.

                    Information returned after an uploaded document is accepted.

                    Examples:
                    {
                      "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                      "status": "processing"
                    }

                    Information returned after an uploaded document is accepted.

                    Examples:
                    {
                      "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                      "status": "processing"
                    }

                    Information returned after an uploaded document is accepted.

                    Examples:
                    {
                      "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                      "status": "processing"
                    }

                    Information returned after an uploaded document is accepted.

                    Examples:
                    {
                      "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                      "status": "processing"
                    }

                    Status Code

                    • The document has been accepted and will be processed.

                    • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                    • Forbidden. Returned if you attempt to add a document to a collection in a read-only environment.

                    Example responses
                    • {
                        "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                        "status": "processing"
                      }
                    • {
                        "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                        "status": "processing"
                      }

                    Get document details

                    Fetch status details about a submitted document. Note: this operation does not return the document itself. Instead, it returns only the document's processing status and any notices (warnings or errors) that were generated when the document was ingested. Use the query API to retrieve the actual document content.

                    Fetch status details about a submitted document. Note: this operation does not return the document itself. Instead, it returns only the document's processing status and any notices (warnings or errors) that were generated when the document was ingested. Use the query API to retrieve the actual document content.

                    Fetch status details about a submitted document. Note: this operation does not return the document itself. Instead, it returns only the document's processing status and any notices (warnings or errors) that were generated when the document was ingested. Use the query API to retrieve the actual document content.

                    Fetch status details about a submitted document. Note: this operation does not return the document itself. Instead, it returns only the document's processing status and any notices (warnings or errors) that were generated when the document was ingested. Use the query API to retrieve the actual document content.

                    Fetch status details about a submitted document. Note: this operation does not return the document itself. Instead, it returns only the document's processing status and any notices (warnings or errors) that were generated when the document was ingested. Use the query API to retrieve the actual document content.

                    GET /v1/environments/{environment_id}/collections/{collection_id}/documents/{document_id}
                    ServiceCall<DocumentStatus> getDocumentStatus(GetDocumentStatusOptions getDocumentStatusOptions)
                    getDocumentStatus(params)
                    get_document_status(
                            self,
                            environment_id: str,
                            collection_id: str,
                            document_id: str,
                            **kwargs,
                        ) -> DetailedResponse
                    GetDocumentStatus(string environmentId, string collectionId, string documentId)

                    Request

                    Use the GetDocumentStatusOptions.Builder to create a GetDocumentStatusOptions object that contains the parameter values for the getDocumentStatus method.

                    Path Parameters

                    • The ID of the environment.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                    • The ID of the collection.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                    • The ID of the document.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                    Query Parameters

                    • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                    The getDocumentStatus options.

                    parameters

                    • The ID of the environment.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the collection.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the document.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    parameters

                    • The ID of the environment.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the collection.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the document.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    parameters

                    • The ID of the environment.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the collection.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the document.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/documents/{document_id}?version=2019-04-30"
                    • IamAuthenticator authenticator = new IamAuthenticator(
                          apikey: "{apikey}"
                          );
                      
                      DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                      discovery.SetServiceUrl("{url}");
                      
                      var result = discovery.GetDocumentStatus(
                          environmentId: "{environmentId}",
                          collectionId: "{collectionId}",
                          documentId: "{documentId}"
                          );
                      
                      Console.WriteLine(result.Response);
                    • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                      Discovery discovery = new Discovery("2019-04-30", authenticator);
                      discovery.setServiceUrl("{url}");
                      
                      String environmentId = "{environment_id}";
                      String collectionId = "{collection_id}";
                      String documentId = "{document_id}";
                      
                      GetDocumentStatusOptions getOptions = new GetDocumentStatusOptions.Builder(environmentId, collectionId, documentId).build();
                      DocumentStatus response = discovery.getDocumentStatus(getOptions).execute().getResult();
                    • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                      const { IamAuthenticator } = require('ibm-watson/auth');
                      
                      const discovery = new DiscoveryV1({
                        version: '2019-04-30',
                        authenticator: new IamAuthenticator({
                          apikey: '{apikey}',
                        }),
                        serviceUrl: '{url}',
                      });
                      
                      const getDocumentStatusParams = {
                        environmentId: '{environment_id}',
                        collectionId: '{collection_id}',
                        documentId: '{document_id}',
                      };
                      
                      discovery.getDocumentStatus(getDocumentStatusParams)
                        .then(documentStatus => {
                          console.log(JSON.stringify(documentStatus, null, 2));
                        })
                        .catch(err => {
                          console.log('error:', err);
                        });
                    • import json
                      from ibm_watson import DiscoveryV1
                      from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
                      
                      authenticator = IAMAuthenticator('{apikey}')
                      discovery = DiscoveryV1(
                          version='2019-04-30',
                          authenticator=authenticator
                      )
                      
                      discovery.set_service_url('{url}')
                      
                      doc_info = discovery.get_document_status(
                          '{environment_id}', 
                          '{collection_id}', 
                          '{document_id}').get_result()
                      print(json.dumps(doc_info, indent=2))

                    Response

                    Status information about a submitted document.

                    Status information about a submitted document.

                    Examples:
                    {
                      "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                      "configuration_id": "e8b9d793-b163-452a-9373-bce07efb510b",
                      "status": "available with notices",
                      "status_description": "Document is successfully ingested but was indexed with warnings",
                      "filename": "instructions.html",
                      "file_type": "html",
                      "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
                      "notices": [
                        {
                          "notice_id": "index_342",
                          "severity": "warning",
                          "step": "indexing",
                          "description": "something bad happened",
                          "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37"
                        }
                      ]
                    }

                    Status information about a submitted document.

                    Examples:
                    {
                      "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                      "configuration_id": "e8b9d793-b163-452a-9373-bce07efb510b",
                      "status": "available with notices",
                      "status_description": "Document is successfully ingested but was indexed with warnings",
                      "filename": "instructions.html",
                      "file_type": "html",
                      "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
                      "notices": [
                        {
                          "notice_id": "index_342",
                          "severity": "warning",
                          "step": "indexing",
                          "description": "something bad happened",
                          "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37"
                        }
                      ]
                    }

                    Status information about a submitted document.

                    Examples:
                    {
                      "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                      "configuration_id": "e8b9d793-b163-452a-9373-bce07efb510b",
                      "status": "available with notices",
                      "status_description": "Document is successfully ingested but was indexed with warnings",
                      "filename": "instructions.html",
                      "file_type": "html",
                      "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
                      "notices": [
                        {
                          "notice_id": "index_342",
                          "severity": "warning",
                          "step": "indexing",
                          "description": "something bad happened",
                          "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37"
                        }
                      ]
                    }

                    Status information about a submitted document.

                    Examples:
                    {
                      "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                      "configuration_id": "e8b9d793-b163-452a-9373-bce07efb510b",
                      "status": "available with notices",
                      "status_description": "Document is successfully ingested but was indexed with warnings",
                      "filename": "instructions.html",
                      "file_type": "html",
                      "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
                      "notices": [
                        {
                          "notice_id": "index_342",
                          "severity": "warning",
                          "step": "indexing",
                          "description": "something bad happened",
                          "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37"
                        }
                      ]
                    }

                    Status Code

                    • Successfully fetched document details.

                    • Bad request.

                    • Forbidden. Returned if you attempt to get the status of a document in a collection in a read-only environment.

                    Example responses
                    • {
                        "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                        "configuration_id": "e8b9d793-b163-452a-9373-bce07efb510b",
                        "status": "available with notices",
                        "status_description": "Document is successfully ingested but was indexed with warnings",
                        "filename": "instructions.html",
                        "file_type": "html",
                        "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
                        "notices": [
                          {
                            "notice_id": "index_342",
                            "severity": "warning",
                            "step": "indexing",
                            "description": "something bad happened",
                            "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37"
                          }
                        ]
                      }
                    • {
                        "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                        "configuration_id": "e8b9d793-b163-452a-9373-bce07efb510b",
                        "status": "available with notices",
                        "status_description": "Document is successfully ingested but was indexed with warnings",
                        "filename": "instructions.html",
                        "file_type": "html",
                        "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
                        "notices": [
                          {
                            "notice_id": "index_342",
                            "severity": "warning",
                            "step": "indexing",
                            "description": "something bad happened",
                            "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37"
                          }
                        ]
                      }

                    Update a document

                    Replace an existing document or add a document with a specified document_id. Starts ingesting a document with optional metadata.

                    Note: When uploading a new document with this method it automatically replaces any document stored with the same document_id if it exists.

                    Replace an existing document or add a document with a specified document_id. Starts ingesting a document with optional metadata.

                    Note: When uploading a new document with this method it automatically replaces any document stored with the same document_id if it exists.

                    Replace an existing document or add a document with a specified document_id. Starts ingesting a document with optional metadata.

                    Note: When uploading a new document with this method it automatically replaces any document stored with the same document_id if it exists.

                    Replace an existing document or add a document with a specified document_id. Starts ingesting a document with optional metadata.

                    Note: When uploading a new document with this method it automatically replaces any document stored with the same document_id if it exists.

                    Replace an existing document or add a document with a specified document_id. Starts ingesting a document with optional metadata.

                    Note: When uploading a new document with this method it automatically replaces any document stored with the same document_id if it exists.

                    POST /v1/environments/{environment_id}/collections/{collection_id}/documents/{document_id}
                    ServiceCall<DocumentAccepted> updateDocument(UpdateDocumentOptions updateDocumentOptions)
                    updateDocument(params)
                    update_document(
                            self,
                            environment_id: str,
                            collection_id: str,
                            document_id: str,
                            *,
                            file: BinaryIO = None,
                            filename: str = None,
                            file_content_type: str = None,
                            metadata: str = None,
                            **kwargs,
                        ) -> DetailedResponse
                    UpdateDocument(string environmentId, string collectionId, string documentId, System.IO.MemoryStream file = null, string filename = null, string fileContentType = null, string metadata = null)

                    Request

                    Use the UpdateDocumentOptions.Builder to create a UpdateDocumentOptions object that contains the parameter values for the updateDocument method.

                    Path Parameters

                    • The ID of the environment.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                    • The ID of the collection.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                    • The ID of the document.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                    Query Parameters

                    • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                    Form Parameters

                    • The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected.

                    • The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example: { "Creator": "Johnny Appleseed", "Subject": "Apples" }

                    The updateDocument options.

                    parameters

                    • The ID of the environment.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the collection.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the document.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected.

                    • The filename for file.

                    • The content type of file.

                      Allowable values: [application/json,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf,text/html,application/xhtml+xml]

                    • The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example: { "Creator": "Johnny Appleseed", "Subject": "Apples" }.

                    parameters

                    • The ID of the environment.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the collection.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the document.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected.

                    • The filename for file.

                    • The content type of file.

                      Allowable values: [application/json,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf,text/html,application/xhtml+xml]

                    • The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example: { "Creator": "Johnny Appleseed", "Subject": "Apples" }.

                    parameters

                    • The ID of the environment.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the collection.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the document.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The content of the document to ingest. The maximum supported file size when adding a file to a collection is 50 megabytes, the maximum supported file size when testing a configuration is 1 megabyte. Files larger than the supported size are rejected.

                    • The filename for file.

                    • The content type of file.

                      Allowable values: [application/json,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/pdf,text/html,application/xhtml+xml]

                    • The maximum supported metadata file size is 1 MB. Metadata parts larger than 1 MB are rejected. Example: { "Creator": "Johnny Appleseed", "Subject": "Apples" }.

                    • curl -X POST -u "apikey":"{apikey}" -F "file=@sample1.html;type=text/html" "{url}/v1/environments/{environment_id}/collections/{collection_id}/documents/{document_id}?version=2019-04-30"

                      Download example document sample1.html

                    • IamAuthenticator authenticator = new IamAuthenticator(
                          apikey: "{apikey}"
                          );
                      
                      DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                      discovery.SetServiceUrl("{url}");
                      
                      DetailedResponse<DocumentAccepted> result;
                      using (FileStream fs = File.OpenRead("{filePath}"))
                      {
                          using (MemoryStream ms = new MemoryStream())
                          {
                              fs.CopyTo(ms);
                              result = discovery.UpdateDocument(
                                  environmentId: "{environmentId}",
                                  collectionId: "{collectionId}",
                                  documentId: "{documentId}",
                                  file: ms,
                                  filename: "{fileName}",
                                  fileContentType: "{fileContentType}",
                                  metadata: metadata
                                  );
                          }
                      }
                      
                      Console.WriteLine(result.Response);
                    • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                      Discovery discovery = new Discovery("2019-04-30", authenticator);
                      discovery.setServiceUrl("{url}");
                      
                      String environmentId = "{environment_id}";
                      String collectionId = "{collection_id}";
                      String documentId = "{document_id}";
                      String updatedDocumentJson = "{\"field\":\"value2\"}";
                      InputStream updatedDocumentStream = new ByteArrayInputStream(updatedDocumentJson.getBytes());
                      
                      UpdateDocumentOptions.Builder updateBuilder = new UpdateDocumentOptions.Builder(environmentId, collectionId, documentId);
                      updateBuilder.file(updatedDocumentStream);
                      updateBuilder.fileContentType(HttpMediaType.APPLICATION_JSON);
                      DocumentAccepted updateResponse = discovery.updateDocument(updateBuilder.build()).execute().getResult();

                      Download example document sample1.html

                    • const fs = require('fs');
                      const DiscoveryV1 = require('ibm-watson/discovery/v1');
                      const { IamAuthenticator } = require('ibm-watson/auth');
                      
                      const discovery = new DiscoveryV1({
                        version: '2019-04-30',
                        authenticator: new IamAuthenticator({
                          apikey: '{apikey}',
                        }),
                        serviceUrl: '{url}',
                      });
                      
                      const updateDocumentParams = {
                        environmentId: '{environment_id}',
                        collectionId: '{collection_id}',
                        documentId: '{document_id}',
                        file: fs.createReadStream('./sampleWord.docx'),
                        filename: 'new-filename.docx',
                      };
                      
                      discovery.updateDocument(updateDocumentParams)
                        .then(documentAccepted => {
                          console.log(JSON.stringify(documentAccepted, null, 2));
                        })
                        .catch(err => {
                          console.log('error:', err);
                        });
                    • import os
                      import json
                      from ibm_watson import DiscoveryV1
                      from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
                      
                      authenticator = IAMAuthenticator('{apikey}')
                      discovery = DiscoveryV1(
                          version='2019-04-30',
                          authenticator=authenticator
                      )
                      
                      discovery.set_service_url('{url}')
                      
                      with open(os.path.join(os.getcwd(), '{path_element}', '{filename}')) as fileinfo:
                          add_doc = discovery.update_document(
                              '{environment_id}', 
                              '{collection_id}', 
                              '{document_id}', 
                              file=fileinfo).get_result()
                      print(json.dumps(add_doc, indent=2))

                      Download example document sample1.html

                    Response

                    Information returned after an uploaded document is accepted.

                    Information returned after an uploaded document is accepted.

                    Examples:
                    {
                      "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                      "status": "processing"
                    }

                    Information returned after an uploaded document is accepted.

                    Examples:
                    {
                      "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                      "status": "processing"
                    }

                    Information returned after an uploaded document is accepted.

                    Examples:
                    {
                      "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                      "status": "processing"
                    }

                    Information returned after an uploaded document is accepted.

                    Examples:
                    {
                      "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                      "status": "processing"
                    }

                    Status Code

                    • The document has been accepted and it will be processed.

                    • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                    • Forbidden. Returned if you attempt to add or update a document in a collection in a read-only environment.

                    Example responses
                    • {
                        "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                        "status": "processing"
                      }
                    • {
                        "document_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                        "status": "processing"
                      }

                    Delete a document

                    If the given document ID is invalid, or if the document is not found, then the a success response is returned (HTTP status code 200) with the status set to 'deleted'.

                    If the given document ID is invalid, or if the document is not found, then the a success response is returned (HTTP status code 200) with the status set to 'deleted'.

                    If the given document ID is invalid, or if the document is not found, then the a success response is returned (HTTP status code 200) with the status set to 'deleted'.

                    If the given document ID is invalid, or if the document is not found, then the a success response is returned (HTTP status code 200) with the status set to 'deleted'.

                    If the given document ID is invalid, or if the document is not found, then the a success response is returned (HTTP status code 200) with the status set to 'deleted'.

                    DELETE /v1/environments/{environment_id}/collections/{collection_id}/documents/{document_id}
                    ServiceCall<DeleteDocumentResponse> deleteDocument(DeleteDocumentOptions deleteDocumentOptions)
                    deleteDocument(params)
                    delete_document(
                            self,
                            environment_id: str,
                            collection_id: str,
                            document_id: str,
                            **kwargs,
                        ) -> DetailedResponse
                    DeleteDocument(string environmentId, string collectionId, string documentId)

                    Request

                    Use the DeleteDocumentOptions.Builder to create a DeleteDocumentOptions object that contains the parameter values for the deleteDocument method.

                    Path Parameters

                    • The ID of the environment.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                    • The ID of the collection.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                    • The ID of the document.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                    Query Parameters

                    • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                    The deleteDocument options.

                    parameters

                    • The ID of the environment.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the collection.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the document.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    parameters

                    • The ID of the environment.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the collection.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the document.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    parameters

                    • The ID of the environment.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the collection.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • The ID of the document.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                    • curl -X DELETE -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/documents/{document_id}?version=2019-04-30"
                    • IamAuthenticator authenticator = new IamAuthenticator(
                          apikey: "{apikey}"
                          );
                      
                      DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                      discovery.SetServiceUrl("{url}");
                      
                      var result = discovery.DeleteDocument(
                          environmentId: "{environmentId}",
                          collectionId: "{collectionId}",
                          documentId: "{documentId}"
                          );
                      
                      Console.WriteLine(result.Response);
                    • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                      Discovery discovery = new Discovery("2019-04-30", authenticator);
                      discovery.setServiceUrl("{url}");
                      
                      String environmentId = "{environment_id}";
                      String collectionId = "{collection_id}";
                      String documentId = "{document_id}";
                      
                      DeleteDocumentOptions deleteRequest = new DeleteDocumentOptions.Builder(environmentId, collectionId, documentId).build();
                      DeleteDocumentResponse deleteResponse = discovery.deleteDocument(deleteRequest).execute().getResult();
                    • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                      const { IamAuthenticator } = require('ibm-watson/auth');
                      
                      const discovery = new DiscoveryV1({
                        version: '2019-04-30',
                        authenticator: new IamAuthenticator({
                          apikey: '{apikey}',
                        }),
                        serviceUrl: '{url}',
                      });
                      
                      const deleteDocumentParams = {
                        environmentId: '{environment_id}',
                        collectionId: '{collection_id}',
                        documentId: '{document_id}',
                      };
                      
                      discovery.deleteDocument(deleteDocumentParams)
                        .then(deleteDocumentResponse => {
                          console.log(JSON.stringify(deleteDocumentResponse, null, 2));
                        })
                        .catch(err => {
                          console.log('error:', err);
                        });
                    • import json
                      from ibm_watson import DiscoveryV1
                      from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
                      
                      authenticator = IAMAuthenticator('{apikey}')
                      discovery = DiscoveryV1(
                          version='2019-04-30',
                          authenticator=authenticator
                      )
                      
                      discovery.set_service_url('{url}')
                      
                      delete_doc = discovery.delete_document('{environment_id}', '{collection_id}', '{document_id}').get_result()
                      print(json.dumps(delete_doc, indent=2))

                    Response

                    Information returned when a document is deleted.

                    Information returned when a document is deleted.

                    Information returned when a document is deleted.

                    Information returned when a document is deleted.

                    Information returned when a document is deleted.

                    Status Code

                    • The document was successfully deleted.

                    • Bad request.

                      A bad request is returned any time there is a problem with the request itself.

                    • Forbidden. Returned if you attempt to delete a document in a collection in a read-only environment.

                    No Sample Response

                    This method does not specify any sample responses.

                    Query a collection (GET)

                    After your content is uploaded and enriched by Discovery, you can build queries to search your content. For details, see the Discovery documentation.

                    GET /v1/environments/{environment_id}/collections/{collection_id}/query

                    Request

                    Custom Headers

                    • If true, queries are not stored in the Discovery Logs endpoint.

                      Default: false

                    Path Parameters

                    • The ID of the environment.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                    • The ID of the collection.

                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                    Query Parameters

                    • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                    • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                    • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.

                    • A natural language query that returns relevant documents by utilizing training data and natural language understanding.

                    • A passages query that returns the most relevant passages from the results.

                    • An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.

                    • Number of results to return. The maximum for the count and offset values together in any one query is 10000

                      Default: 10

                    • A comma-separated list of the portion of the document hierarchy to return.

                    • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000

                    • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified.

                    • When true, a highlight field is returned for each result which contains the fields which match the query with <em></em> tags around the matching query terms.

                      Default: false

                    • A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.

                    • The maximum number of passages to return. The search returns fewer passages if the requested total is not found.

                      Possible values: value ≤ 100

                      Default: 10

                    • The approximate number of characters that any one passage will have.

                      Possible values: 50 ≤ value ≤ 2000

                      Default: 400

                    • When true and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.

                      Default: false

                    • When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.

                    • When true, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.

                      Default: false

                    • A comma-separated list of document IDs to find similar documents.

                      Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.

                    • A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.

                    • Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.

                    • curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/query?version=2019-04-30&query=relations.action.lemmatized:acquire&count=15&filter=entities.text:IBM&return=text"
                      • import json
                        from ibm_watson import DiscoveryV1
                        from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
                        
                        authenticator = IAMAuthenticator('{apikey}')
                        discovery = DiscoveryV1(
                            version='2019-04-30',
                            authenticator=authenticator
                        )
                        
                        discovery.set_service_url('{url}')
                        
                        my_query = discovery.query(
                            environment_id='{environment_id}',
                            collection_id='{collection_id}', 
                            filter='{filter}',
                            query='{query}', 
                            aggregation='{aggregation}', 
                            return_fields='{return_fields}' ).get_result()
                        print(json.dumps(my_query, indent=2))

                      Response

                      A response containing the documents and aggregations for the query.

                      Status Code

                      • Query executed successfully.

                      • Bad request.

                      • query and natural_language_query can be used in the same request only if training is complete.

                      • Query timed out.

                      Example responses
                      • {
                          "matching_results": 24,
                          "session_token": "1232139230123123123",
                          "retrieval_details": {
                            "document_retrieval_strategy": "untrained"
                          },
                          "results": [
                            {
                              "id": "watson-generated ID",
                              "score": 1
                            }
                          ],
                          "aggregations": {
                            "term": {
                              "results": [
                                {
                                  "key": "active",
                                  "matching_results": 34
                                }
                              ]
                            }
                          }
                        }

                      Query a collection

                      By using this method, you can construct long queries. For details, see the Discovery documentation.

                      By using this method, you can construct long queries. For details, see the Discovery documentation.

                      By using this method, you can construct long queries. For details, see the Discovery documentation.

                      By using this method, you can construct long queries. For details, see the Discovery documentation.

                      By using this method, you can construct long queries. For details, see the Discovery documentation.

                      POST /v1/environments/{environment_id}/collections/{collection_id}/query
                      ServiceCall<QueryResponse> query(QueryOptions queryOptions)
                      query(params)
                      query(
                              self,
                              environment_id: str,
                              collection_id: str,
                              *,
                              filter: str = None,
                              query: str = None,
                              natural_language_query: str = None,
                              passages: bool = None,
                              aggregation: str = None,
                              count: int = None,
                              return_: str = None,
                              offset: int = None,
                              sort: str = None,
                              highlight: bool = None,
                              passages_fields: str = None,
                              passages_count: int = None,
                              passages_characters: int = None,
                              deduplicate: bool = None,
                              deduplicate_field: str = None,
                              similar: bool = None,
                              similar_document_ids: str = None,
                              similar_fields: str = None,
                              bias: str = None,
                              spelling_suggestions: bool = None,
                              x_watson_logging_opt_out: bool = None,
                              **kwargs,
                          ) -> DetailedResponse
                      Query(string environmentId, string collectionId, string filter = null, string query = null, string naturalLanguageQuery = null, bool? passages = null, string aggregation = null, long? count = null, string _return = null, long? offset = null, string sort = null, bool? highlight = null, string passagesFields = null, long? passagesCount = null, long? passagesCharacters = null, bool? deduplicate = null, string deduplicateField = null, bool? similar = null, string similarDocumentIds = null, string similarFields = null, string bias = null, bool? spellingSuggestions = null, bool? xWatsonLoggingOptOut = null)

                      Request

                      Use the QueryOptions.Builder to create a QueryOptions object that contains the parameter values for the query method.

                      Custom Headers

                      • If true, queries are not stored in the Discovery Logs endpoint.

                        Default: false

                      Path Parameters

                      • The ID of the environment.

                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                      • The ID of the collection.

                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                      Query Parameters

                      • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                      An object that represents the query to be submitted.

                      The query options.

                      parameters

                      • The ID of the environment.

                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                      • The ID of the collection.

                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                      • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                      • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. Use a query search when you want to find the most relevant search results.

                      • A natural language query that returns relevant documents by utilizing training data and natural language understanding.

                      • A passages query that returns the most relevant passages from the results.

                      • An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.

                      • Number of results to return.

                        Default: 10

                      • A comma-separated list of the portion of the document hierarchy to return.

                      • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results.

                      • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified. This parameter cannot be used in the same query as the bias parameter.

                      • When true, a highlight field is returned for each result which contains the fields which match the query with <em></em> tags around the matching query terms.

                        Default: false

                      • A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.

                      • The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The default is 10. The maximum is 100.

                        Possible values: value ≤ 100

                        Default: 10

                      • The approximate number of characters that any one passage will have.

                        Possible values: 50 ≤ value ≤ 2000

                        Default: 400

                      • When true, and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.

                        Default: false

                      • When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.

                      • When true, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.

                        Default: false

                      • A comma-separated list of document IDs to find similar documents.

                        Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.

                      • A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.

                      • Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.

                      • When true and the natural_language_query parameter is used, the natural_languge_query parameter is spell checked. The most likely correction is returned in the suggested_query field of the response (if one exists).

                        Important: this parameter is only valid when using the Cloud Pak version of Discovery.

                        Default: false

                      • If true, queries are not stored in the Discovery Logs endpoint.

                        Default: false

                      parameters

                      • The ID of the environment.

                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                      • The ID of the collection.

                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                      • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                      • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. Use a query search when you want to find the most relevant search results.

                      • A natural language query that returns relevant documents by utilizing training data and natural language understanding.

                      • A passages query that returns the most relevant passages from the results.

                      • An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.

                      • Number of results to return.

                        Default: 10

                      • A comma-separated list of the portion of the document hierarchy to return.

                      • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results.

                      • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified. This parameter cannot be used in the same query as the bias parameter.

                      • When true, a highlight field is returned for each result which contains the fields which match the query with <em></em> tags around the matching query terms.

                        Default: false

                      • A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.

                      • The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The default is 10. The maximum is 100.

                        Possible values: value ≤ 100

                        Default: 10

                      • The approximate number of characters that any one passage will have.

                        Possible values: 50 ≤ value ≤ 2000

                        Default: 400

                      • When true, and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.

                        Default: false

                      • When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.

                      • When true, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.

                        Default: false

                      • A comma-separated list of document IDs to find similar documents.

                        Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.

                      • A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.

                      • Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.

                      • When true and the natural_language_query parameter is used, the natural_languge_query parameter is spell checked. The most likely correction is returned in the suggested_query field of the response (if one exists).

                        Important: this parameter is only valid when using the Cloud Pak version of Discovery.

                        Default: false

                      • If true, queries are not stored in the Discovery Logs endpoint.

                        Default: false

                      parameters

                      • The ID of the environment.

                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                      • The ID of the collection.

                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                      • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                      • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. Use a query search when you want to find the most relevant search results.

                      • A natural language query that returns relevant documents by utilizing training data and natural language understanding.

                      • A passages query that returns the most relevant passages from the results.

                      • An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.

                      • Number of results to return.

                        Default: 10

                      • A comma-separated list of the portion of the document hierarchy to return.

                      • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results.

                      • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified. This parameter cannot be used in the same query as the bias parameter.

                      • When true, a highlight field is returned for each result which contains the fields which match the query with <em></em> tags around the matching query terms.

                        Default: false

                      • A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.

                      • The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The default is 10. The maximum is 100.

                        Possible values: value ≤ 100

                        Default: 10

                      • The approximate number of characters that any one passage will have.

                        Possible values: 50 ≤ value ≤ 2000

                        Default: 400

                      • When true, and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.

                        Default: false

                      • When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.

                      • When true, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.

                        Default: false

                      • A comma-separated list of document IDs to find similar documents.

                        Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.

                      • A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.

                      • Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.

                      • When true and the natural_language_query parameter is used, the natural_languge_query parameter is spell checked. The most likely correction is returned in the suggested_query field of the response (if one exists).

                        Important: this parameter is only valid when using the Cloud Pak version of Discovery.

                        Default: false

                      • If true, queries are not stored in the Discovery Logs endpoint.

                        Default: false

                      • curl -u "apikey":"{apikey}" -d '{"query": "relations.action.lemmatized:acquire"}' "{url}/v1/environments/{environment_id}/collections/{collection_id}/query?version=2019-04-30"
                      • IamAuthenticator authenticator = new IamAuthenticator(
                            apikey: "{apikey}"
                            );
                        
                        DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                        discovery.SetServiceUrl("{url}");
                        
                        var result = discovery.Query(
                            environmentId: "{environmentId}",
                            collectionId: "{collectionId}",
                            filter: "{filter}",
                            query: "{query}",
                            aggregation: "{aggregation}",
                            returnFields: "{return_fields}"
                            );
                        
                        Console.WriteLine(result.Response);
                      • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                        Discovery discovery = new Discovery("2019-04-30", authenticator);
                        discovery.setServiceUrl("{url}");
                        
                        String environmentId = "{environment_id}";
                        String collectionId = "{collection_id}";
                        
                        QueryOptions.Builder queryBuilder = new QueryOptions.Builder(environmentId, collectionId);
                        queryBuilder.query("{field}:{value}");
                        QueryResponse queryResponse = discovery.query(queryBuilder.build()).execute().getResult();
                      • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                        const { IamAuthenticator } = require('ibm-watson/auth');
                        
                        const discovery = new DiscoveryV1({
                          version: '2019-04-30',
                          authenticator: new IamAuthenticator({
                            apikey: '{apikey}',
                          }),
                          serviceUrl: '{url}',
                        });
                        
                        const queryParams = {
                          environmentId: '{environment_id}',
                          collectionId: '{collection_id}',
                        };
                        
                        discovery.query(queryParams)
                          .then(queryResponse => {
                            console.log(JSON.stringify(queryResponse, null, 2));
                          })
                          .catch(err => {
                            console.log('error:', err);
                          });

                        Response

                        A response containing the documents and aggregations for the query.

                        A response containing the documents and aggregations for the query.

                        Examples:
                        {
                          "matching_results": 24,
                          "session_token": "1232139230123123123",
                          "retrieval_details": {
                            "document_retrieval_strategy": "untrained"
                          },
                          "results": [
                            {
                              "id": "watson-generated ID",
                              "score": 1
                            }
                          ],
                          "aggregations": {
                            "term": {
                              "results": [
                                {
                                  "key": "active",
                                  "matching_results": 34
                                }
                              ]
                            }
                          }
                        }

                        A response containing the documents and aggregations for the query.

                        Examples:
                        {
                          "matching_results": 24,
                          "session_token": "1232139230123123123",
                          "retrieval_details": {
                            "document_retrieval_strategy": "untrained"
                          },
                          "results": [
                            {
                              "id": "watson-generated ID",
                              "score": 1
                            }
                          ],
                          "aggregations": {
                            "term": {
                              "results": [
                                {
                                  "key": "active",
                                  "matching_results": 34
                                }
                              ]
                            }
                          }
                        }

                        A response containing the documents and aggregations for the query.

                        Examples:
                        {
                          "matching_results": 24,
                          "session_token": "1232139230123123123",
                          "retrieval_details": {
                            "document_retrieval_strategy": "untrained"
                          },
                          "results": [
                            {
                              "id": "watson-generated ID",
                              "score": 1
                            }
                          ],
                          "aggregations": {
                            "term": {
                              "results": [
                                {
                                  "key": "active",
                                  "matching_results": 34
                                }
                              ]
                            }
                          }
                        }

                        A response containing the documents and aggregations for the query.

                        Examples:
                        {
                          "matching_results": 24,
                          "session_token": "1232139230123123123",
                          "retrieval_details": {
                            "document_retrieval_strategy": "untrained"
                          },
                          "results": [
                            {
                              "id": "watson-generated ID",
                              "score": 1
                            }
                          ],
                          "aggregations": {
                            "term": {
                              "results": [
                                {
                                  "key": "active",
                                  "matching_results": 34
                                }
                              ]
                            }
                          }
                        }

                        Status Code

                        • Query executed successfully.

                        • Bad request.

                        • query and natural_language_query can be used in the same request only if training is complete.

                        • Query timed out.

                        Example responses
                        • {
                            "matching_results": 24,
                            "session_token": "1232139230123123123",
                            "retrieval_details": {
                              "document_retrieval_strategy": "untrained"
                            },
                            "results": [
                              {
                                "id": "watson-generated ID",
                                "score": 1
                              }
                            ],
                            "aggregations": {
                              "term": {
                                "results": [
                                  {
                                    "key": "active",
                                    "matching_results": 34
                                  }
                                ]
                              }
                            }
                          }
                        • {
                            "matching_results": 24,
                            "session_token": "1232139230123123123",
                            "retrieval_details": {
                              "document_retrieval_strategy": "untrained"
                            },
                            "results": [
                              {
                                "id": "watson-generated ID",
                                "score": 1
                              }
                            ],
                            "aggregations": {
                              "term": {
                                "results": [
                                  {
                                    "key": "active",
                                    "matching_results": 34
                                  }
                                ]
                              }
                            }
                          }

                        Query system notices

                        Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.

                        Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.

                        Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.

                        Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.

                        Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.

                        GET /v1/environments/{environment_id}/collections/{collection_id}/notices
                        ServiceCall<QueryNoticesResponse> queryNotices(QueryNoticesOptions queryNoticesOptions)
                        queryNotices(params)
                        query_notices(
                                self,
                                environment_id: str,
                                collection_id: str,
                                *,
                                filter: str = None,
                                query: str = None,
                                natural_language_query: str = None,
                                passages: bool = None,
                                aggregation: str = None,
                                count: int = None,
                                return_: List[str] = None,
                                offset: int = None,
                                sort: List[str] = None,
                                highlight: bool = None,
                                passages_fields: List[str] = None,
                                passages_count: int = None,
                                passages_characters: int = None,
                                deduplicate_field: str = None,
                                similar: bool = None,
                                similar_document_ids: List[str] = None,
                                similar_fields: List[str] = None,
                                **kwargs,
                            ) -> DetailedResponse
                        QueryNotices(string environmentId, string collectionId, string filter = null, string query = null, string naturalLanguageQuery = null, bool? passages = null, string aggregation = null, long? count = null, List<string> _return = null, long? offset = null, List<string> sort = null, bool? highlight = null, List<string> passagesFields = null, long? passagesCount = null, long? passagesCharacters = null, string deduplicateField = null, bool? similar = null, List<string> similarDocumentIds = null, List<string> similarFields = null)

                        Request

                        Use the QueryNoticesOptions.Builder to create a QueryNoticesOptions object that contains the parameter values for the queryNotices method.

                        Path Parameters

                        • The ID of the environment.

                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                        • The ID of the collection.

                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                        Query Parameters

                        • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                        • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                        • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.

                        • A natural language query that returns relevant documents by utilizing training data and natural language understanding.

                        • A passages query that returns the most relevant passages from the results.

                        • An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.

                        • Number of results to return. The maximum for the count and offset values together in any one query is 10000

                          Default: 10

                        • A comma-separated list of the portion of the document hierarchy to return.

                        • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000

                        • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified.

                        • When true, a highlight field is returned for each result which contains the fields which match the query with <em></em> tags around the matching query terms.

                          Default: false

                        • A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.

                        • The maximum number of passages to return. The search returns fewer passages if the requested total is not found.

                          Possible values: value ≤ 100

                          Default: 10

                        • The approximate number of characters that any one passage will have.

                          Possible values: 50 ≤ value ≤ 2000

                          Default: 400

                        • When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.

                        • When true, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.

                          Default: false

                        • A comma-separated list of document IDs to find similar documents.

                          Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.

                        • A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.

                        The queryNotices options.

                        parameters

                        • The ID of the environment.

                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                        • The ID of the collection.

                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                        • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                        • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.

                        • A natural language query that returns relevant documents by utilizing training data and natural language understanding.

                        • A passages query that returns the most relevant passages from the results.

                        • An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.

                        • Number of results to return. The maximum for the count and offset values together in any one query is 10000.

                          Default: 10

                        • A comma-separated list of the portion of the document hierarchy to return.

                        • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.

                        • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified.

                        • When true, a highlight field is returned for each result which contains the fields which match the query with <em></em> tags around the matching query terms.

                          Default: false

                        • A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.

                        • The maximum number of passages to return. The search returns fewer passages if the requested total is not found.

                          Possible values: value ≤ 100

                          Default: 10

                        • The approximate number of characters that any one passage will have.

                          Possible values: 50 ≤ value ≤ 2000

                          Default: 400

                        • When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.

                        • When true, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.

                          Default: false

                        • A comma-separated list of document IDs to find similar documents.

                          Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.

                        • A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.

                        parameters

                        • The ID of the environment.

                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                        • The ID of the collection.

                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                        • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                        • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.

                        • A natural language query that returns relevant documents by utilizing training data and natural language understanding.

                        • A passages query that returns the most relevant passages from the results.

                        • An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.

                        • Number of results to return. The maximum for the count and offset values together in any one query is 10000.

                          Default: 10

                        • A comma-separated list of the portion of the document hierarchy to return.

                        • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.

                        • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified.

                        • When true, a highlight field is returned for each result which contains the fields which match the query with <em></em> tags around the matching query terms.

                          Default: false

                        • A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.

                        • The maximum number of passages to return. The search returns fewer passages if the requested total is not found.

                          Possible values: value ≤ 100

                          Default: 10

                        • The approximate number of characters that any one passage will have.

                          Possible values: 50 ≤ value ≤ 2000

                          Default: 400

                        • When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.

                        • When true, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.

                          Default: false

                        • A comma-separated list of document IDs to find similar documents.

                          Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.

                        • A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.

                        parameters

                        • The ID of the environment.

                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                        • The ID of the collection.

                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                        • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                        • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.

                        • A natural language query that returns relevant documents by utilizing training data and natural language understanding.

                        • A passages query that returns the most relevant passages from the results.

                        • An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.

                        • Number of results to return. The maximum for the count and offset values together in any one query is 10000.

                          Default: 10

                        • A comma-separated list of the portion of the document hierarchy to return.

                        • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.

                        • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified.

                        • When true, a highlight field is returned for each result which contains the fields which match the query with <em></em> tags around the matching query terms.

                          Default: false

                        • A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.

                        • The maximum number of passages to return. The search returns fewer passages if the requested total is not found.

                          Possible values: value ≤ 100

                          Default: 10

                        • The approximate number of characters that any one passage will have.

                          Possible values: 50 ≤ value ≤ 2000

                          Default: 400

                        • When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.

                        • When true, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.

                          Default: false

                        • A comma-separated list of document IDs to find similar documents.

                          Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.

                        • A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.

                        • curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/notices?collection_ids={id1},{id2}&version=2019-04-30&filter=entities.text:error"
                        • IamAuthenticator authenticator = new IamAuthenticator(
                              apikey: "{apikey}"
                              );
                          
                          DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                          discovery.SetServiceUrl("{url}");
                          
                          var result = discovery.QueryNotices(
                              environmentId: "{environmentId}",
                              collectionId: "{collectionId}",
                              query: "{query}"
                              );
                          
                          Console.WriteLine(result.Response);
                        • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                          Discovery discovery = new Discovery("2019-04-30", authenticator);
                          discovery.setServiceUrl("{url}");
                          
                          String environmentId = "{environment_id}";
                          String collectionId = "{collection_id}";
                          
                          QueryNoticesOptions queryOptions = new QueryNoticesOptions.Builder(environmentId, collectionId)
                            .query("{field}:{value}")
                            .build();
                          
                          QueryNoticesResponse response = discovery.queryNotices(queryOptions).execute().getResult();
                        • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                          const { IamAuthenticator } = require('ibm-watson/auth');
                          
                          const discovery = new DiscoveryV1({
                            version: '2019-04-30',
                            authenticator: new IamAuthenticator({
                              apikey: '{apikey}',
                            }),
                            serviceUrl: '{url}',
                          });
                          
                          const queryNoticesParams = {
                            environmentId: '{environment_id}',
                            collectionId: '{collection_id}',
                          };
                          
                          discovery.queryNotices(queryNoticesParams)
                            .then(queryNoticesResponse => {
                              console.log(JSON.stringify(queryNoticesResponse, null, 2));
                            })
                            .catch(err => {
                              console.log('error:', err);
                            });

                          Response

                          Object containing notice query results.

                          Object containing notice query results.

                          Examples:
                          {
                            "matching_results": 24,
                            "results": [
                              {
                                "id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                                "code": 200,
                                "score": 1,
                                "filename": "instructions.html",
                                "file_type": "html",
                                "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
                                "notices": [
                                  {
                                    "notice_id": "xpath_not_found",
                                    "created": "2016-09-20T17:26:17.000Z",
                                    "document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                    "severity": "warning",
                                    "step": "html-to-html",
                                    "description": "The xpath expression \"boom\" was not found."
                                  }
                                ]
                              }
                            ],
                            "aggregations": {
                              "term": {
                                "results": [
                                  {
                                    "key": "warning",
                                    "matching_results": 34
                                  }
                                ]
                              }
                            }
                          }

                          Object containing notice query results.

                          Examples:
                          {
                            "matching_results": 24,
                            "results": [
                              {
                                "id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                                "code": 200,
                                "score": 1,
                                "filename": "instructions.html",
                                "file_type": "html",
                                "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
                                "notices": [
                                  {
                                    "notice_id": "xpath_not_found",
                                    "created": "2016-09-20T17:26:17.000Z",
                                    "document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                    "severity": "warning",
                                    "step": "html-to-html",
                                    "description": "The xpath expression \"boom\" was not found."
                                  }
                                ]
                              }
                            ],
                            "aggregations": {
                              "term": {
                                "results": [
                                  {
                                    "key": "warning",
                                    "matching_results": 34
                                  }
                                ]
                              }
                            }
                          }

                          Object containing notice query results.

                          Examples:
                          {
                            "matching_results": 24,
                            "results": [
                              {
                                "id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                                "code": 200,
                                "score": 1,
                                "filename": "instructions.html",
                                "file_type": "html",
                                "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
                                "notices": [
                                  {
                                    "notice_id": "xpath_not_found",
                                    "created": "2016-09-20T17:26:17.000Z",
                                    "document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                    "severity": "warning",
                                    "step": "html-to-html",
                                    "description": "The xpath expression \"boom\" was not found."
                                  }
                                ]
                              }
                            ],
                            "aggregations": {
                              "term": {
                                "results": [
                                  {
                                    "key": "warning",
                                    "matching_results": 34
                                  }
                                ]
                              }
                            }
                          }

                          Object containing notice query results.

                          Examples:
                          {
                            "matching_results": 24,
                            "results": [
                              {
                                "id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                                "code": 200,
                                "score": 1,
                                "filename": "instructions.html",
                                "file_type": "html",
                                "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
                                "notices": [
                                  {
                                    "notice_id": "xpath_not_found",
                                    "created": "2016-09-20T17:26:17.000Z",
                                    "document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                    "severity": "warning",
                                    "step": "html-to-html",
                                    "description": "The xpath expression \"boom\" was not found."
                                  }
                                ]
                              }
                            ],
                            "aggregations": {
                              "term": {
                                "results": [
                                  {
                                    "key": "warning",
                                    "matching_results": 34
                                  }
                                ]
                              }
                            }
                          }

                          Status Code

                          • Query for notices executed successfully.

                          • Bad request.

                          Example responses
                          • {
                              "matching_results": 24,
                              "results": [
                                {
                                  "id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                  "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                                  "code": 200,
                                  "score": 1,
                                  "filename": "instructions.html",
                                  "file_type": "html",
                                  "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
                                  "notices": [
                                    {
                                      "notice_id": "xpath_not_found",
                                      "created": "2016-09-20T17:26:17.000Z",
                                      "document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                      "severity": "warning",
                                      "step": "html-to-html",
                                      "description": "The xpath expression \"boom\" was not found."
                                    }
                                  ]
                                }
                              ],
                              "aggregations": {
                                "term": {
                                  "results": [
                                    {
                                      "key": "warning",
                                      "matching_results": 34
                                    }
                                  ]
                                }
                              }
                            }
                          • {
                              "matching_results": 24,
                              "results": [
                                {
                                  "id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                  "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                                  "code": 200,
                                  "score": 1,
                                  "filename": "instructions.html",
                                  "file_type": "html",
                                  "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
                                  "notices": [
                                    {
                                      "notice_id": "xpath_not_found",
                                      "created": "2016-09-20T17:26:17.000Z",
                                      "document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                      "severity": "warning",
                                      "step": "html-to-html",
                                      "description": "The xpath expression \"boom\" was not found."
                                    }
                                  ]
                                }
                              ],
                              "aggregations": {
                                "term": {
                                  "results": [
                                    {
                                      "key": "warning",
                                      "matching_results": 34
                                    }
                                  ]
                                }
                              }
                            }

                          Query multiple collections (GET)

                          See the Discovery documentation for more details.

                          GET /v1/environments/{environment_id}/query

                          Request

                          Path Parameters

                          • The ID of the environment.

                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                          Query Parameters

                          • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                          • A comma-separated list of collection IDs to be queried against.

                          • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                          • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.

                          • A natural language query that returns relevant documents by utilizing training data and natural language understanding.

                          • An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.

                          • Number of results to return. The maximum for the count and offset values together in any one query is 10000

                            Default: 10

                          • A comma-separated list of the portion of the document hierarchy to return.

                          • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000

                          • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified.

                          • When true, a highlight field is returned for each result which contains the fields which match the query with <em></em> tags around the matching query terms.

                            Default: false

                          • When true and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.

                            Default: false

                          • When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.

                          • When true, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.

                            Default: false

                          • A comma-separated list of document IDs to find similar documents.

                            Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.

                          • A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.

                          • A passages query that returns the most relevant passages from the results.

                          • A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.

                          • The maximum number of passages to return. The search returns fewer passages if the requested total is not found.

                            Possible values: value ≤ 100

                            Default: 10

                          • The approximate number of characters that any one passage will have.

                            Possible values: 50 ≤ value ≤ 2000

                            Default: 400

                          • Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.

                          •     curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/query?collection_ids={id1},{id2}&version=2019-04-30&query=relations.action.lemmatized:acquire&count=15&filter=entities.text:IBM&return=text"

                                Response

                                A response containing the documents and aggregations for the query.

                                Status Code

                                • Query executed successfully.

                                • Bad request.

                                • query and natural_language_query can be used in the same request only if training is complete.

                                • Query timed out.

                                Example responses
                                • {
                                    "matching_results": 24,
                                    "session_token": "1232139230123123123",
                                    "retrieval_details": {
                                      "document_retrieval_strategy": "untrained"
                                    },
                                    "results": [
                                      {
                                        "id": "watson-generated ID",
                                        "score": 1
                                      }
                                    ],
                                    "aggregations": {
                                      "term": {
                                        "results": [
                                          {
                                            "key": "active",
                                            "matching_results": 34
                                          }
                                        ]
                                      }
                                    }
                                  }

                                Query multiple collections

                                By using this method, you can construct long queries that search multiple collection. For details, see the Discovery documentation.

                                By using this method, you can construct long queries that search multiple collection. For details, see the Discovery documentation.

                                By using this method, you can construct long queries that search multiple collection. For details, see the Discovery documentation.

                                By using this method, you can construct long queries that search multiple collection. For details, see the Discovery documentation.

                                By using this method, you can construct long queries that search multiple collection. For details, see the Discovery documentation.

                                POST /v1/environments/{environment_id}/query
                                ServiceCall<QueryResponse> federatedQuery(FederatedQueryOptions federatedQueryOptions)
                                federatedQuery(params)
                                federated_query(
                                        self,
                                        environment_id: str,
                                        collection_ids: str,
                                        *,
                                        filter: str = None,
                                        query: str = None,
                                        natural_language_query: str = None,
                                        passages: bool = None,
                                        aggregation: str = None,
                                        count: int = None,
                                        return_: str = None,
                                        offset: int = None,
                                        sort: str = None,
                                        highlight: bool = None,
                                        passages_fields: str = None,
                                        passages_count: int = None,
                                        passages_characters: int = None,
                                        deduplicate: bool = None,
                                        deduplicate_field: str = None,
                                        similar: bool = None,
                                        similar_document_ids: str = None,
                                        similar_fields: str = None,
                                        bias: str = None,
                                        x_watson_logging_opt_out: bool = None,
                                        **kwargs,
                                    ) -> DetailedResponse
                                FederatedQuery(string environmentId, string collectionIds, string filter = null, string query = null, string naturalLanguageQuery = null, bool? passages = null, string aggregation = null, long? count = null, string _return = null, long? offset = null, string sort = null, bool? highlight = null, string passagesFields = null, long? passagesCount = null, long? passagesCharacters = null, bool? deduplicate = null, string deduplicateField = null, bool? similar = null, string similarDocumentIds = null, string similarFields = null, string bias = null, bool? xWatsonLoggingOptOut = null)

                                Request

                                Use the FederatedQueryOptions.Builder to create a FederatedQueryOptions object that contains the parameter values for the federatedQuery method.

                                Custom Headers

                                • If true, queries are not stored in the Discovery Logs endpoint.

                                  Default: false

                                Path Parameters

                                • The ID of the environment.

                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                Query Parameters

                                • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                Object that describes a long query.

                                The federatedQuery options.

                                parameters

                                • The ID of the environment.

                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                • A comma-separated list of collection IDs to be queried against.

                                • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                                • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. Use a query search when you want to find the most relevant search results.

                                • A natural language query that returns relevant documents by utilizing training data and natural language understanding.

                                • A passages query that returns the most relevant passages from the results.

                                • An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.

                                • Number of results to return.

                                  Default: 10

                                • A comma-separated list of the portion of the document hierarchy to return.

                                • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results.

                                • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified. This parameter cannot be used in the same query as the bias parameter.

                                • When true, a highlight field is returned for each result which contains the fields which match the query with <em></em> tags around the matching query terms.

                                  Default: false

                                • A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.

                                • The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The default is 10. The maximum is 100.

                                  Possible values: value ≤ 100

                                  Default: 10

                                • The approximate number of characters that any one passage will have.

                                  Possible values: 50 ≤ value ≤ 2000

                                  Default: 400

                                • When true, and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.

                                  Default: false

                                • When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.

                                • When true, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.

                                  Default: false

                                • A comma-separated list of document IDs to find similar documents.

                                  Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.

                                • A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.

                                • Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.

                                • If true, queries are not stored in the Discovery Logs endpoint.

                                  Default: false

                                parameters

                                • The ID of the environment.

                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                • A comma-separated list of collection IDs to be queried against.

                                • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                                • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. Use a query search when you want to find the most relevant search results.

                                • A natural language query that returns relevant documents by utilizing training data and natural language understanding.

                                • A passages query that returns the most relevant passages from the results.

                                • An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.

                                • Number of results to return.

                                  Default: 10

                                • A comma-separated list of the portion of the document hierarchy to return.

                                • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results.

                                • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified. This parameter cannot be used in the same query as the bias parameter.

                                • When true, a highlight field is returned for each result which contains the fields which match the query with <em></em> tags around the matching query terms.

                                  Default: false

                                • A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.

                                • The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The default is 10. The maximum is 100.

                                  Possible values: value ≤ 100

                                  Default: 10

                                • The approximate number of characters that any one passage will have.

                                  Possible values: 50 ≤ value ≤ 2000

                                  Default: 400

                                • When true, and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.

                                  Default: false

                                • When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.

                                • When true, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.

                                  Default: false

                                • A comma-separated list of document IDs to find similar documents.

                                  Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.

                                • A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.

                                • Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.

                                • If true, queries are not stored in the Discovery Logs endpoint.

                                  Default: false

                                parameters

                                • The ID of the environment.

                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                • A comma-separated list of collection IDs to be queried against.

                                • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                                • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first. Use a query search when you want to find the most relevant search results.

                                • A natural language query that returns relevant documents by utilizing training data and natural language understanding.

                                • A passages query that returns the most relevant passages from the results.

                                • An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.

                                • Number of results to return.

                                  Default: 10

                                • A comma-separated list of the portion of the document hierarchy to return.

                                • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results.

                                • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified. This parameter cannot be used in the same query as the bias parameter.

                                • When true, a highlight field is returned for each result which contains the fields which match the query with <em></em> tags around the matching query terms.

                                  Default: false

                                • A comma-separated list of fields that passages are drawn from. If this parameter not specified, then all top-level fields are included.

                                • The maximum number of passages to return. The search returns fewer passages if the requested total is not found. The default is 10. The maximum is 100.

                                  Possible values: value ≤ 100

                                  Default: 10

                                • The approximate number of characters that any one passage will have.

                                  Possible values: 50 ≤ value ≤ 2000

                                  Default: 400

                                • When true, and used with a Watson Discovery News collection, duplicate results (based on the contents of the title field) are removed. Duplicate comparison is limited to the current query only; offset is not considered. This parameter is currently Beta functionality.

                                  Default: false

                                • When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.

                                • When true, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.

                                  Default: false

                                • A comma-separated list of document IDs to find similar documents.

                                  Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.

                                • A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.

                                • Field which the returned results will be biased against. The specified field must be either a date or number format. When a date type field is specified returned results are biased towards field values closer to the current date. When a number type field is specified, returned results are biased towards higher field values. This parameter cannot be used in the same query as the sort parameter.

                                • If true, queries are not stored in the Discovery Logs endpoint.

                                  Default: false

                                • curl -u "apikey":"{apikey}" -d '{"query": "relations.action.lemmatized:acquire"}' "{url}/v1/environments/{environment_id}/query?version=2019-04-30"
                                • IamAuthenticator authenticator = new IamAuthenticator(
                                      apikey: "{apikey}"
                                      );
                                  
                                  DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                  discovery.SetServiceUrl("{url}");
                                  
                                  var result = discovery.FederatedQuery(
                                      environmentId: "{environmentId}",
                                      naturalLanguageQuery: "{naturalLanguageQuery}",
                                      returnFields: "{returnFields}"
                                      );
                                  
                                  Console.WriteLine(result.Response);
                                • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                  Discovery discovery = new Discovery("2019-04-30", authenticator);
                                  discovery.setServiceUrl("{url}");
                                  
                                  String environmentId = "{environment_id}";
                                  
                                  FederatedQueryOptions.Builder options = new FederatedQueryOptions.Builder(environmentId)
                                    .query("{field}:{value}")
                                    .build();
                                  
                                  QueryResponse response = discovery.federatedQuery(options).execute().getResult();
                                • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                  const { IamAuthenticator } = require('ibm-watson/auth');
                                  
                                  const discovery = new DiscoveryV1({
                                    version: '2019-04-30',
                                    authenticator: new IamAuthenticator({
                                      apikey: '{apikey}',
                                    }),
                                    serviceUrl: '{url}',
                                  });
                                  
                                  const federatedQueryParams = {
                                    environmentId: '{environment_id}',
                                    collectionIds: '{comma separated collection ids}',
                                  };
                                  
                                  discovery.federatedQuery(federatedQueryParams)
                                    .then(queryResponse => {
                                      console.log(JSON.stringify(queryResponse, null, 2));
                                    })
                                    .catch(err => {
                                      console.log('error:', err);
                                    });

                                  Response

                                  A response containing the documents and aggregations for the query.

                                  A response containing the documents and aggregations for the query.

                                  Examples:
                                  {
                                    "matching_results": 24,
                                    "session_token": "1232139230123123123",
                                    "retrieval_details": {
                                      "document_retrieval_strategy": "untrained"
                                    },
                                    "results": [
                                      {
                                        "id": "watson-generated ID",
                                        "score": 1
                                      }
                                    ],
                                    "aggregations": {
                                      "term": {
                                        "results": [
                                          {
                                            "key": "active",
                                            "matching_results": 34
                                          }
                                        ]
                                      }
                                    }
                                  }

                                  A response containing the documents and aggregations for the query.

                                  Examples:
                                  {
                                    "matching_results": 24,
                                    "session_token": "1232139230123123123",
                                    "retrieval_details": {
                                      "document_retrieval_strategy": "untrained"
                                    },
                                    "results": [
                                      {
                                        "id": "watson-generated ID",
                                        "score": 1
                                      }
                                    ],
                                    "aggregations": {
                                      "term": {
                                        "results": [
                                          {
                                            "key": "active",
                                            "matching_results": 34
                                          }
                                        ]
                                      }
                                    }
                                  }

                                  A response containing the documents and aggregations for the query.

                                  Examples:
                                  {
                                    "matching_results": 24,
                                    "session_token": "1232139230123123123",
                                    "retrieval_details": {
                                      "document_retrieval_strategy": "untrained"
                                    },
                                    "results": [
                                      {
                                        "id": "watson-generated ID",
                                        "score": 1
                                      }
                                    ],
                                    "aggregations": {
                                      "term": {
                                        "results": [
                                          {
                                            "key": "active",
                                            "matching_results": 34
                                          }
                                        ]
                                      }
                                    }
                                  }

                                  A response containing the documents and aggregations for the query.

                                  Examples:
                                  {
                                    "matching_results": 24,
                                    "session_token": "1232139230123123123",
                                    "retrieval_details": {
                                      "document_retrieval_strategy": "untrained"
                                    },
                                    "results": [
                                      {
                                        "id": "watson-generated ID",
                                        "score": 1
                                      }
                                    ],
                                    "aggregations": {
                                      "term": {
                                        "results": [
                                          {
                                            "key": "active",
                                            "matching_results": 34
                                          }
                                        ]
                                      }
                                    }
                                  }

                                  Status Code

                                  • Query executed successfully.

                                  • Bad request.

                                  • query and natural_language_query can be used in the same request only if training is complete.

                                  • Query timed out.

                                  Example responses
                                  • {
                                      "matching_results": 24,
                                      "session_token": "1232139230123123123",
                                      "retrieval_details": {
                                        "document_retrieval_strategy": "untrained"
                                      },
                                      "results": [
                                        {
                                          "id": "watson-generated ID",
                                          "score": 1
                                        }
                                      ],
                                      "aggregations": {
                                        "term": {
                                          "results": [
                                            {
                                              "key": "active",
                                              "matching_results": 34
                                            }
                                          ]
                                        }
                                      }
                                    }
                                  • {
                                      "matching_results": 24,
                                      "session_token": "1232139230123123123",
                                      "retrieval_details": {
                                        "document_retrieval_strategy": "untrained"
                                      },
                                      "results": [
                                        {
                                          "id": "watson-generated ID",
                                          "score": 1
                                        }
                                      ],
                                      "aggregations": {
                                        "term": {
                                          "results": [
                                            {
                                              "key": "active",
                                              "matching_results": 34
                                            }
                                          ]
                                        }
                                      }
                                    }

                                  Query multiple collection system notices

                                  Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.

                                  Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.

                                  Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.

                                  Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.

                                  Queries for notices (errors or warnings) that might have been generated by the system. Notices are generated when ingesting documents and performing relevance training. See the Discovery documentation for more details on the query language.

                                  GET /v1/environments/{environment_id}/notices
                                  ServiceCall<QueryNoticesResponse> federatedQueryNotices(FederatedQueryNoticesOptions federatedQueryNoticesOptions)
                                  federatedQueryNotices(params)
                                  federated_query_notices(
                                          self,
                                          environment_id: str,
                                          collection_ids: List[str],
                                          *,
                                          filter: str = None,
                                          query: str = None,
                                          natural_language_query: str = None,
                                          aggregation: str = None,
                                          count: int = None,
                                          return_: List[str] = None,
                                          offset: int = None,
                                          sort: List[str] = None,
                                          highlight: bool = None,
                                          deduplicate_field: str = None,
                                          similar: bool = None,
                                          similar_document_ids: List[str] = None,
                                          similar_fields: List[str] = None,
                                          **kwargs,
                                      ) -> DetailedResponse
                                  FederatedQueryNotices(string environmentId, List<string> collectionIds, string filter = null, string query = null, string naturalLanguageQuery = null, string aggregation = null, long? count = null, List<string> _return = null, long? offset = null, List<string> sort = null, bool? highlight = null, string deduplicateField = null, bool? similar = null, List<string> similarDocumentIds = null, List<string> similarFields = null)

                                  Request

                                  Use the FederatedQueryNoticesOptions.Builder to create a FederatedQueryNoticesOptions object that contains the parameter values for the federatedQueryNotices method.

                                  Path Parameters

                                  • The ID of the environment.

                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                  Query Parameters

                                  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                  • A comma-separated list of collection IDs to be queried against.

                                  • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                                  • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.

                                  • A natural language query that returns relevant documents by utilizing training data and natural language understanding.

                                  • An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.

                                  • Number of results to return. The maximum for the count and offset values together in any one query is 10000

                                    Default: 10

                                  • A comma-separated list of the portion of the document hierarchy to return.

                                  • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000

                                  • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified.

                                  • When true, a highlight field is returned for each result which contains the fields which match the query with <em></em> tags around the matching query terms.

                                    Default: false

                                  • When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.

                                  • When true, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.

                                    Default: false

                                  • A comma-separated list of document IDs to find similar documents.

                                    Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.

                                  • A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.

                                  The federatedQueryNotices options.

                                  parameters

                                  • The ID of the environment.

                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                  • A comma-separated list of collection IDs to be queried against.

                                  • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                                  • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.

                                  • A natural language query that returns relevant documents by utilizing training data and natural language understanding.

                                  • An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.

                                  • Number of results to return. The maximum for the count and offset values together in any one query is 10000.

                                    Default: 10

                                  • A comma-separated list of the portion of the document hierarchy to return.

                                  • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.

                                  • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified.

                                  • When true, a highlight field is returned for each result which contains the fields which match the query with <em></em> tags around the matching query terms.

                                    Default: false

                                  • When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.

                                  • When true, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.

                                    Default: false

                                  • A comma-separated list of document IDs to find similar documents.

                                    Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.

                                  • A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.

                                  parameters

                                  • The ID of the environment.

                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                  • A comma-separated list of collection IDs to be queried against.

                                  • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                                  • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.

                                  • A natural language query that returns relevant documents by utilizing training data and natural language understanding.

                                  • An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.

                                  • Number of results to return. The maximum for the count and offset values together in any one query is 10000.

                                    Default: 10

                                  • A comma-separated list of the portion of the document hierarchy to return.

                                  • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.

                                  • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified.

                                  • When true, a highlight field is returned for each result which contains the fields which match the query with <em></em> tags around the matching query terms.

                                    Default: false

                                  • When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.

                                  • When true, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.

                                    Default: false

                                  • A comma-separated list of document IDs to find similar documents.

                                    Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.

                                  • A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.

                                  parameters

                                  • The ID of the environment.

                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                  • A comma-separated list of collection IDs to be queried against.

                                  • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                                  • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.

                                  • A natural language query that returns relevant documents by utilizing training data and natural language understanding.

                                  • An aggregation search that returns an exact answer by combining query search with filters. Useful for applications to build lists, tables, and time series. For a full list of possible aggregations, see the Query reference.

                                  • Number of results to return. The maximum for the count and offset values together in any one query is 10000.

                                    Default: 10

                                  • A comma-separated list of the portion of the document hierarchy to return.

                                  • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.

                                  • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified.

                                  • When true, a highlight field is returned for each result which contains the fields which match the query with <em></em> tags around the matching query terms.

                                    Default: false

                                  • When specified, duplicate results based on the field specified are removed from the returned results. Duplicate comparison is limited to the current query only, offset is not considered. This parameter is currently Beta functionality.

                                  • When true, results are returned based on their similarity to the document IDs specified in the similar.document_ids parameter.

                                    Default: false

                                  • A comma-separated list of document IDs to find similar documents.

                                    Tip: Include the natural_language_query parameter to expand the scope of the document similarity search with the natural language query. Other query parameters, such as filter and query, are subsequently applied and reduce the scope.

                                  • A comma-separated list of field names that are used as a basis for comparison to identify similar documents. If not specified, the entire document is used for comparison.

                                  • curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/notices?collection_ids={id1},{id2}&version=2019-04-30&filter=entities.text:error"
                                  • IamAuthenticator authenticator = new IamAuthenticator(
                                        apikey: "{apikey}"
                                        );
                                    
                                    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                    discovery.SetServiceUrl("{url}");
                                    
                                    var result = discovery.FederatedQueryNotices(
                                        environmentId: "{environmentId}",
                                        naturalLanguageQuery: "{naturalLanguageQuery}",
                                        collectionIds: new List<string> { "{collectionId}" }
                                        );
                                    
                                    Console.WriteLine(result.Response);
                                  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                    Discovery discovery = new Discovery("2019-04-30", authenticator);
                                    discovery.setServiceUrl("{url}");
                                    
                                    String environmentId = "{environment_id}";
                                    List<String> collectionIds = Arrays.asList("{collection_id_1}", "{collection_id_2}");
                                    
                                    FederatedQueryNoticesOptions.Builder options = new FederatedQueryNoticesOptions.Builder(environmentId, collectionIds)
                                      .query("{field}:{value}")
                                      .build();
                                    
                                    QueryNoticesResponse response = discovery.federatedQueryNotices(options).execute().getResult();
                                  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                    const { IamAuthenticator } = require('ibm-watson/auth');
                                    
                                    const discovery = new DiscoveryV1({
                                      version: '2019-04-30',
                                      authenticator: new IamAuthenticator({
                                        apikey: '{apikey}',
                                      }),
                                      serviceUrl: '{url}',
                                    });
                                    
                                    const federatedQueryNoticesParams = {
                                      environmentId: '{environment_id}',
                                      collectionIds: '{comma separated collection ids}',
                                    };
                                    
                                    discovery.federatedQueryNotices(federatedQueryNoticesParams)
                                      .then(queryNoticesResponse => {
                                        console.log(JSON.stringify(queryNoticesResponse, null, 2));
                                      })
                                      .catch(err => {
                                        console.log('error:', err);
                                      });

                                    Response

                                    Object containing notice query results.

                                    Object containing notice query results.

                                    Examples:
                                    {
                                      "matching_results": 24,
                                      "results": [
                                        {
                                          "id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                          "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                                          "code": 200,
                                          "score": 1,
                                          "filename": "instructions.html",
                                          "file_type": "html",
                                          "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
                                          "notices": [
                                            {
                                              "notice_id": "xpath_not_found",
                                              "created": "2016-09-20T17:26:17.000Z",
                                              "document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                              "severity": "warning",
                                              "step": "html-to-html",
                                              "description": "The xpath expression \"boom\" was not found."
                                            }
                                          ]
                                        }
                                      ],
                                      "aggregations": {
                                        "term": {
                                          "results": [
                                            {
                                              "key": "warning",
                                              "matching_results": 34
                                            }
                                          ]
                                        }
                                      }
                                    }

                                    Object containing notice query results.

                                    Examples:
                                    {
                                      "matching_results": 24,
                                      "results": [
                                        {
                                          "id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                          "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                                          "code": 200,
                                          "score": 1,
                                          "filename": "instructions.html",
                                          "file_type": "html",
                                          "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
                                          "notices": [
                                            {
                                              "notice_id": "xpath_not_found",
                                              "created": "2016-09-20T17:26:17.000Z",
                                              "document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                              "severity": "warning",
                                              "step": "html-to-html",
                                              "description": "The xpath expression \"boom\" was not found."
                                            }
                                          ]
                                        }
                                      ],
                                      "aggregations": {
                                        "term": {
                                          "results": [
                                            {
                                              "key": "warning",
                                              "matching_results": 34
                                            }
                                          ]
                                        }
                                      }
                                    }

                                    Object containing notice query results.

                                    Examples:
                                    {
                                      "matching_results": 24,
                                      "results": [
                                        {
                                          "id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                          "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                                          "code": 200,
                                          "score": 1,
                                          "filename": "instructions.html",
                                          "file_type": "html",
                                          "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
                                          "notices": [
                                            {
                                              "notice_id": "xpath_not_found",
                                              "created": "2016-09-20T17:26:17.000Z",
                                              "document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                              "severity": "warning",
                                              "step": "html-to-html",
                                              "description": "The xpath expression \"boom\" was not found."
                                            }
                                          ]
                                        }
                                      ],
                                      "aggregations": {
                                        "term": {
                                          "results": [
                                            {
                                              "key": "warning",
                                              "matching_results": 34
                                            }
                                          ]
                                        }
                                      }
                                    }

                                    Object containing notice query results.

                                    Examples:
                                    {
                                      "matching_results": 24,
                                      "results": [
                                        {
                                          "id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                          "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                                          "code": 200,
                                          "score": 1,
                                          "filename": "instructions.html",
                                          "file_type": "html",
                                          "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
                                          "notices": [
                                            {
                                              "notice_id": "xpath_not_found",
                                              "created": "2016-09-20T17:26:17.000Z",
                                              "document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                              "severity": "warning",
                                              "step": "html-to-html",
                                              "description": "The xpath expression \"boom\" was not found."
                                            }
                                          ]
                                        }
                                      ],
                                      "aggregations": {
                                        "term": {
                                          "results": [
                                            {
                                              "key": "warning",
                                              "matching_results": 34
                                            }
                                          ]
                                        }
                                      }
                                    }

                                    Status Code

                                    • Query for notices executed successfully.

                                    • Bad request.

                                    Example responses
                                    • {
                                        "matching_results": 24,
                                        "results": [
                                          {
                                            "id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                            "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                                            "code": 200,
                                            "score": 1,
                                            "filename": "instructions.html",
                                            "file_type": "html",
                                            "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
                                            "notices": [
                                              {
                                                "notice_id": "xpath_not_found",
                                                "created": "2016-09-20T17:26:17.000Z",
                                                "document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                                "severity": "warning",
                                                "step": "html-to-html",
                                                "description": "The xpath expression \"boom\" was not found."
                                              }
                                            ]
                                          }
                                        ],
                                        "aggregations": {
                                          "term": {
                                            "results": [
                                              {
                                                "key": "warning",
                                                "matching_results": 34
                                              }
                                            ]
                                          }
                                        }
                                      }
                                    • {
                                        "matching_results": 24,
                                        "results": [
                                          {
                                            "id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                            "collection_id": "f1360220-ea2d-4271-9d62-89a910b13c37",
                                            "code": 200,
                                            "score": 1,
                                            "filename": "instructions.html",
                                            "file_type": "html",
                                            "sha1": "de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3",
                                            "notices": [
                                              {
                                                "notice_id": "xpath_not_found",
                                                "created": "2016-09-20T17:26:17.000Z",
                                                "document_id": "030ba125-29db-43f2-8552-f941ae30a7a8",
                                                "severity": "warning",
                                                "step": "html-to-html",
                                                "description": "The xpath expression \"boom\" was not found."
                                              }
                                            ]
                                          }
                                        ],
                                        "aggregations": {
                                          "term": {
                                            "results": [
                                              {
                                                "key": "warning",
                                                "matching_results": 34
                                              }
                                            ]
                                          }
                                        }
                                      }

                                    Get Autocomplete Suggestions

                                    Returns completion query suggestions for the specified prefix. /n/n Important: this method is only valid when using the Cloud Pak version of Discovery.

                                    Returns completion query suggestions for the specified prefix. /n/n Important: this method is only valid when using the Cloud Pak version of Discovery.

                                    Returns completion query suggestions for the specified prefix. /n/n Important: this method is only valid when using the Cloud Pak version of Discovery.

                                    Returns completion query suggestions for the specified prefix. /n/n Important: this method is only valid when using the Cloud Pak version of Discovery.

                                    Returns completion query suggestions for the specified prefix. /n/n Important: this method is only valid when using the Cloud Pak version of Discovery.

                                    GET /v1/environments/{environment_id}/collections/{collection_id}/autocompletion
                                    ServiceCall<Completions> getAutocompletion(GetAutocompletionOptions getAutocompletionOptions)
                                    getAutocompletion(params)
                                    get_autocompletion(
                                            self,
                                            environment_id: str,
                                            collection_id: str,
                                            prefix: str,
                                            *,
                                            field: str = None,
                                            count: int = None,
                                            **kwargs,
                                        ) -> DetailedResponse
                                    GetAutocompletion(string environmentId, string collectionId, string prefix, string field = null, long? count = null)

                                    Request

                                    Use the GetAutocompletionOptions.Builder to create a GetAutocompletionOptions object that contains the parameter values for the getAutocompletion method.

                                    Path Parameters

                                    • The ID of the environment.

                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                    • The ID of the collection.

                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                    Query Parameters

                                    • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                    • The prefix to use for autocompletion. For example, the prefix Ho could autocomplete to hot, housing, or how.

                                    • The field in the result documents that autocompletion suggestions are identified from.

                                    • The number of autocompletion suggestions to return.

                                      Default: 5

                                    The getAutocompletion options.

                                    parameters

                                    • The ID of the environment.

                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                    • The ID of the collection.

                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                    • The prefix to use for autocompletion. For example, the prefix Ho could autocomplete to hot, housing, or how.

                                    • The field in the result documents that autocompletion suggestions are identified from.

                                    • The number of autocompletion suggestions to return.

                                      Default: 5

                                    parameters

                                    • The ID of the environment.

                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                    • The ID of the collection.

                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                    • The prefix to use for autocompletion. For example, the prefix Ho could autocomplete to hot, housing, or how.

                                    • The field in the result documents that autocompletion suggestions are identified from.

                                    • The number of autocompletion suggestions to return.

                                      Default: 5

                                    parameters

                                    • The ID of the environment.

                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                    • The ID of the collection.

                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                    • The prefix to use for autocompletion. For example, the prefix Ho could autocomplete to hot, housing, or how.

                                    • The field in the result documents that autocompletion suggestions are identified from.

                                    • The number of autocompletion suggestions to return.

                                      Default: 5

                                    • curl -X GET -H "Authorization: Bearer {auth-token}" "https://{icp4d_cluster_host}{:port}/discovery/{release}/instances/{instance_id}/api/v1/environments/{environment_id}/collections/{collection_id}/autocompletion?field=text&prefix=Ho&version=2019-07-28"

                                    Response

                                    An object containing an array of autocompletion suggestions.

                                    An object containing an array of autocompletion suggestions.

                                    An object containing an array of autocompletion suggestions.

                                    An object containing an array of autocompletion suggestions.

                                    An object containing an array of autocompletion suggestions.

                                    Status Code

                                    • Object containing array of possible completions.

                                    • The specified field does not exist.

                                    No Sample Response

                                    This method does not specify any sample responses.

                                    List training data

                                    Lists the training data for the specified collection.

                                    Lists the training data for the specified collection.

                                    Lists the training data for the specified collection.

                                    Lists the training data for the specified collection.

                                    Lists the training data for the specified collection.

                                    GET /v1/environments/{environment_id}/collections/{collection_id}/training_data
                                    ServiceCall<TrainingDataSet> listTrainingData(ListTrainingDataOptions listTrainingDataOptions)
                                    listTrainingData(params)
                                    list_training_data(
                                            self,
                                            environment_id: str,
                                            collection_id: str,
                                            **kwargs,
                                        ) -> DetailedResponse
                                    ListTrainingData(string environmentId, string collectionId)

                                    Request

                                    Use the ListTrainingDataOptions.Builder to create a ListTrainingDataOptions object that contains the parameter values for the listTrainingData method.

                                    Path Parameters

                                    • The ID of the environment.

                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                    • The ID of the collection.

                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                    Query Parameters

                                    • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                    The listTrainingData options.

                                    parameters

                                    • The ID of the environment.

                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                    • The ID of the collection.

                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                    parameters

                                    • The ID of the environment.

                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                    • The ID of the collection.

                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                    parameters

                                    • The ID of the environment.

                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                    • The ID of the collection.

                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                    • curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/training_data?version=2019-04-30"
                                    • IamAuthenticator authenticator = new IamAuthenticator(
                                          apikey: "{apikey}"
                                          );
                                      
                                      DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                      discovery.SetServiceUrl("{url}");
                                      
                                      var result = discovery.ListTrainingData(
                                          environmentId: "{environmentId}",
                                          collectionId: "{collectionId}"
                                          );
                                      
                                      Console.WriteLine(result.Response);
                                    • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                      Discovery discovery = new Discovery("2019-04-30", authenticator);
                                      discovery.setServiceUrl("{url}");
                                      
                                      String environmentId = "{environment_id}";
                                      String collectionId = "{collection_id}";
                                      
                                      ListTrainingDataOptions options = new ListTrainingDataOptions.Builder(environmentId, collectionId).build();
                                      
                                      TrainingDataSet response = discovery.listTrainingData(options).execute().getResult();
                                    • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                      const { IamAuthenticator } = require('ibm-watson/auth');
                                      
                                      const discovery = new DiscoveryV1({
                                        version: '2019-04-30',
                                        authenticator: new IamAuthenticator({
                                          apikey: '{apikey}',
                                        }),
                                        serviceUrl: '{url}',
                                      });
                                      
                                      const listTrainingDataParams = {
                                        environmentId: '{environment_id}',
                                        collectionId: '{collection_id}',
                                      };
                                      
                                      discovery.listTrainingData(listTrainingDataParams)
                                        .then(trainingDataSet => {
                                          console.log(JSON.stringify(trainingDataSet, null, 2));
                                        })
                                        .catch(err => {
                                          console.log('error:', err);
                                        });

                                      Response

                                      Training information for a specific collection.

                                      Training information for a specific collection.

                                      Training information for a specific collection.

                                      Training information for a specific collection.

                                      Training information for a specific collection.

                                      Status Code

                                      • Training data for this collection found and returned.

                                      No Sample Response

                                      This method does not specify any sample responses.

                                      Add query to training data

                                      Adds a query to the training data for this collection. The query can contain a filter and natural language query.

                                      Adds a query to the training data for this collection. The query can contain a filter and natural language query.

                                      Adds a query to the training data for this collection. The query can contain a filter and natural language query.

                                      Adds a query to the training data for this collection. The query can contain a filter and natural language query.

                                      Adds a query to the training data for this collection. The query can contain a filter and natural language query.

                                      POST /v1/environments/{environment_id}/collections/{collection_id}/training_data
                                      ServiceCall<TrainingQuery> addTrainingData(AddTrainingDataOptions addTrainingDataOptions)
                                      addTrainingData(params)
                                      add_training_data(
                                              self,
                                              environment_id: str,
                                              collection_id: str,
                                              *,
                                              natural_language_query: str = None,
                                              filter: str = None,
                                              examples: List['TrainingExample'] = None,
                                              **kwargs,
                                          ) -> DetailedResponse
                                      AddTrainingData(string environmentId, string collectionId, string naturalLanguageQuery = null, string filter = null, List<TrainingExample> examples = null)

                                      Request

                                      Use the AddTrainingDataOptions.Builder to create a AddTrainingDataOptions object that contains the parameter values for the addTrainingData method.

                                      Path Parameters

                                      • The ID of the environment.

                                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                      • The ID of the collection.

                                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                      Query Parameters

                                      • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                      The body of the training data query that is to be added to the collection's training data.

                                      Examples:
                                      {
                                        "natural_language_query": "why is the sky blue",
                                        "filter": "text:meteorology",
                                        "examples": [
                                          {
                                            "document_id": "54f95ac0-3e4f-4756-bea6-7a67b2713c81",
                                            "relevance": 1
                                          },
                                          {
                                            "document_id": "01bcca32-7300-4c9f-8d32-33ed7ea643da",
                                            "cross_reference": "my_id_field:1463",
                                            "relevance": 5
                                          }
                                        ]
                                      }

                                      The addTrainingData options.

                                      parameters

                                      • The ID of the environment.

                                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                      • The ID of the collection.

                                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                      • The natural text query for the new training query.

                                      • The filter used on the collection before the natural_language_query is applied.

                                      • Array of training examples.

                                      parameters

                                      • The ID of the environment.

                                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                      • The ID of the collection.

                                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                      • The natural text query for the new training query.

                                      • The filter used on the collection before the natural_language_query is applied.

                                      • Array of training examples.

                                      parameters

                                      • The ID of the environment.

                                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                      • The ID of the collection.

                                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                      • The natural text query for the new training query.

                                      • The filter used on the collection before the natural_language_query is applied.

                                      • Array of training examples.

                                      • curl -X POST -u "apikey":"{apikey}" -H "Content-Type: application/json" -d
                                        '{
                                          "natural_language_query": "who is keyser soze",
                                          "filter": "text:criminology",
                                          "examples": [
                                            {
                                              "document_id": "adaf50f1-2526-4fad-b670-7d6e8a42e6e6",
                                              "relevance": 2
                                            },
                                            {
                                              "document_id": "63919442-7d5b-4cae-ab7e-56f58b1390fe",
                                              "cross_reference": "my_id_field:14",
                                              "relevance": 4
                                            }
                                          ]
                                        }' "{url}/v1/environments/{environment_id}/collections/{collection_id}/training_data?version=2019-04-30"
                                      • IamAuthenticator authenticator = new IamAuthenticator(
                                            apikey: "{apikey}"
                                            );
                                        
                                        DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                        discovery.SetServiceUrl("{url}");
                                        
                                        var examples = new List<TrainingExample>()
                                        {
                                            new TrainingExample()
                                            {
                                                DocumentId = "{documentId}",
                                                CrossReference = "{crossReference}"
                                            }
                                        };
                                        
                                        var result = discovery.AddTrainingData(
                                            environmentId: "{environmentId}",
                                            collectionId: "{collectionId}",
                                            naturalLanguageQuery: "{naturalLanguageQuery}",
                                            filter: "{filter}",
                                            examples: examples
                                            );
                                        queryId = result.Result.QueryId;
                                        
                                        Console.WriteLine(result.Response);
                                      • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                        Discovery discovery = new Discovery("2019-04-30", authenticator);
                                        discovery.setServiceUrl("{url}");
                                        
                                        String environmentId = "{environment_id}";
                                        String collectionId = "{collection_id}";
                                        String naturalLanguageQuery = "who is keyser soze";
                                        String filter = "text:criminology";
                                        
                                        AddTrainingDataOptions options = new AddTrainingDataOptions.Builder(environmentId, collectionId)
                                          .naturalLanguageQuery(naturalLanguageQuery)
                                          .filter(filter)
                                          .build();
                                        
                                        TrainingQuery response = discovery.addTrainingData(options).execute().getResult();
                                      • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                        const { IamAuthenticator } = require('ibm-watson/auth');
                                        
                                        const discovery = new DiscoveryV1({
                                          version: '2019-04-30',
                                          authenticator: new IamAuthenticator({
                                            apikey: '{apikey}',
                                          }),
                                          serviceUrl: '{url}',
                                        });
                                        
                                        const addTrainingDataParams = {
                                          environmentId: '{environment_id}',
                                          collectionId: '{collection_id}',
                                          naturalLanguageQuery: 'watson',
                                        };
                                        
                                        discovery.addTrainingData(addTrainingDataParams)
                                          .then(trainingQuery => {
                                            console.log(JSON.stringify(trainingQuery, null, 2));
                                          })
                                          .catch(err => {
                                            console.log('error:', err);
                                          });

                                        Response

                                        Training query details.

                                        Training query details.

                                        Training query details.

                                        Training query details.

                                        Training query details.

                                        Status Code

                                        • The query was successfully added.

                                        • Bad request.

                                        No Sample Response

                                        This method does not specify any sample responses.

                                        Delete all training data

                                        Deletes all training data from a collection.

                                        Deletes all training data from a collection.

                                        Deletes all training data from a collection.

                                        Deletes all training data from a collection.

                                        Deletes all training data from a collection.

                                        DELETE /v1/environments/{environment_id}/collections/{collection_id}/training_data
                                        ServiceCall<Void> deleteAllTrainingData(DeleteAllTrainingDataOptions deleteAllTrainingDataOptions)
                                        deleteAllTrainingData(params)
                                        delete_all_training_data(
                                                self,
                                                environment_id: str,
                                                collection_id: str,
                                                **kwargs,
                                            ) -> DetailedResponse
                                        DeleteAllTrainingData(string environmentId, string collectionId)

                                        Request

                                        Use the DeleteAllTrainingDataOptions.Builder to create a DeleteAllTrainingDataOptions object that contains the parameter values for the deleteAllTrainingData method.

                                        Path Parameters

                                        • The ID of the environment.

                                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                        • The ID of the collection.

                                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                        Query Parameters

                                        • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                        The deleteAllTrainingData options.

                                        parameters

                                        • The ID of the environment.

                                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                        • The ID of the collection.

                                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                        parameters

                                        • The ID of the environment.

                                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                        • The ID of the collection.

                                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                        parameters

                                        • The ID of the environment.

                                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                        • The ID of the collection.

                                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                        • curl -X DELETE -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/training_data?version=2019-04-30"
                                        • IamAuthenticator authenticator = new IamAuthenticator(
                                              apikey: "{apikey}"
                                              );
                                          
                                          DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                          discovery.SetServiceUrl("{url}");
                                          
                                          var result = discovery.DeleteAllTrainingData(
                                              environmentId: "{environmentId}",
                                              collectionId: "{collectionId}"
                                              );
                                          
                                          Console.WriteLine(result.Response);
                                        • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                          Discovery discovery = new Discovery("2019-04-30", authenticator);
                                          discovery.setServiceUrl("{url}");
                                          
                                          String environmentId = "{environment_id}";
                                          String collectionId = "{collection_id}";
                                          
                                          DeleteAllTrainingDataOptions options = new DeleteAllTrainingDataOptions.Builder(environmentId, collectionId).build();
                                          
                                          discovery.deleteAllTrainingData(options).execute();
                                        • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                          const { IamAuthenticator } = require('ibm-watson/auth');
                                          
                                          const discovery = new DiscoveryV1({
                                            version: '2019-04-30',
                                            authenticator: new IamAuthenticator({
                                              apikey: '{apikey}',
                                            }),
                                            serviceUrl: '{url}',
                                          });
                                          
                                          const deleteAllTrainingDataParams = {
                                            environmentId: '{environment_id}',
                                            collectionId: '{collection_id}',
                                          };
                                          
                                          discovery.deleteAllTrainingData(deleteAllTrainingDataParams)
                                            .then(result => {
                                              console.log(JSON.stringify(result, null, 2));
                                            })
                                            .catch(err => {
                                              console.log('error:', err);
                                            });

                                          Response

                                          Response type: object

                                          Status Code

                                          • All training data removed.

                                          • Bad request.

                                          No Sample Response

                                          This method does not specify any sample responses.

                                          Get details about a query

                                          Gets details for a specific training data query, including the query string and all examples.

                                          Gets details for a specific training data query, including the query string and all examples.

                                          Gets details for a specific training data query, including the query string and all examples.

                                          Gets details for a specific training data query, including the query string and all examples.

                                          Gets details for a specific training data query, including the query string and all examples.

                                          GET /v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}
                                          ServiceCall<TrainingQuery> getTrainingData(GetTrainingDataOptions getTrainingDataOptions)
                                          getTrainingData(params)
                                          get_training_data(
                                                  self,
                                                  environment_id: str,
                                                  collection_id: str,
                                                  query_id: str,
                                                  **kwargs,
                                              ) -> DetailedResponse
                                          GetTrainingData(string environmentId, string collectionId, string queryId)

                                          Request

                                          Use the GetTrainingDataOptions.Builder to create a GetTrainingDataOptions object that contains the parameter values for the getTrainingData method.

                                          Path Parameters

                                          • The ID of the environment.

                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                          • The ID of the collection.

                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                          • The ID of the query used for training.

                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                          Query Parameters

                                          • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                          The getTrainingData options.

                                          parameters

                                          • The ID of the environment.

                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                          • The ID of the collection.

                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                          • The ID of the query used for training.

                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                          parameters

                                          • The ID of the environment.

                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                          • The ID of the collection.

                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                          • The ID of the query used for training.

                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                          parameters

                                          • The ID of the environment.

                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                          • The ID of the collection.

                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                          • The ID of the query used for training.

                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                          • curl -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}?version=2019-04-30"
                                          • IamAuthenticator authenticator = new IamAuthenticator(
                                                apikey: "{apikey}"
                                                );
                                            
                                            DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                            discovery.SetServiceUrl("{url}");
                                            
                                            var result = discovery.GetTrainingData(
                                                environmentId: "{environmentId}",
                                                collectionId: "{collectionId}",
                                                queryId: "{queryId}"
                                                );
                                            
                                            Console.WriteLine(result.Response);
                                          • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                            Discovery discovery = new Discovery("2019-04-30", authenticator);
                                            discovery.setServiceUrl("{url}");
                                            
                                            String environmentId = "{environment_id}";
                                            String collectionId = "{collection_id}";
                                            String queryId = "{query_id}";
                                            
                                            GetTrainingDataOptions options = new GetTrainingDataOptions.Builder(environmentId, collectionId, queryId).build();
                                            
                                            TrainingQuery response = discovery.getTrainingData(options).execute().getResult();
                                          • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                            const { IamAuthenticator } = require('ibm-watson/auth');
                                            
                                            const discovery = new DiscoveryV1({
                                              version: '2019-04-30',
                                              authenticator: new IamAuthenticator({
                                                apikey: '{apikey}',
                                              }),
                                              serviceUrl: '{url}',
                                            });
                                            
                                            const getTrainingDataParams = {
                                              environmentId: '{environment_id}',
                                              collectionId: '{collection_id}',
                                              queryId: '{query_id}',
                                            };
                                            
                                            discovery.getTrainingData(getTrainingDataParams)
                                              .then(trainingQuery => {
                                                console.log(JSON.stringify(trainingQuery, null, 2));
                                              })
                                              .catch(err => {
                                                console.log('error:', err);
                                              });

                                            Response

                                            Training query details.

                                            Training query details.

                                            Training query details.

                                            Training query details.

                                            Training query details.

                                            Status Code

                                            • Details for this training query found and returned.

                                            • The query does not exist.

                                            No Sample Response

                                            This method does not specify any sample responses.

                                            Delete a training data query

                                            Removes the training data query and all associated examples from the training data set.

                                            Removes the training data query and all associated examples from the training data set.

                                            Removes the training data query and all associated examples from the training data set.

                                            Removes the training data query and all associated examples from the training data set.

                                            Removes the training data query and all associated examples from the training data set.

                                            DELETE /v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}
                                            ServiceCall<Void> deleteTrainingData(DeleteTrainingDataOptions deleteTrainingDataOptions)
                                            deleteTrainingData(params)
                                            delete_training_data(
                                                    self,
                                                    environment_id: str,
                                                    collection_id: str,
                                                    query_id: str,
                                                    **kwargs,
                                                ) -> DetailedResponse
                                            DeleteTrainingData(string environmentId, string collectionId, string queryId)

                                            Request

                                            Use the DeleteTrainingDataOptions.Builder to create a DeleteTrainingDataOptions object that contains the parameter values for the deleteTrainingData method.

                                            Path Parameters

                                            • The ID of the environment.

                                              Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                            • The ID of the collection.

                                              Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                            • The ID of the query used for training.

                                              Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                            Query Parameters

                                            • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                            The deleteTrainingData options.

                                            parameters

                                            • The ID of the environment.

                                              Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                            • The ID of the collection.

                                              Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                            • The ID of the query used for training.

                                              Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                            parameters

                                            • The ID of the environment.

                                              Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                            • The ID of the collection.

                                              Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                            • The ID of the query used for training.

                                              Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                            parameters

                                            • The ID of the environment.

                                              Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                            • The ID of the collection.

                                              Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                            • The ID of the query used for training.

                                              Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                            • curl -X DELETE -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}?version=2019-04-30"
                                            • IamAuthenticator authenticator = new IamAuthenticator(
                                                  apikey: "{apikey}"
                                                  );
                                              
                                              DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                              discovery.SetServiceUrl("{url}");
                                              
                                              var result = discovery.DeleteTrainingData(
                                                  environmentId: "{environmentId}",
                                                  collectionId: "{collectionId}",
                                                  queryId: "{queryId}"
                                                  );
                                              
                                              Console.WriteLine(result.Response);
                                            • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                              Discovery discovery = new Discovery("2019-04-30", authenticator);
                                              discovery.setServiceUrl("{url}");
                                              
                                              String environmentId = "{environment_id}";
                                              String collectionId = "{collection_id}";
                                              String queryId = "{query_id}";
                                              
                                              DeleteTrainingDataOptions options = new DeleteTrainingDataOptions.Builder(environmentId, collectionId, queryId).build();
                                              
                                              discovery.deleteTrainingData(options).execute();
                                            • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                              const { IamAuthenticator } = require('ibm-watson/auth');
                                              
                                              const discovery = new DiscoveryV1({
                                                version: '2019-04-30',
                                                authenticator: new IamAuthenticator({
                                                  apikey: '{apikey}',
                                                }),
                                                serviceUrl: '{url}',
                                              });
                                              
                                              const deleteTrainingDataParams = {
                                                environmentId: '{environment_id}',
                                                collectionId: '{collection_id}',
                                                queryId: '{query_id}',
                                              };
                                              
                                              discovery.deleteTrainingData(deleteTrainingDataParams)
                                                .then(result => {
                                                  console.log(JSON.stringify(result, null, 2));
                                                })
                                                .catch(err => {
                                                  console.log('error:', err);
                                                });

                                              Response

                                              Response type: object

                                              Status Code

                                              • Query and all example document references successfully removed from the training set for this collection.

                                              • Bad request.

                                              No Sample Response

                                              This method does not specify any sample responses.

                                              List examples for a training data query

                                              List all examples for this training data query.

                                              List all examples for this training data query.

                                              List all examples for this training data query.

                                              List all examples for this training data query.

                                              List all examples for this training data query.

                                              GET /v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples
                                              ServiceCall<TrainingExampleList> listTrainingExamples(ListTrainingExamplesOptions listTrainingExamplesOptions)
                                              listTrainingExamples(params)
                                              list_training_examples(
                                                      self,
                                                      environment_id: str,
                                                      collection_id: str,
                                                      query_id: str,
                                                      **kwargs,
                                                  ) -> DetailedResponse
                                              ListTrainingExamples(string environmentId, string collectionId, string queryId)

                                              Request

                                              Use the ListTrainingExamplesOptions.Builder to create a ListTrainingExamplesOptions object that contains the parameter values for the listTrainingExamples method.

                                              Path Parameters

                                              • The ID of the environment.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                              • The ID of the collection.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                              • The ID of the query used for training.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                              Query Parameters

                                              • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                              The listTrainingExamples options.

                                              parameters

                                              • The ID of the environment.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                              • The ID of the collection.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                              • The ID of the query used for training.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                              parameters

                                              • The ID of the environment.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                              • The ID of the collection.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                              • The ID of the query used for training.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                              parameters

                                              • The ID of the environment.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                              • The ID of the collection.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                              • The ID of the query used for training.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                              • IamAuthenticator authenticator = new IamAuthenticator(
                                                    apikey: "{apikey}"
                                                    );
                                                
                                                DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                discovery.SetServiceUrl("{url}");
                                                
                                                var result = discovery.ListTrainingExamples(
                                                    environmentId: "{environmentId}",
                                                    collectionId: "{collectionId}",
                                                    queryId: "{queryId}"
                                                    );
                                                
                                                Console.WriteLine(result.Response);
                                              • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                discovery.setServiceUrl("{url}");
                                                
                                                String environmentId = "{environment_id}";
                                                String collectionId = "{collection_id}";
                                                String queryId = "{query_id}";
                                                
                                                ListTrainingExamplesOptions options = new ListTrainingExamplesOptions.Builder(environmentId, collectionId, queryId).build();
                                                
                                                TrainingExampleList response = discovery.listTrainingExamples(options).execute().getResult();
                                              • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                const { IamAuthenticator } = require('ibm-watson/auth');
                                                
                                                const discovery = new DiscoveryV1({
                                                  version: '2019-04-30',
                                                  authenticator: new IamAuthenticator({
                                                    apikey: '{apikey}',
                                                  }),
                                                  serviceUrl: '{url}',
                                                });
                                                
                                                const listTrainingExamplesParams = {
                                                  environmentId: '{environment_id}',
                                                  collectionId: '{collection_id}',
                                                  queryId: '{query_id}',
                                                };
                                                
                                                discovery.listTrainingExamples(listTrainingExamplesParams)
                                                  .then(trainingExampleList => {
                                                    console.log(JSON.stringify(trainingExampleList, null, 2));
                                                  })
                                                  .catch(err => {
                                                    console.log('error:', err);
                                                  });

                                              Response

                                              Object containing an array of training examples.

                                              Object containing an array of training examples.

                                              Object containing an array of training examples.

                                              Object containing an array of training examples.

                                              Object containing an array of training examples.

                                              Status Code

                                              • A list of all training examples added for this query.

                                              • Query not found.

                                              No Sample Response

                                              This method does not specify any sample responses.

                                              Add example to training data query

                                              Adds a example to this training data query.

                                              Adds a example to this training data query.

                                              Adds a example to this training data query.

                                              Adds a example to this training data query.

                                              Adds a example to this training data query.

                                              POST /v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples
                                              ServiceCall<TrainingExample> createTrainingExample(CreateTrainingExampleOptions createTrainingExampleOptions)
                                              createTrainingExample(params)
                                              create_training_example(
                                                      self,
                                                      environment_id: str,
                                                      collection_id: str,
                                                      query_id: str,
                                                      *,
                                                      document_id: str = None,
                                                      cross_reference: str = None,
                                                      relevance: int = None,
                                                      **kwargs,
                                                  ) -> DetailedResponse
                                              CreateTrainingExample(string environmentId, string collectionId, string queryId, string documentId = null, string crossReference = null, long? relevance = null)

                                              Request

                                              Use the CreateTrainingExampleOptions.Builder to create a CreateTrainingExampleOptions object that contains the parameter values for the createTrainingExample method.

                                              Path Parameters

                                              • The ID of the environment.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                              • The ID of the collection.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                              • The ID of the query used for training.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                              Query Parameters

                                              • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                              The body of the example that is to be added to the specified query.

                                              The createTrainingExample options.

                                              parameters

                                              • The ID of the environment.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                              • The ID of the collection.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                              • The ID of the query used for training.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                              • The document ID associated with this training example.

                                              • The cross reference associated with this training example.

                                              • The relevance of the training example.

                                              parameters

                                              • The ID of the environment.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                              • The ID of the collection.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                              • The ID of the query used for training.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                              • The document ID associated with this training example.

                                              • The cross reference associated with this training example.

                                              • The relevance of the training example.

                                              parameters

                                              • The ID of the environment.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                              • The ID of the collection.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                              • The ID of the query used for training.

                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                              • The document ID associated with this training example.

                                              • The cross reference associated with this training example.

                                              • The relevance of the training example.

                                              • curl -X POST -u "apikey":"{apikey}" -H "Content-Type: application/json" -d
                                                '{
                                                  "document_id": "{document_id}",
                                                  "cross_reference": "{cross_reference}",
                                                  "relevance": 0
                                                }' "{url}/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples?version=2019-04-30"
                                              • IamAuthenticator authenticator = new IamAuthenticator(
                                                    apikey: "{apikey}"
                                                    );
                                                
                                                DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                discovery.SetServiceUrl("{url}");
                                                
                                                var result = discovery.CreateTrainingExample(
                                                    environmentId: "{environmentId}",
                                                    collectionId: "{collectionId}",
                                                    queryId: "{queryId}",
                                                    documentId: "{documentId}"
                                                    );
                                                
                                                Console.WriteLine(result.Response);
                                              • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                discovery.setServiceUrl("{url}");
                                                
                                                String environmentId = "{environment_id}";
                                                String collectionId = "{collection_id}";
                                                String queryId = "{query_id}";
                                                String documentId = "{document_id}";
                                                
                                                CreateTrainingExampleOptions options = new CreateTrainingExampleOptions.Builder(environmentId, collectionId, queryId)
                                                  .documentId(documentId)
                                                  .build();
                                                
                                                TrainingExample response = discovery.createTrainingExample(options).execute().getResult();
                                              • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                const { IamAuthenticator } = require('ibm-watson/auth');
                                                
                                                const discovery = new DiscoveryV1({
                                                  version: '2019-04-30',
                                                  authenticator: new IamAuthenticator({
                                                    apikey: '{apikey}',
                                                  }),
                                                  serviceUrl: '{url}',
                                                });
                                                
                                                const createTrainingExampleParams = {
                                                  environmentId: '{environment_id}',
                                                  collectionId: '{collection_id}',
                                                  queryId: '{query_id}',
                                                  documentId: '{document_id}',
                                                  relevance: 1,
                                                };
                                                
                                                discovery.createTrainingExample(createTrainingExampleParams)
                                                  .then(trainingExample => {
                                                    console.log(JSON.stringify(trainingExample, null, 2));
                                                  })
                                                  .catch(err => {
                                                    console.log('error:', err);
                                                  });

                                                Response

                                                Training example details.

                                                Training example details.

                                                Training example details.

                                                Training example details.

                                                Training example details.

                                                Status Code

                                                • The example was successfully added to the query.

                                                • Bad request.

                                                No Sample Response

                                                This method does not specify any sample responses.

                                                Delete example for training data query

                                                Deletes the example document with the given ID from the training data query.

                                                Deletes the example document with the given ID from the training data query.

                                                Deletes the example document with the given ID from the training data query.

                                                Deletes the example document with the given ID from the training data query.

                                                Deletes the example document with the given ID from the training data query.

                                                DELETE /v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples/{example_id}
                                                ServiceCall<Void> deleteTrainingExample(DeleteTrainingExampleOptions deleteTrainingExampleOptions)
                                                deleteTrainingExample(params)
                                                delete_training_example(
                                                        self,
                                                        environment_id: str,
                                                        collection_id: str,
                                                        query_id: str,
                                                        example_id: str,
                                                        **kwargs,
                                                    ) -> DetailedResponse
                                                DeleteTrainingExample(string environmentId, string collectionId, string queryId, string exampleId)

                                                Request

                                                Use the DeleteTrainingExampleOptions.Builder to create a DeleteTrainingExampleOptions object that contains the parameter values for the deleteTrainingExample method.

                                                Path Parameters

                                                • The ID of the environment.

                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                • The ID of the collection.

                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                • The ID of the query used for training.

                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                • The ID of the document as it is indexed.

                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                Query Parameters

                                                • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                The deleteTrainingExample options.

                                                parameters

                                                • The ID of the environment.

                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                • The ID of the collection.

                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                • The ID of the query used for training.

                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                • The ID of the document as it is indexed.

                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                parameters

                                                • The ID of the environment.

                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                • The ID of the collection.

                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                • The ID of the query used for training.

                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                • The ID of the document as it is indexed.

                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                parameters

                                                • The ID of the environment.

                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                • The ID of the collection.

                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                • The ID of the query used for training.

                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                • The ID of the document as it is indexed.

                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                • curl -X DELETE -u "apikey":"{apikey}" "{url}/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples/{example_id}?version=2019-04-30"
                                                • IamAuthenticator authenticator = new IamAuthenticator(
                                                      apikey: "{apikey}"
                                                      );
                                                  
                                                  DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                  discovery.SetServiceUrl("{url}");
                                                  
                                                  var result = discovery.DeleteTrainingExample(
                                                      environmentId: "{environmentId}",
                                                      collectionId: "{collectionId}",
                                                      queryId: "{queryId}",
                                                      exampleId: "{exampleId}"
                                                      );
                                                  
                                                  Console.WriteLine(result.Response);
                                                • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                  Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                  discovery.setServiceUrl("{url}");
                                                  
                                                  String environmentId = "{environment_id}";
                                                  String collectionId = "{collection_id}";
                                                  String queryId = "{query_id}";
                                                  String exampleId = "{example_id}";
                                                  
                                                  DeleteTrainingExampleOptions options = new DeleteTrainingExampleOptions.Builder(environmentId, collectionId, queryId, exampleId).build();
                                                  
                                                  discovery.deleteTrainingExample(options).execute();
                                                • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                  const { IamAuthenticator } = require('ibm-watson/auth');
                                                  
                                                  const discovery = new DiscoveryV1({
                                                    version: '2019-04-30',
                                                    authenticator: new IamAuthenticator({
                                                      apikey: '{apikey}',
                                                    }),
                                                    serviceUrl: '{url}',
                                                  });
                                                  
                                                  const deleteTrainingExampleParams = {
                                                    environmentId: '{environment_id}',
                                                    collectionId: '{collection_id}',
                                                    queryId: '{query_id}',
                                                    exampleId: '{example_id}',
                                                  };
                                                  
                                                  discovery.deleteTrainingExample(deleteTrainingExampleParams)
                                                    .then(result => {
                                                      console.log(JSON.stringify(result, null, 2));
                                                    })
                                                    .catch(err => {
                                                      console.log('error:', err);
                                                    });

                                                  Response

                                                  Response type: object

                                                  Status Code

                                                  • The example document reference was removed from the query.

                                                  • Bad request.

                                                  No Sample Response

                                                  This method does not specify any sample responses.

                                                  Change label or cross reference for example

                                                  Changes the label or cross reference query for this training data example.

                                                  Changes the label or cross reference query for this training data example.

                                                  Changes the label or cross reference query for this training data example.

                                                  Changes the label or cross reference query for this training data example.

                                                  Changes the label or cross reference query for this training data example.

                                                  PUT /v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples/{example_id}
                                                  ServiceCall<TrainingExample> updateTrainingExample(UpdateTrainingExampleOptions updateTrainingExampleOptions)
                                                  updateTrainingExample(params)
                                                  update_training_example(
                                                          self,
                                                          environment_id: str,
                                                          collection_id: str,
                                                          query_id: str,
                                                          example_id: str,
                                                          *,
                                                          cross_reference: str = None,
                                                          relevance: int = None,
                                                          **kwargs,
                                                      ) -> DetailedResponse
                                                  UpdateTrainingExample(string environmentId, string collectionId, string queryId, string exampleId, string crossReference = null, long? relevance = null)

                                                  Request

                                                  Use the UpdateTrainingExampleOptions.Builder to create a UpdateTrainingExampleOptions object that contains the parameter values for the updateTrainingExample method.

                                                  Path Parameters

                                                  • The ID of the environment.

                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                  • The ID of the collection.

                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                  • The ID of the query used for training.

                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                  • The ID of the document as it is indexed.

                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                  Query Parameters

                                                  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                  The body of the example that is to be added to the specified query.

                                                  The updateTrainingExample options.

                                                  parameters

                                                  • The ID of the environment.

                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                  • The ID of the collection.

                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                  • The ID of the query used for training.

                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                  • The ID of the document as it is indexed.

                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                  • The example to add.

                                                  • The relevance value for this example.

                                                  parameters

                                                  • The ID of the environment.

                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                  • The ID of the collection.

                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                  • The ID of the query used for training.

                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                  • The ID of the document as it is indexed.

                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                  • The example to add.

                                                  • The relevance value for this example.

                                                  parameters

                                                  • The ID of the environment.

                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                  • The ID of the collection.

                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                  • The ID of the query used for training.

                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                  • The ID of the document as it is indexed.

                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                  • The example to add.

                                                  • The relevance value for this example.

                                                  • curl -X PUT -u "apikey":"{apikey}" -d
                                                    '{
                                                      "document_id": "string",
                                                      "cross_reference": "{new_cross_reference}",
                                                      "relevance": 3
                                                    }' "{url}/v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples/{example_id}?version=2019-04-30"
                                                  • IamAuthenticator authenticator = new IamAuthenticator(
                                                        apikey: "{apikey}"
                                                        );
                                                    
                                                    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                    discovery.SetServiceUrl("{url}");
                                                    
                                                    var result = discovery.UpdateTrainingExample(
                                                        environmentId: "{environmentId}",
                                                        collectionId: "{collectionId}",
                                                        queryId: "{queryId}",
                                                        exampleId: "{exampleId}",
                                                        crossReference: "{crossReference}",
                                                        relevance: 1
                                                        );
                                                    
                                                    Console.WriteLine(result.Response);
                                                  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                    Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                    discovery.setServiceUrl("{url}");
                                                    
                                                    String environmentId = "{environment_id}";
                                                    String collectionId = "{collection_id}";
                                                    String queryId = "{query_id}";
                                                    String exampleId = "{example_id}";
                                                    String newCrossReference = "new_cross_reference";
                                                    
                                                    UpdateTrainingExampleOptions options = new UpdateTrainingExampleOptions.Builder(environmentId, collectionId, queryId, exampleId)
                                                      .crossReference(newCrossReference)
                                                      .build();
                                                    
                                                    TrainingExample response = discovery.deleteTrainingExample(options).execute().getResult();
                                                  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                    const { IamAuthenticator } = require('ibm-watson/auth');
                                                    
                                                    const discovery = new DiscoveryV1({
                                                      version: '2019-04-30',
                                                      authenticator: new IamAuthenticator({
                                                        apikey: '{apikey}',
                                                      }),
                                                      serviceUrl: '{url}',
                                                    });
                                                    
                                                    const updateTrainingExampleParams = {
                                                      environmentId: '{environment_id}',
                                                      collectionId: '{collection_id}',
                                                      queryId: '{query_id}',
                                                      exampleId: '{example_id}',
                                                      relevance: 2,
                                                    };
                                                    
                                                    discovery.updateTrainingExample(updateTrainingExampleParams)
                                                      .then(trainingExample => {
                                                        console.log(JSON.stringify(trainingExample, null, 2));
                                                      })
                                                      .catch(err => {
                                                        console.log('error:', err);
                                                      });

                                                    Response

                                                    Training example details.

                                                    Training example details.

                                                    Training example details.

                                                    Training example details.

                                                    Training example details.

                                                    Status Code

                                                    • The label or cross reference query were successfully applied.

                                                    • Bad request.

                                                    No Sample Response

                                                    This method does not specify any sample responses.

                                                    Get details for training data example

                                                    Gets the details for this training example.

                                                    Gets the details for this training example.

                                                    Gets the details for this training example.

                                                    Gets the details for this training example.

                                                    Gets the details for this training example.

                                                    GET /v1/environments/{environment_id}/collections/{collection_id}/training_data/{query_id}/examples/{example_id}
                                                    ServiceCall<TrainingExample> getTrainingExample(GetTrainingExampleOptions getTrainingExampleOptions)
                                                    getTrainingExample(params)
                                                    get_training_example(
                                                            self,
                                                            environment_id: str,
                                                            collection_id: str,
                                                            query_id: str,
                                                            example_id: str,
                                                            **kwargs,
                                                        ) -> DetailedResponse
                                                    GetTrainingExample(string environmentId, string collectionId, string queryId, string exampleId)

                                                    Request

                                                    Use the GetTrainingExampleOptions.Builder to create a GetTrainingExampleOptions object that contains the parameter values for the getTrainingExample method.

                                                    Path Parameters

                                                    • The ID of the environment.

                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                    • The ID of the collection.

                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                    • The ID of the query used for training.

                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                    • The ID of the document as it is indexed.

                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                    Query Parameters

                                                    • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                    The getTrainingExample options.

                                                    parameters

                                                    • The ID of the environment.

                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                    • The ID of the collection.

                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                    • The ID of the query used for training.

                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                    • The ID of the document as it is indexed.

                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                    parameters

                                                    • The ID of the environment.

                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                    • The ID of the collection.

                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                    • The ID of the query used for training.

                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                    • The ID of the document as it is indexed.

                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                    parameters

                                                    • The ID of the environment.

                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                    • The ID of the collection.

                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                    • The ID of the query used for training.

                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                    • The ID of the document as it is indexed.

                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                    • IamAuthenticator authenticator = new IamAuthenticator(
                                                          apikey: "{apikey}"
                                                          );
                                                      
                                                      DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                      discovery.SetServiceUrl("{url}");
                                                      
                                                      var result = discovery.GetTrainingExample(
                                                          environmentId: "{environmentId}",
                                                          collectionId: "{collectionId}",
                                                          queryId: "{queryId}",
                                                          exampleId: "{exampleId}"
                                                          );
                                                      
                                                      Console.WriteLine(result.Response);
                                                    • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                      Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                      discovery.setServiceUrl("{url}");
                                                      
                                                      String environmentId = "{environment_id}";
                                                      String collectionId = "{collection_id}";
                                                      String queryId = "{query_id}";
                                                      String documentId = "{document_id}";
                                                      
                                                      GetTrainingExampleOptions options = new GetTrainingExampleOptions.Builder(environmentId, collectionId, queryId, documentId).build();
                                                      
                                                      TrainingExample response = discovery.getTrainingExample(options).execute().getResult();
                                                    • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                      const { IamAuthenticator } = require('ibm-watson/auth');
                                                      
                                                      const discovery = new DiscoveryV1({
                                                        version: '2019-04-30',
                                                        authenticator: new IamAuthenticator({
                                                          apikey: '{apikey}',
                                                        }),
                                                        serviceUrl: '{url}',
                                                      });
                                                      
                                                      const getTrainingExampleParams = {
                                                        environmentId: '{environment_id}',
                                                        collectionId: '{collection_id}',
                                                        queryId: '{query_id}',
                                                        exampleId: '{example_id}',
                                                      };
                                                      
                                                      discovery.getTrainingExample(getTrainingExampleParams)
                                                        .then(trainingExample => {
                                                          console.log(JSON.stringify(trainingExample, null, 2));
                                                        })
                                                        .catch(err => {
                                                          console.log('error:', err);
                                                        });

                                                    Response

                                                    Training example details.

                                                    Training example details.

                                                    Training example details.

                                                    Training example details.

                                                    Training example details.

                                                    Status Code

                                                    • Details for this example successfully found and returned.

                                                    • The query or the example does not exist.

                                                    No Sample Response

                                                    This method does not specify any sample responses.

                                                    Delete labeled data

                                                    Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.

                                                    You associate a customer ID with data by passing the X-Watson-Metadata header with a request that passes data. For more information about personal data and customer IDs, see Information security.

                                                    Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.

                                                    You associate a customer ID with data by passing the X-Watson-Metadata header with a request that passes data. For more information about personal data and customer IDs, see Information security.

                                                    Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.

                                                    You associate a customer ID with data by passing the X-Watson-Metadata header with a request that passes data. For more information about personal data and customer IDs, see Information security.

                                                    Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.

                                                    You associate a customer ID with data by passing the X-Watson-Metadata header with a request that passes data. For more information about personal data and customer IDs, see Information security.

                                                    Deletes all data associated with a specified customer ID. The method has no effect if no data is associated with the customer ID.

                                                    You associate a customer ID with data by passing the X-Watson-Metadata header with a request that passes data. For more information about personal data and customer IDs, see Information security.

                                                    DELETE /v1/user_data
                                                    ServiceCall<Void> deleteUserData(DeleteUserDataOptions deleteUserDataOptions)
                                                    deleteUserData(params)
                                                    delete_user_data(
                                                            self,
                                                            customer_id: str,
                                                            **kwargs,
                                                        ) -> DetailedResponse
                                                    DeleteUserData(string customerId)

                                                    Request

                                                    Use the DeleteUserDataOptions.Builder to create a DeleteUserDataOptions object that contains the parameter values for the deleteUserData method.

                                                    Query Parameters

                                                    • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                    • The customer ID for which all data is to be deleted.

                                                    The deleteUserData options.

                                                    parameters

                                                    • The customer ID for which all data is to be deleted.

                                                    parameters

                                                    • The customer ID for which all data is to be deleted.

                                                    parameters

                                                    • The customer ID for which all data is to be deleted.

                                                    • curl -X DELETE -u "apikey":"{apikey}" "{url}/v1/user_data?customer_id=customer&version=2019-04-30"
                                                    • IamAuthenticator authenticator = new IamAuthenticator(
                                                          apikey: "{apikey}"
                                                          );
                                                      
                                                      DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                      discovery.SetServiceUrl("{url}");
                                                      
                                                      var result = discovery.DeleteUserData(
                                                          customerId: "{id}"
                                                          );
                                                      
                                                      Console.WriteLine(result.Response);
                                                    • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                      Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                      discovery.setServiceUrl("{url}");
                                                      
                                                      DeleteUserDataOptions deleteUserDataOptions = 
                                                        new DeleteUserDataOptions.Builder() 
                                                          .customer_id("my_customer_ID") 
                                                          .build(); 
                                                      
                                                      discovery.deleteUserData(deleteUserDataOptions).execute();
                                                      
                                                    • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                      const { IamAuthenticator } = require('ibm-watson/auth');
                                                      
                                                      const discovery = new DiscoveryV1({
                                                        version: '2019-04-30',
                                                        authenticator: new IamAuthenticator({
                                                          apikey: '{apikey}',
                                                        }),
                                                        serviceUrl: '{url}',
                                                      });
                                                      
                                                      const deleteUserDataParams = {
                                                        customerId: '{customer_id}',
                                                      };
                                                      
                                                      discovery.deleteUserData(deleteUserDataParams)
                                                        .then(result => {
                                                          console.log(JSON.stringify(result, null, 2));
                                                        })
                                                        .catch(err => {
                                                          console.log('error:', err);
                                                        });
                                                    • import json
                                                      from ibm_watson import DiscoveryV1
                                                      from ibm_cloud_sdk_core.authenticators import IAMAuthenticator
                                                      
                                                      authenticator = IAMAuthenticator('{apikey}')
                                                      discovery = DiscoveryV1(
                                                          version='2019-04-30',
                                                          authenticator=authenticator
                                                      )
                                                      
                                                      discovery.set_service_url('{url}')
                                                      
                                                      discovery.delete_user_data(
                                                          customer_id = '{id}'
                                                      ).get_result()

                                                    Response

                                                    Response type: object

                                                    Status Code

                                                    • OK. The delete request was successfully submitted.

                                                    • Bad Request. The request did not pass a customer ID:

                                                      • No customer ID found in the request

                                                    No Sample Response

                                                    This method does not specify any sample responses.

                                                    Create event

                                                    The Events API can be used to create log entries that are associated with specific queries. For example, you can record which documents in the results set were "clicked" by a user and when that click occurred.

                                                    The Events API can be used to create log entries that are associated with specific queries. For example, you can record which documents in the results set were "clicked" by a user and when that click occurred.

                                                    The Events API can be used to create log entries that are associated with specific queries. For example, you can record which documents in the results set were "clicked" by a user and when that click occurred.

                                                    The Events API can be used to create log entries that are associated with specific queries. For example, you can record which documents in the results set were "clicked" by a user and when that click occurred.

                                                    The Events API can be used to create log entries that are associated with specific queries. For example, you can record which documents in the results set were "clicked" by a user and when that click occurred.

                                                    POST /v1/events
                                                    ServiceCall<CreateEventResponse> createEvent(CreateEventOptions createEventOptions)
                                                    createEvent(params)
                                                    create_event(
                                                            self,
                                                            type: str,
                                                            data: 'EventData',
                                                            **kwargs,
                                                        ) -> DetailedResponse
                                                    CreateEvent(string type, EventData data)

                                                    Request

                                                    Use the CreateEventOptions.Builder to create a CreateEventOptions object that contains the parameter values for the createEvent method.

                                                    Query Parameters

                                                    • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                    An object that defines a query event to be added to the log.

                                                    The createEvent options.

                                                    parameters

                                                    • The event type to be created.

                                                      Allowable values: [click]

                                                    • Query event data object.

                                                    parameters

                                                    • The event type to be created.

                                                      Allowable values: [click]

                                                    • Query event data object.

                                                    parameters

                                                    • The event type to be created.

                                                      Allowable values: [click]

                                                    • Query event data object.

                                                    • curl -u "apikey":"{apikey}" -X POST -H "Content-Type: application/json" -d '{"type": "click", "data": { "environment_id": "e6061c99-950a-4dad-aee0-411f7143690a", "session_token":  "1_1dlwjrntwodlw111344", "client_timestamp": "2018-01-29T14:58:39.470Z", "display_rank": 1, "collection_id": "a83aaa222aaa222aac460", "document_id": "584857e87807ff4709f3749eb99a05d3" } }' "{url}/v1/events?version=2019-04-30"
                                                    • IamAuthenticator authenticator = new IamAuthenticator(
                                                          apikey: "{apikey}"
                                                          );
                                                      
                                                      DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                      discovery.SetServiceUrl("{url}");
                                                      
                                                      var data = new EventData()
                                                      {
                                                          EnvironmentId = "{environmentId}",
                                                          SessionToken = "{sessionToken}",
                                                          CollectionId = "{collectionId}",
                                                          DocumentId = "{documentId}"
                                                      };
                                                      
                                                      var result = discovery.CreateEvent(
                                                          type: CreateEventResponse.TypeEnumValue.CLICK,
                                                          data: data
                                                          );
                                                      
                                                      Console.WriteLine(result.Response);
                                                    • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                      Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                      discovery.setServiceUrl("{url}");
                                                      
                                                      String environmentId = "{environment_id}";
                                                      String collectionId = "{collection_id}";
                                                      String documentId = "{document_id}";
                                                      String sessionToken = "{session_token}";
                                                      
                                                      EventData eventData = new EventData();
                                                      eventData.setEnvironmentId(environmentId);
                                                      eventData.setCollectionId(collectionId);
                                                      eventData.setDocumentId(documentId);
                                                      eventData.setSessionToken(sessionToken);
                                                      
                                                      CreateEventOptions createEventOptions = new CreateEventOptions.Builder()
                                                        .type("click")
                                                        .data(eventData)
                                                        .build();
                                                      
                                                      CreateEventResponse response = discovery.createEvent(createEventOptions).execute().getResult();
                                                    • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                      const { IamAuthenticator } = require('ibm-watson/auth');
                                                      
                                                      const discovery = new DiscoveryV1({
                                                        version: '2019-04-30',
                                                        authenticator: new IamAuthenticator({
                                                          apikey: '{apikey}',
                                                        }),
                                                        serviceUrl: '{url}',
                                                      });
                                                      
                                                      const createEventParams = {
                                                        type: 'click',
                                                        data: {
                                                          environment_id: '{environment_id}',
                                                          session_token: '{session_token}',
                                                          collection_id: '{collection_id}',
                                                          document_id: '{document_id}',
                                                        }
                                                      };
                                                      
                                                      discovery.createEvent(createEventParams)
                                                        .then(createEventResponse => {
                                                          console.log(JSON.stringify(createEventResponse, null, 2));
                                                        })
                                                        .catch(err => {
                                                          console.log('error:', err);
                                                        });

                                                      Response

                                                      An object defining the event being created.

                                                      An object defining the event being created.

                                                      An object defining the event being created.

                                                      An object defining the event being created.

                                                      An object defining the event being created.

                                                      Status Code

                                                      • The event object was successfully accepted.

                                                      • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                                                      • Request contains invalid content and cannot be added. The error message contains details about what caused the request to be rejected.

                                                      No Sample Response

                                                      This method does not specify any sample responses.

                                                      Search the query and event log

                                                      Searches the query and event log to find query sessions that match the specified criteria. Searching the logs endpoint uses the standard Discovery query syntax for the parameters that are supported.

                                                      Searches the query and event log to find query sessions that match the specified criteria. Searching the logs endpoint uses the standard Discovery query syntax for the parameters that are supported.

                                                      Searches the query and event log to find query sessions that match the specified criteria. Searching the logs endpoint uses the standard Discovery query syntax for the parameters that are supported.

                                                      Searches the query and event log to find query sessions that match the specified criteria. Searching the logs endpoint uses the standard Discovery query syntax for the parameters that are supported.

                                                      Searches the query and event log to find query sessions that match the specified criteria. Searching the logs endpoint uses the standard Discovery query syntax for the parameters that are supported.

                                                      GET /v1/logs
                                                      ServiceCall<LogQueryResponse> queryLog(QueryLogOptions queryLogOptions)
                                                      queryLog(params)
                                                      query_log(
                                                              self,
                                                              *,
                                                              filter: str = None,
                                                              query: str = None,
                                                              count: int = None,
                                                              offset: int = None,
                                                              sort: List[str] = None,
                                                              **kwargs,
                                                          ) -> DetailedResponse
                                                      QueryLog(string filter = null, string query = null, long? count = null, long? offset = null, List<string> sort = null)

                                                      Request

                                                      Use the QueryLogOptions.Builder to create a QueryLogOptions object that contains the parameter values for the queryLog method.

                                                      Query Parameters

                                                      • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                      • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                                                      • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.

                                                      • Number of results to return. The maximum for the count and offset values together in any one query is 10000

                                                        Default: 10

                                                      • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000

                                                      • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified.

                                                      The queryLog options.

                                                      parameters

                                                      • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                                                      • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.

                                                      • Number of results to return. The maximum for the count and offset values together in any one query is 10000.

                                                        Default: 10

                                                      • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.

                                                      • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified.

                                                      parameters

                                                      • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                                                      • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.

                                                      • Number of results to return. The maximum for the count and offset values together in any one query is 10000.

                                                        Default: 10

                                                      • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.

                                                      • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified.

                                                      parameters

                                                      • A cacheable query that excludes documents that don't mention the query content. Filter searches are better for metadata-type searches and for assessing the concepts in the data set.

                                                      • A query search returns all documents in your data set with full enrichments and full text, but with the most relevant documents listed first.

                                                      • Number of results to return. The maximum for the count and offset values together in any one query is 10000.

                                                        Default: 10

                                                      • The number of query results to skip at the beginning. For example, if the total number of results that are returned is 10 and the offset is 8, it returns the last two results. The maximum for the count and offset values together in any one query is 10000.

                                                      • A comma-separated list of fields in the document to sort on. You can optionally specify a sort direction by prefixing the field with - for descending or + for ascending. Ascending is the default sort direction if no prefix is specified.

                                                      •     curl -u "apikey":"{apikey}" "{url}/v1/logs?version=2019-04-30&query=test&count=5"
                                                      • IamAuthenticator authenticator = new IamAuthenticator(
                                                            apikey: "{apikey}"
                                                            );
                                                        
                                                        DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                        discovery.SetServiceUrl("{url}");
                                                        
                                                        var result = discovery.QueryLog();
                                                        
                                                        Console.WriteLine(result.Response);
                                                      • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                        Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                        discovery.setServiceUrl("{url}");
                                                        
                                                        LogQueryResponse response = discovery.queryLog().execute().getResult();
                                                      • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                        const { IamAuthenticator } = require('ibm-watson/auth');
                                                        
                                                        const discovery = new DiscoveryV1({
                                                          version: '2019-04-30',
                                                          authenticator: new IamAuthenticator({
                                                            apikey: '{apikey}',
                                                          }),
                                                          serviceUrl: '{url}',
                                                        });
                                                        
                                                        discovery.queryLog()
                                                          .then(logQueryResponse => {
                                                            console.log(JSON.stringify(logQueryResponse, null, 2));
                                                          })
                                                          .catch(err => {
                                                            console.log('error:', err);
                                                          });

                                                        Response

                                                        Object containing results that match the requested logs query.

                                                        Object containing results that match the requested logs query.

                                                        Object containing results that match the requested logs query.

                                                        Object containing results that match the requested logs query.

                                                        Object containing results that match the requested logs query.

                                                        Status Code

                                                        • Log query executed successfully.

                                                        • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                                                        No Sample Response

                                                        This method does not specify any sample responses.

                                                        Number of queries over time

                                                        Total number of queries using the natural_language_query parameter over a specific time window.

                                                        Total number of queries using the natural_language_query parameter over a specific time window.

                                                        Total number of queries using the natural_language_query parameter over a specific time window.

                                                        Total number of queries using the natural_language_query parameter over a specific time window.

                                                        Total number of queries using the natural_language_query parameter over a specific time window.

                                                        GET /v1/metrics/number_of_queries
                                                        ServiceCall<MetricResponse> getMetricsQuery(GetMetricsQueryOptions getMetricsQueryOptions)
                                                        getMetricsQuery(params)
                                                        get_metrics_query(
                                                                self,
                                                                *,
                                                                start_time: datetime = None,
                                                                end_time: datetime = None,
                                                                result_type: str = None,
                                                                **kwargs,
                                                            ) -> DetailedResponse
                                                        GetMetricsQuery(DateTime? startTime = null, DateTime? endTime = null, string resultType = null)

                                                        Request

                                                        Use the GetMetricsQueryOptions.Builder to create a GetMetricsQueryOptions object that contains the parameter values for the getMetricsQuery method.

                                                        Query Parameters

                                                        • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                        • Metric is computed from data recorded after this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                        • Metric is computed from data recorded before this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                        • The type of result to consider when calculating the metric.

                                                          Allowable values: [document]

                                                        The getMetricsQuery options.

                                                        parameters

                                                        • Metric is computed from data recorded after this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                        • Metric is computed from data recorded before this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                        • The type of result to consider when calculating the metric.

                                                          Allowable values: [document]

                                                        parameters

                                                        • Metric is computed from data recorded after this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                        • Metric is computed from data recorded before this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                        • The type of result to consider when calculating the metric.

                                                          Allowable values: [document]

                                                        parameters

                                                        • Metric is computed from data recorded after this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                        • Metric is computed from data recorded before this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                        • The type of result to consider when calculating the metric.

                                                          Allowable values: [document]

                                                        •     curl -u "apikey":"{apikey}" "{url}/v1/metrics/number_of_queries?version=2019-04-30"
                                                        • IamAuthenticator authenticator = new IamAuthenticator(
                                                              apikey: "{apikey}"
                                                              );
                                                          
                                                          DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                          discovery.SetServiceUrl("{url}");
                                                          
                                                          var result = discovery.GetMetricsQuery();
                                                          
                                                          Console.WriteLine(result.Response);
                                                        • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                          Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                          discovery.setServiceUrl("{url}");
                                                          
                                                          MetricResponse response = discovery.getMetricsQuery().execute().getResult();
                                                        • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                          const { IamAuthenticator } = require('ibm-watson/auth');
                                                          
                                                          const discovery = new DiscoveryV1({
                                                            version: '2019-04-30',
                                                            authenticator: new IamAuthenticator({
                                                              apikey: '{apikey}',
                                                            }),
                                                            serviceUrl: '{url}',
                                                          });
                                                          
                                                          discovery.getMetricsQuery()
                                                            .then(metricResponse => {
                                                              console.log(JSON.stringify(metricResponse, null, 2));
                                                            })
                                                            .catch(err => {
                                                              console.log('error:', err);
                                                            });

                                                          Response

                                                          The response generated from a call to a metrics method.

                                                          The response generated from a call to a metrics method.

                                                          The response generated from a call to a metrics method.

                                                          The response generated from a call to a metrics method.

                                                          The response generated from a call to a metrics method.

                                                          Status Code

                                                          • Metric calculation executed successfully.

                                                          • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                                                          No Sample Response

                                                          This method does not specify any sample responses.

                                                          Number of queries with an event over time

                                                          Total number of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.

                                                          Total number of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.

                                                          Total number of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.

                                                          Total number of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.

                                                          Total number of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.

                                                          GET /v1/metrics/number_of_queries_with_event
                                                          ServiceCall<MetricResponse> getMetricsQueryEvent(GetMetricsQueryEventOptions getMetricsQueryEventOptions)
                                                          getMetricsQueryEvent(params)
                                                          get_metrics_query_event(
                                                                  self,
                                                                  *,
                                                                  start_time: datetime = None,
                                                                  end_time: datetime = None,
                                                                  result_type: str = None,
                                                                  **kwargs,
                                                              ) -> DetailedResponse
                                                          GetMetricsQueryEvent(DateTime? startTime = null, DateTime? endTime = null, string resultType = null)

                                                          Request

                                                          Use the GetMetricsQueryEventOptions.Builder to create a GetMetricsQueryEventOptions object that contains the parameter values for the getMetricsQueryEvent method.

                                                          Query Parameters

                                                          • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                          • Metric is computed from data recorded after this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                          • Metric is computed from data recorded before this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                          • The type of result to consider when calculating the metric.

                                                            Allowable values: [document]

                                                          The getMetricsQueryEvent options.

                                                          parameters

                                                          • Metric is computed from data recorded after this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                          • Metric is computed from data recorded before this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                          • The type of result to consider when calculating the metric.

                                                            Allowable values: [document]

                                                          parameters

                                                          • Metric is computed from data recorded after this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                          • Metric is computed from data recorded before this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                          • The type of result to consider when calculating the metric.

                                                            Allowable values: [document]

                                                          parameters

                                                          • Metric is computed from data recorded after this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                          • Metric is computed from data recorded before this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                          • The type of result to consider when calculating the metric.

                                                            Allowable values: [document]

                                                          •     curl -u "apikey":"{apikey}" "{url}/v1/metrics/number_of_queries_with_event?version=2019-04-30"
                                                          • IamAuthenticator authenticator = new IamAuthenticator(
                                                                apikey: "{apikey}"
                                                                );
                                                            
                                                            DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                            discovery.SetServiceUrl("{url}");
                                                            
                                                            var result = discovery.GetMetricsQueryEvent();
                                                            
                                                            Console.WriteLine(result.Response);
                                                          • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                            Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                            discovery.setServiceUrl("{url}");
                                                            
                                                            MetricResponse response = discovery.getMetricsQueryEvent().execute().getResult();
                                                          • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                            const { IamAuthenticator } = require('ibm-watson/auth');
                                                            
                                                            const discovery = new DiscoveryV1({
                                                              version: '2019-04-30',
                                                              authenticator: new IamAuthenticator({
                                                                apikey: '{apikey}',
                                                              }),
                                                              serviceUrl: '{url}',
                                                            });
                                                            
                                                            discovery.getMetricsQueryEvent()
                                                              .then(metricResponse => {
                                                                console.log(JSON.stringify(metricResponse, null, 2));
                                                              })
                                                              .catch(err => {
                                                                console.log('error:', err);
                                                              });

                                                            Response

                                                            The response generated from a call to a metrics method.

                                                            The response generated from a call to a metrics method.

                                                            The response generated from a call to a metrics method.

                                                            The response generated from a call to a metrics method.

                                                            The response generated from a call to a metrics method.

                                                            Status Code

                                                            • Metric calculation executed successfully.

                                                            • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                                                            No Sample Response

                                                            This method does not specify any sample responses.

                                                            Number of queries with no search results over time

                                                            Total number of queries using the natural_language_query parameter that have no results returned over a specified time window.

                                                            Total number of queries using the natural_language_query parameter that have no results returned over a specified time window.

                                                            Total number of queries using the natural_language_query parameter that have no results returned over a specified time window.

                                                            Total number of queries using the natural_language_query parameter that have no results returned over a specified time window.

                                                            Total number of queries using the natural_language_query parameter that have no results returned over a specified time window.

                                                            GET /v1/metrics/number_of_queries_with_no_search_results
                                                            ServiceCall<MetricResponse> getMetricsQueryNoResults(GetMetricsQueryNoResultsOptions getMetricsQueryNoResultsOptions)
                                                            getMetricsQueryNoResults(params)
                                                            get_metrics_query_no_results(
                                                                    self,
                                                                    *,
                                                                    start_time: datetime = None,
                                                                    end_time: datetime = None,
                                                                    result_type: str = None,
                                                                    **kwargs,
                                                                ) -> DetailedResponse
                                                            GetMetricsQueryNoResults(DateTime? startTime = null, DateTime? endTime = null, string resultType = null)

                                                            Request

                                                            Use the GetMetricsQueryNoResultsOptions.Builder to create a GetMetricsQueryNoResultsOptions object that contains the parameter values for the getMetricsQueryNoResults method.

                                                            Query Parameters

                                                            • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                            • Metric is computed from data recorded after this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                            • Metric is computed from data recorded before this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                            • The type of result to consider when calculating the metric.

                                                              Allowable values: [document]

                                                            The getMetricsQueryNoResults options.

                                                            parameters

                                                            • Metric is computed from data recorded after this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                            • Metric is computed from data recorded before this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                            • The type of result to consider when calculating the metric.

                                                              Allowable values: [document]

                                                            parameters

                                                            • Metric is computed from data recorded after this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                            • Metric is computed from data recorded before this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                            • The type of result to consider when calculating the metric.

                                                              Allowable values: [document]

                                                            parameters

                                                            • Metric is computed from data recorded after this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                            • Metric is computed from data recorded before this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                            • The type of result to consider when calculating the metric.

                                                              Allowable values: [document]

                                                            •     curl -u "apikey":"{apikey}" "{url}/v1/metrics/number_of_queries_with_no_search_results?version=2019-04-30"
                                                            • IamAuthenticator authenticator = new IamAuthenticator(
                                                                  apikey: "{apikey}"
                                                                  );
                                                              
                                                              DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                              discovery.SetServiceUrl("{url}");
                                                              
                                                              var result = discovery.GetMetricsQueryNoResults();
                                                              
                                                              Console.WriteLine(result.Response);
                                                            • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                              Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                              discovery.setServiceUrl("{url}");
                                                              
                                                              MetricResponse response = discovery.getMetricsQueryNoResults().execute().getResult();
                                                            • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                              const { IamAuthenticator } = require('ibm-watson/auth');
                                                              
                                                              const discovery = new DiscoveryV1({
                                                                version: '2019-04-30',
                                                                authenticator: new IamAuthenticator({
                                                                  apikey: '{apikey}',
                                                                }),
                                                                serviceUrl: '{url}',
                                                              });
                                                              
                                                              discovery.getMetricsQueryNoResults()
                                                                .then(metricResponse => {
                                                                  console.log(JSON.stringify(metricResponse, null, 2));
                                                                })
                                                                .catch(err => {
                                                                  console.log('error:', err);
                                                                });

                                                              Response

                                                              The response generated from a call to a metrics method.

                                                              The response generated from a call to a metrics method.

                                                              The response generated from a call to a metrics method.

                                                              The response generated from a call to a metrics method.

                                                              The response generated from a call to a metrics method.

                                                              Status Code

                                                              • Metric calculation executed successfully.

                                                              • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                                                              No Sample Response

                                                              This method does not specify any sample responses.

                                                              Percentage of queries with an associated event

                                                              The percentage of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.

                                                              The percentage of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.

                                                              The percentage of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.

                                                              The percentage of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.

                                                              The percentage of queries using the natural_language_query parameter that have a corresponding "click" event over a specified time window. This metric requires having integrated event tracking in your application using the Events API.

                                                              GET /v1/metrics/event_rate
                                                              ServiceCall<MetricResponse> getMetricsEventRate(GetMetricsEventRateOptions getMetricsEventRateOptions)
                                                              getMetricsEventRate(params)
                                                              get_metrics_event_rate(
                                                                      self,
                                                                      *,
                                                                      start_time: datetime = None,
                                                                      end_time: datetime = None,
                                                                      result_type: str = None,
                                                                      **kwargs,
                                                                  ) -> DetailedResponse
                                                              GetMetricsEventRate(DateTime? startTime = null, DateTime? endTime = null, string resultType = null)

                                                              Request

                                                              Use the GetMetricsEventRateOptions.Builder to create a GetMetricsEventRateOptions object that contains the parameter values for the getMetricsEventRate method.

                                                              Query Parameters

                                                              • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                              • Metric is computed from data recorded after this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                              • Metric is computed from data recorded before this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                              • The type of result to consider when calculating the metric.

                                                                Allowable values: [document]

                                                              The getMetricsEventRate options.

                                                              parameters

                                                              • Metric is computed from data recorded after this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                              • Metric is computed from data recorded before this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                              • The type of result to consider when calculating the metric.

                                                                Allowable values: [document]

                                                              parameters

                                                              • Metric is computed from data recorded after this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                              • Metric is computed from data recorded before this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                              • The type of result to consider when calculating the metric.

                                                                Allowable values: [document]

                                                              parameters

                                                              • Metric is computed from data recorded after this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                              • Metric is computed from data recorded before this timestamp; must be in YYYY-MM-DDThh:mm:ssZ format.

                                                              • The type of result to consider when calculating the metric.

                                                                Allowable values: [document]

                                                              •     curl -u "apikey":"{apikey}" "{url}/v1/metrics/event_rate?version=2019-04-30"
                                                              • IamAuthenticator authenticator = new IamAuthenticator(
                                                                    apikey: "{apikey}"
                                                                    );
                                                                
                                                                DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                                discovery.SetServiceUrl("{url}");
                                                                
                                                                var result = discovery.GetMetricsEventRate();
                                                                
                                                                Console.WriteLine(result.Response);
                                                              • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                                Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                                discovery.setServiceUrl("{url}");
                                                                
                                                                MetricResponse response = discovery.getMetricsEventRate().execute().getResult();
                                                              • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                                const { IamAuthenticator } = require('ibm-watson/auth');
                                                                
                                                                const discovery = new DiscoveryV1({
                                                                  version: '2019-04-30',
                                                                  authenticator: new IamAuthenticator({
                                                                    apikey: '{apikey}',
                                                                  }),
                                                                  serviceUrl: '{url}',
                                                                });
                                                                
                                                                discovery.getMetricsEventRate()
                                                                  .then(metricResponse => {
                                                                    console.log(JSON.stringify(metricResponse, null, 2));
                                                                  })
                                                                  .catch(err => {
                                                                    console.log('error:', err);
                                                                  });

                                                                Response

                                                                The response generated from a call to a metrics method.

                                                                The response generated from a call to a metrics method.

                                                                The response generated from a call to a metrics method.

                                                                The response generated from a call to a metrics method.

                                                                The response generated from a call to a metrics method.

                                                                Status Code

                                                                • Metric calculation executed successfully.

                                                                • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                                                                No Sample Response

                                                                This method does not specify any sample responses.

                                                                Most frequent query tokens with an event

                                                                The most frequent query tokens parsed from the natural_language_query parameter and their corresponding "click" event rate within the recording period (queries and events are stored for 30 days). A query token is an individual word or unigram within the query string.

                                                                The most frequent query tokens parsed from the natural_language_query parameter and their corresponding "click" event rate within the recording period (queries and events are stored for 30 days). A query token is an individual word or unigram within the query string.

                                                                The most frequent query tokens parsed from the natural_language_query parameter and their corresponding "click" event rate within the recording period (queries and events are stored for 30 days). A query token is an individual word or unigram within the query string.

                                                                The most frequent query tokens parsed from the natural_language_query parameter and their corresponding "click" event rate within the recording period (queries and events are stored for 30 days). A query token is an individual word or unigram within the query string.

                                                                The most frequent query tokens parsed from the natural_language_query parameter and their corresponding "click" event rate within the recording period (queries and events are stored for 30 days). A query token is an individual word or unigram within the query string.

                                                                GET /v1/metrics/top_query_tokens_with_event_rate
                                                                ServiceCall<MetricTokenResponse> getMetricsQueryTokenEvent(GetMetricsQueryTokenEventOptions getMetricsQueryTokenEventOptions)
                                                                getMetricsQueryTokenEvent(params)
                                                                get_metrics_query_token_event(
                                                                        self,
                                                                        *,
                                                                        count: int = None,
                                                                        **kwargs,
                                                                    ) -> DetailedResponse
                                                                GetMetricsQueryTokenEvent(long? count = null)

                                                                Request

                                                                Use the GetMetricsQueryTokenEventOptions.Builder to create a GetMetricsQueryTokenEventOptions object that contains the parameter values for the getMetricsQueryTokenEvent method.

                                                                Query Parameters

                                                                • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                                • Number of results to return. The maximum for the count and offset values together in any one query is 10000

                                                                  Default: 10

                                                                The getMetricsQueryTokenEvent options.

                                                                parameters

                                                                • Number of results to return. The maximum for the count and offset values together in any one query is 10000.

                                                                  Default: 10

                                                                parameters

                                                                • Number of results to return. The maximum for the count and offset values together in any one query is 10000.

                                                                  Default: 10

                                                                parameters

                                                                • Number of results to return. The maximum for the count and offset values together in any one query is 10000.

                                                                  Default: 10

                                                                •     curl -u "apikey":"{apikey}" "{url}/v1/metrics/top_query_tokens_with_event_rate?version=2019-04-30"
                                                                • IamAuthenticator authenticator = new IamAuthenticator(
                                                                      apikey: "{apikey}"
                                                                      );
                                                                  
                                                                  DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                                  discovery.SetServiceUrl("{url}");
                                                                  
                                                                  var result = discovery.GetMetricsQueryTokenEvent();
                                                                  
                                                                  Console.WriteLine(result.Response);
                                                                • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                                  Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                                  discovery.setServiceUrl("{url}");
                                                                  
                                                                  MetricTokenResponse response = discovery.getMetricsQueryTokenEvent().execute().getResult();
                                                                • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                                  const { IamAuthenticator } = require('ibm-watson/auth');
                                                                  
                                                                  const discovery = new DiscoveryV1({
                                                                    version: '2019-04-30',
                                                                    authenticator: new IamAuthenticator({
                                                                      apikey: '{apikey}',
                                                                    }),
                                                                    serviceUrl: '{url}',
                                                                  });
                                                                  
                                                                  discovery.getMetricsQueryTokenEvent()
                                                                    .then(metricTokenResponse => {
                                                                      console.log(JSON.stringify(metricTokenResponse, null, 2));
                                                                    })
                                                                    .catch(err => {
                                                                      console.log('error:', err);
                                                                    });

                                                                  Response

                                                                  The response generated from a call to a metrics method that evaluates tokens.

                                                                  The response generated from a call to a metrics method that evaluates tokens.

                                                                  The response generated from a call to a metrics method that evaluates tokens.

                                                                  The response generated from a call to a metrics method that evaluates tokens.

                                                                  The response generated from a call to a metrics method that evaluates tokens.

                                                                  Status Code

                                                                  • Metric calculation executed successfully.

                                                                  • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                                                                  No Sample Response

                                                                  This method does not specify any sample responses.

                                                                  List credentials

                                                                  List all the source credentials that have been created for this service instance.

                                                                  Note: All credentials are sent over an encrypted connection and encrypted at rest.

                                                                  List all the source credentials that have been created for this service instance.

                                                                  Note: All credentials are sent over an encrypted connection and encrypted at rest.

                                                                  List all the source credentials that have been created for this service instance.

                                                                  Note: All credentials are sent over an encrypted connection and encrypted at rest.

                                                                  List all the source credentials that have been created for this service instance.

                                                                  Note: All credentials are sent over an encrypted connection and encrypted at rest.

                                                                  List all the source credentials that have been created for this service instance.

                                                                  Note: All credentials are sent over an encrypted connection and encrypted at rest.

                                                                  GET /v1/environments/{environment_id}/credentials
                                                                  ServiceCall<CredentialsList> listCredentials(ListCredentialsOptions listCredentialsOptions)
                                                                  listCredentials(params)
                                                                  list_credentials(
                                                                          self,
                                                                          environment_id: str,
                                                                          **kwargs,
                                                                      ) -> DetailedResponse
                                                                  ListCredentials(string environmentId)

                                                                  Request

                                                                  Use the ListCredentialsOptions.Builder to create a ListCredentialsOptions object that contains the parameter values for the listCredentials method.

                                                                  Path Parameters

                                                                  • The ID of the environment.

                                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                                  Query Parameters

                                                                  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                                  The listCredentials options.

                                                                  parameters

                                                                  • The ID of the environment.

                                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                  parameters

                                                                  • The ID of the environment.

                                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                  parameters

                                                                  • The ID of the environment.

                                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                  •     curl -u "apikey":"{apikey}" -X GET "{url}/v1/environments/{environment_id}/credentials?version=2019-04-30"
                                                                  • IamAuthenticator authenticator = new IamAuthenticator(
                                                                        apikey: "{apikey}"
                                                                        );
                                                                    
                                                                    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                                    discovery.SetServiceUrl("{url}");
                                                                    
                                                                    var result = discovery.ListCredentials(
                                                                        environmentId: "{environmentId}"
                                                                        );
                                                                    
                                                                    Console.WriteLine(result.Response);
                                                                  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                                    Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                                    discovery.setServiceUrl("{url}");
                                                                    
                                                                    String environmentId = "{environment_id}";
                                                                    
                                                                    ListCredentialsOptions listOptions = new ListCredentialsOptions.Builder()
                                                                      .environmentId(environmentId)
                                                                      .build();
                                                                    
                                                                    CredentialsList response = discovery.listCredentials(listOptions).execute().getResult();
                                                                  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                                    const { IamAuthenticator } = require('ibm-watson/auth');
                                                                    
                                                                    const discovery = new DiscoveryV1({
                                                                      version: '2019-04-30',
                                                                      authenticator: new IamAuthenticator({
                                                                        apikey: '{apikey}',
                                                                      }),
                                                                      serviceUrl: '{url}',
                                                                    });
                                                                    
                                                                    const listCredentialsParams = {
                                                                      environmentId: '{environment_id}',
                                                                    };
                                                                    
                                                                    discovery.listCredentials(listCredentialsParams)
                                                                      .then(credentialsList => {
                                                                        console.log(JSON.stringify(credentialsList, null, 2));
                                                                      })
                                                                      .catch(err => {
                                                                        console.log('error:', err);
                                                                      });

                                                                    Response

                                                                    Object containing array of credential definitions.

                                                                    Object containing array of credential definitions.

                                                                    Examples:
                                                                    {
                                                                      "credentials": [
                                                                        {
                                                                          "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                          "source_type": "salesforce",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "username_password",
                                                                            "url": "login.salesforce.com",
                                                                            "username": "user@email.address"
                                                                          }
                                                                        },
                                                                        {
                                                                          "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f111c",
                                                                          "source_type": "box",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "oauth2",
                                                                            "client_id": "1234567899bz7micz6x6p5zfnycw98e3",
                                                                            "enterprise_id": "000000001"
                                                                          }
                                                                        },
                                                                        {
                                                                          "credential_id": "00000d8c-0000-00e8-ba22-0ed5f89f999d",
                                                                          "source_type": "sharepoint",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "saml",
                                                                            "organization_url": "https://site001.sharepointonline.com",
                                                                            "site_collection_path": "/sites/TestSite1",
                                                                            "username": "userA@sharepointonline.com"
                                                                          }
                                                                        }
                                                                      ]
                                                                    }

                                                                    Object containing array of credential definitions.

                                                                    Examples:
                                                                    {
                                                                      "credentials": [
                                                                        {
                                                                          "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                          "source_type": "salesforce",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "username_password",
                                                                            "url": "login.salesforce.com",
                                                                            "username": "user@email.address"
                                                                          }
                                                                        },
                                                                        {
                                                                          "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f111c",
                                                                          "source_type": "box",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "oauth2",
                                                                            "client_id": "1234567899bz7micz6x6p5zfnycw98e3",
                                                                            "enterprise_id": "000000001"
                                                                          }
                                                                        },
                                                                        {
                                                                          "credential_id": "00000d8c-0000-00e8-ba22-0ed5f89f999d",
                                                                          "source_type": "sharepoint",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "saml",
                                                                            "organization_url": "https://site001.sharepointonline.com",
                                                                            "site_collection_path": "/sites/TestSite1",
                                                                            "username": "userA@sharepointonline.com"
                                                                          }
                                                                        }
                                                                      ]
                                                                    }

                                                                    Object containing array of credential definitions.

                                                                    Examples:
                                                                    {
                                                                      "credentials": [
                                                                        {
                                                                          "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                          "source_type": "salesforce",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "username_password",
                                                                            "url": "login.salesforce.com",
                                                                            "username": "user@email.address"
                                                                          }
                                                                        },
                                                                        {
                                                                          "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f111c",
                                                                          "source_type": "box",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "oauth2",
                                                                            "client_id": "1234567899bz7micz6x6p5zfnycw98e3",
                                                                            "enterprise_id": "000000001"
                                                                          }
                                                                        },
                                                                        {
                                                                          "credential_id": "00000d8c-0000-00e8-ba22-0ed5f89f999d",
                                                                          "source_type": "sharepoint",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "saml",
                                                                            "organization_url": "https://site001.sharepointonline.com",
                                                                            "site_collection_path": "/sites/TestSite1",
                                                                            "username": "userA@sharepointonline.com"
                                                                          }
                                                                        }
                                                                      ]
                                                                    }

                                                                    Object containing array of credential definitions.

                                                                    Examples:
                                                                    {
                                                                      "credentials": [
                                                                        {
                                                                          "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                          "source_type": "salesforce",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "username_password",
                                                                            "url": "login.salesforce.com",
                                                                            "username": "user@email.address"
                                                                          }
                                                                        },
                                                                        {
                                                                          "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f111c",
                                                                          "source_type": "box",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "oauth2",
                                                                            "client_id": "1234567899bz7micz6x6p5zfnycw98e3",
                                                                            "enterprise_id": "000000001"
                                                                          }
                                                                        },
                                                                        {
                                                                          "credential_id": "00000d8c-0000-00e8-ba22-0ed5f89f999d",
                                                                          "source_type": "sharepoint",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "saml",
                                                                            "organization_url": "https://site001.sharepointonline.com",
                                                                            "site_collection_path": "/sites/TestSite1",
                                                                            "username": "userA@sharepointonline.com"
                                                                          }
                                                                        }
                                                                      ]
                                                                    }

                                                                    Status Code

                                                                    • The request to list all credentials completed successfully.

                                                                    • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                                                                    • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                                                                    Example responses
                                                                    • {
                                                                        "credentials": [
                                                                          {
                                                                            "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                            "source_type": "salesforce",
                                                                            "status": {
                                                                              "authenticated": true
                                                                            },
                                                                            "credential_details": {
                                                                              "credential_type": "username_password",
                                                                              "url": "login.salesforce.com",
                                                                              "username": "user@email.address"
                                                                            }
                                                                          },
                                                                          {
                                                                            "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f111c",
                                                                            "source_type": "box",
                                                                            "status": {
                                                                              "authenticated": true
                                                                            },
                                                                            "credential_details": {
                                                                              "credential_type": "oauth2",
                                                                              "client_id": "1234567899bz7micz6x6p5zfnycw98e3",
                                                                              "enterprise_id": "000000001"
                                                                            }
                                                                          },
                                                                          {
                                                                            "credential_id": "00000d8c-0000-00e8-ba22-0ed5f89f999d",
                                                                            "source_type": "sharepoint",
                                                                            "status": {
                                                                              "authenticated": true
                                                                            },
                                                                            "credential_details": {
                                                                              "credential_type": "saml",
                                                                              "organization_url": "https://site001.sharepointonline.com",
                                                                              "site_collection_path": "/sites/TestSite1",
                                                                              "username": "userA@sharepointonline.com"
                                                                            }
                                                                          }
                                                                        ]
                                                                      }
                                                                    • {
                                                                        "credentials": [
                                                                          {
                                                                            "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                            "source_type": "salesforce",
                                                                            "status": {
                                                                              "authenticated": true
                                                                            },
                                                                            "credential_details": {
                                                                              "credential_type": "username_password",
                                                                              "url": "login.salesforce.com",
                                                                              "username": "user@email.address"
                                                                            }
                                                                          },
                                                                          {
                                                                            "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f111c",
                                                                            "source_type": "box",
                                                                            "status": {
                                                                              "authenticated": true
                                                                            },
                                                                            "credential_details": {
                                                                              "credential_type": "oauth2",
                                                                              "client_id": "1234567899bz7micz6x6p5zfnycw98e3",
                                                                              "enterprise_id": "000000001"
                                                                            }
                                                                          },
                                                                          {
                                                                            "credential_id": "00000d8c-0000-00e8-ba22-0ed5f89f999d",
                                                                            "source_type": "sharepoint",
                                                                            "status": {
                                                                              "authenticated": true
                                                                            },
                                                                            "credential_details": {
                                                                              "credential_type": "saml",
                                                                              "organization_url": "https://site001.sharepointonline.com",
                                                                              "site_collection_path": "/sites/TestSite1",
                                                                              "username": "userA@sharepointonline.com"
                                                                            }
                                                                          }
                                                                        ]
                                                                      }

                                                                    Create credentials

                                                                    Creates a set of credentials to connect to a remote source. Created credentials are used in a configuration to associate a collection with the remote source.

                                                                    Note: All credentials are sent over an encrypted connection and encrypted at rest.

                                                                    Creates a set of credentials to connect to a remote source. Created credentials are used in a configuration to associate a collection with the remote source.

                                                                    Note: All credentials are sent over an encrypted connection and encrypted at rest.

                                                                    Creates a set of credentials to connect to a remote source. Created credentials are used in a configuration to associate a collection with the remote source.

                                                                    Note: All credentials are sent over an encrypted connection and encrypted at rest.

                                                                    Creates a set of credentials to connect to a remote source. Created credentials are used in a configuration to associate a collection with the remote source.

                                                                    Note: All credentials are sent over an encrypted connection and encrypted at rest.

                                                                    Creates a set of credentials to connect to a remote source. Created credentials are used in a configuration to associate a collection with the remote source.

                                                                    Note: All credentials are sent over an encrypted connection and encrypted at rest.

                                                                    POST /v1/environments/{environment_id}/credentials
                                                                    ServiceCall<Credentials> createCredentials(CreateCredentialsOptions createCredentialsOptions)
                                                                    createCredentials(params)
                                                                    create_credentials(
                                                                            self,
                                                                            environment_id: str,
                                                                            *,
                                                                            source_type: str = None,
                                                                            credential_details: 'CredentialDetails' = None,
                                                                            status: 'StatusDetails' = None,
                                                                            **kwargs,
                                                                        ) -> DetailedResponse
                                                                    CreateCredentials(string environmentId, string sourceType = null, CredentialDetails credentialDetails = null, StatusDetails status = null)

                                                                    Request

                                                                    Use the CreateCredentialsOptions.Builder to create a CreateCredentialsOptions object that contains the parameter values for the createCredentials method.

                                                                    Path Parameters

                                                                    • The ID of the environment.

                                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                                    Query Parameters

                                                                    • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                                    An object that defines an individual set of source credentials.

                                                                    Examples:
                                                                    {
                                                                      "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                      "source_type": "salesforce",
                                                                      "status": {
                                                                        "authenticated": true
                                                                      },
                                                                      "credential_details": {
                                                                        "credential_type": "username_password",
                                                                        "url": "login.salesforce.com",
                                                                        "username": "user@email.address"
                                                                      }
                                                                    }

                                                                    The createCredentials options.

                                                                    parameters

                                                                    • The ID of the environment.

                                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                    • The source that this credentials object connects to.

                                                                      • box indicates the credentials are used to connect an instance of Enterprise Box.
                                                                      • salesforce indicates the credentials are used to connect to Salesforce.
                                                                      • sharepoint indicates the credentials are used to connect to Microsoft SharePoint Online.
                                                                      • web_crawl indicates the credentials are used to perform a web crawl. = cloud_object_storage indicates the credentials are used to connect to an IBM Cloud Object Store.

                                                                      Allowable values: [box,salesforce,sharepoint,web_crawl,cloud_object_storage]

                                                                    • Object containing details of the stored credentials.

                                                                      Obtain credentials for your source from the administrator of the source.

                                                                    • Object that contains details about the status of the authentication process.

                                                                    parameters

                                                                    • The ID of the environment.

                                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                    • The source that this credentials object connects to.

                                                                      • box indicates the credentials are used to connect an instance of Enterprise Box.
                                                                      • salesforce indicates the credentials are used to connect to Salesforce.
                                                                      • sharepoint indicates the credentials are used to connect to Microsoft SharePoint Online.
                                                                      • web_crawl indicates the credentials are used to perform a web crawl. = cloud_object_storage indicates the credentials are used to connect to an IBM Cloud Object Store.

                                                                      Allowable values: [box,salesforce,sharepoint,web_crawl,cloud_object_storage]

                                                                    • Object containing details of the stored credentials.

                                                                      Obtain credentials for your source from the administrator of the source.

                                                                    • Object that contains details about the status of the authentication process.

                                                                    parameters

                                                                    • The ID of the environment.

                                                                      Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                    • The source that this credentials object connects to.

                                                                      • box indicates the credentials are used to connect an instance of Enterprise Box.
                                                                      • salesforce indicates the credentials are used to connect to Salesforce.
                                                                      • sharepoint indicates the credentials are used to connect to Microsoft SharePoint Online.
                                                                      • web_crawl indicates the credentials are used to perform a web crawl. = cloud_object_storage indicates the credentials are used to connect to an IBM Cloud Object Store.

                                                                      Allowable values: [box,salesforce,sharepoint,web_crawl,cloud_object_storage]

                                                                    • Object containing details of the stored credentials.

                                                                      Obtain credentials for your source from the administrator of the source.

                                                                    • Object that contains details about the status of the authentication process.

                                                                    • curl -u "apikey":"{apikey}" -X POST -H "Content-Type: application/json" -d '{  "source_type": "salesforce", "credential_details": { "credential_type": "username_password", "url": "login.salesforce.com", "username": "email@server.xyz", "password": "{my_salesforce_password}{my_salesforce_security_token}"}}' "{url}/v1/environments/{environment_id}/credentials?version=2019-04-30"
                                                                    • IamAuthenticator authenticator = new IamAuthenticator(
                                                                          apikey: "{apikey}"
                                                                          );
                                                                      
                                                                      DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                                      discovery.SetServiceUrl("{url}");
                                                                      
                                                                      var credentialDetails = new CredentialDetails()
                                                                      {
                                                                          CredentialType = "{credentialType}",
                                                                          EnterpriseId = "{EnterpriseId}",
                                                                          ClientId = "{ClientId}",
                                                                          ClientSecret = "{ClientSecret}",
                                                                          PublicKeyId = "{PublicKeyId}",
                                                                          Passphrase = "{Passphrase}",
                                                                          PrivateKey = "{PrivateKey}"
                                                                      };
                                                                      
                                                                      var result = discovery.CreateCredentials(
                                                                          environmentId: "{environmentId}",
                                                                          sourceType: "{sourceType}",
                                                                          credentialDetails: credentialDetails
                                                                          );
                                                                      
                                                                      Console.WriteLine(result.Response);
                                                                    • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                                      Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                                      discovery.setServiceUrl("{url}");
                                                                      
                                                                      String environmentId = "{environment_id}";
                                                                      String credentialType = "username_password";
                                                                      String url = "https://login.salesforce.com";
                                                                      String username = "test@username.com";
                                                                      String password = "test_password";
                                                                      String sourceType = "salesforce";
                                                                      
                                                                      CredentialDetails credentialDetails = new CredentialDetails();
                                                                      credentialDetails.setCredentialType(credentialType);
                                                                      credentialDetails.setUrl(url);
                                                                      credentialDetails.setUsername(username);
                                                                      credentialDetails.setPassword(password);
                                                                      Credentials credentials = new Credentials();
                                                                      credentials.setSourceType(sourceType);
                                                                      credentials.setCredentialDetails(credentialDetails);
                                                                      
                                                                      CreateCredentialsOptions createOptions = new CreateCredentialsOptions.Builder()
                                                                        .environmentId(environmentId)
                                                                        .credentials(credentials)
                                                                        .build();
                                                                      
                                                                      Credentials response = discovery.createCredentials(createOptions).execute().getResult();
                                                                    • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                                      const { IamAuthenticator } = require('ibm-watson/auth');
                                                                      
                                                                      const discovery = new DiscoveryV1({
                                                                        version: '2019-04-30',
                                                                        authenticator: new IamAuthenticator({
                                                                          apikey: '{apikey}',
                                                                        }),
                                                                        serviceUrl: '{url}',
                                                                      });
                                                                      
                                                                      const createCredentialsParams = {
                                                                        environmentId: '{environment_id}',
                                                                        sourceType: 'sharepoint',
                                                                        credentialDetails: {
                                                                          credential_type: 'saml',
                                                                          username: 'myUserName',
                                                                          password: 'pass1234',
                                                                          organization_url: 'www.sharepoint-org.com/organization',
                                                                        },
                                                                      };
                                                                      
                                                                      discovery.createCredentials(createCredentialsParams)
                                                                        .then(credentials => {
                                                                          console.log(JSON.stringify(credentials, null, 2));
                                                                        })
                                                                        .catch(err => {
                                                                          console.log('error:', err);
                                                                        });

                                                                      Response

                                                                      Object containing credential information.

                                                                      Object containing credential information.

                                                                      Examples:
                                                                      {
                                                                        "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                        "source_type": "salesforce",
                                                                        "status": {
                                                                          "authenticated": true
                                                                        },
                                                                        "credential_details": {
                                                                          "credential_type": "username_password",
                                                                          "url": "login.salesforce.com",
                                                                          "username": "user@email.address"
                                                                        }
                                                                      }

                                                                      Object containing credential information.

                                                                      Examples:
                                                                      {
                                                                        "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                        "source_type": "salesforce",
                                                                        "status": {
                                                                          "authenticated": true
                                                                        },
                                                                        "credential_details": {
                                                                          "credential_type": "username_password",
                                                                          "url": "login.salesforce.com",
                                                                          "username": "user@email.address"
                                                                        }
                                                                      }

                                                                      Object containing credential information.

                                                                      Examples:
                                                                      {
                                                                        "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                        "source_type": "salesforce",
                                                                        "status": {
                                                                          "authenticated": true
                                                                        },
                                                                        "credential_details": {
                                                                          "credential_type": "username_password",
                                                                          "url": "login.salesforce.com",
                                                                          "username": "user@email.address"
                                                                        }
                                                                      }

                                                                      Object containing credential information.

                                                                      Examples:
                                                                      {
                                                                        "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                        "source_type": "salesforce",
                                                                        "status": {
                                                                          "authenticated": true
                                                                        },
                                                                        "credential_details": {
                                                                          "credential_type": "username_password",
                                                                          "url": "login.salesforce.com",
                                                                          "username": "user@email.address"
                                                                        }
                                                                      }

                                                                      Status Code

                                                                      • Credentials successfully created.

                                                                      • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                                                                      • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                                                                      Example responses
                                                                      • {
                                                                          "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                          "source_type": "salesforce",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "username_password",
                                                                            "url": "login.salesforce.com",
                                                                            "username": "user@email.address"
                                                                          }
                                                                        }
                                                                      • {
                                                                          "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                          "source_type": "salesforce",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "username_password",
                                                                            "url": "login.salesforce.com",
                                                                            "username": "user@email.address"
                                                                          }
                                                                        }

                                                                      View Credentials

                                                                      Returns details about the specified credentials.

                                                                      Note: Secure credential information such as a password or SSH key is never returned and must be obtained from the source system.

                                                                      Returns details about the specified credentials.

                                                                      Note: Secure credential information such as a password or SSH key is never returned and must be obtained from the source system.

                                                                      Returns details about the specified credentials.

                                                                      Note: Secure credential information such as a password or SSH key is never returned and must be obtained from the source system.

                                                                      Returns details about the specified credentials.

                                                                      Note: Secure credential information such as a password or SSH key is never returned and must be obtained from the source system.

                                                                      Returns details about the specified credentials.

                                                                      Note: Secure credential information such as a password or SSH key is never returned and must be obtained from the source system.

                                                                      GET /v1/environments/{environment_id}/credentials/{credential_id}
                                                                      ServiceCall<Credentials> getCredentials(GetCredentialsOptions getCredentialsOptions)
                                                                      getCredentials(params)
                                                                      get_credentials(
                                                                              self,
                                                                              environment_id: str,
                                                                              credential_id: str,
                                                                              **kwargs,
                                                                          ) -> DetailedResponse
                                                                      GetCredentials(string environmentId, string credentialId)

                                                                      Request

                                                                      Use the GetCredentialsOptions.Builder to create a GetCredentialsOptions object that contains the parameter values for the getCredentials method.

                                                                      Path Parameters

                                                                      • The ID of the environment.

                                                                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                                      • The unique identifier for a set of source credentials.

                                                                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                                      Query Parameters

                                                                      • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                                      The getCredentials options.

                                                                      parameters

                                                                      • The ID of the environment.

                                                                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                      • The unique identifier for a set of source credentials.

                                                                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                      parameters

                                                                      • The ID of the environment.

                                                                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                      • The unique identifier for a set of source credentials.

                                                                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                      parameters

                                                                      • The ID of the environment.

                                                                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                      • The unique identifier for a set of source credentials.

                                                                        Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                      • curl -u "apikey":"{apikey}" -X GET "{url}/v1/environments/{environment_id}/credentials/{credential_id}?version=2019-04-30"
                                                                      • IamAuthenticator authenticator = new IamAuthenticator(
                                                                            apikey: "{apikey}"
                                                                            );
                                                                        
                                                                        DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                                        discovery.SetServiceUrl("{url}");
                                                                        
                                                                        var result = discovery.GetCredentials(
                                                                            environmentId: "{environmentId}",
                                                                            credentialId: "{credentialId}"
                                                                            );
                                                                        
                                                                        Console.WriteLine(result.Response);
                                                                      • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                                        Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                                        discovery.setServiceUrl("{url}");
                                                                        
                                                                        String environmentId = "{environment_id}";
                                                                        String credentialId = "{credential_id}";
                                                                        
                                                                        GetCredentialsOptions getOptions = new GetCredentialsOptions.Builder()
                                                                          .environmentId(environmentId)
                                                                          .credentialId(credentialId)
                                                                          .build();
                                                                        
                                                                        Credentials response = discovery.getCredentials(getOptions).execute().getResult();
                                                                      • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                                        const { IamAuthenticator } = require('ibm-watson/auth');
                                                                        
                                                                        const discovery = new DiscoveryV1({
                                                                          version: '2019-04-30',
                                                                          authenticator: new IamAuthenticator({
                                                                            apikey: '{apikey}',
                                                                          }),
                                                                          serviceUrl: '{url}',
                                                                        });
                                                                        
                                                                        const getCredentialsParams = {
                                                                          environmentId: '{environment_id}',
                                                                          credentialId: '{credential_id}',
                                                                        };
                                                                        
                                                                        discovery.getCredentials(getCredentialsParams)
                                                                          .then(credentials => {
                                                                            console.log(JSON.stringify(credentials, null, 2));
                                                                          })
                                                                          .catch(err => {
                                                                            console.log('error:', err);
                                                                          });

                                                                        Response

                                                                        Object containing credential information.

                                                                        Object containing credential information.

                                                                        Examples:
                                                                        {
                                                                          "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                          "source_type": "salesforce",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "username_password",
                                                                            "url": "login.salesforce.com",
                                                                            "username": "user@email.address"
                                                                          }
                                                                        }

                                                                        Object containing credential information.

                                                                        Examples:
                                                                        {
                                                                          "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                          "source_type": "salesforce",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "username_password",
                                                                            "url": "login.salesforce.com",
                                                                            "username": "user@email.address"
                                                                          }
                                                                        }

                                                                        Object containing credential information.

                                                                        Examples:
                                                                        {
                                                                          "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                          "source_type": "salesforce",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "username_password",
                                                                            "url": "login.salesforce.com",
                                                                            "username": "user@email.address"
                                                                          }
                                                                        }

                                                                        Object containing credential information.

                                                                        Examples:
                                                                        {
                                                                          "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                          "source_type": "salesforce",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "username_password",
                                                                            "url": "login.salesforce.com",
                                                                            "username": "user@email.address"
                                                                          }
                                                                        }

                                                                        Status Code

                                                                        • The requested credentials object was successfully returned.

                                                                        • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                                                                        • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                                                                        Example responses
                                                                        • {
                                                                            "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                            "source_type": "salesforce",
                                                                            "status": {
                                                                              "authenticated": true
                                                                            },
                                                                            "credential_details": {
                                                                              "credential_type": "username_password",
                                                                              "url": "login.salesforce.com",
                                                                              "username": "user@email.address"
                                                                            }
                                                                          }
                                                                        • {
                                                                            "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                            "source_type": "salesforce",
                                                                            "status": {
                                                                              "authenticated": true
                                                                            },
                                                                            "credential_details": {
                                                                              "credential_type": "username_password",
                                                                              "url": "login.salesforce.com",
                                                                              "username": "user@email.address"
                                                                            }
                                                                          }

                                                                        Update credentials

                                                                        Updates an existing set of source credentials.

                                                                        Note: All credentials are sent over an encrypted connection and encrypted at rest.

                                                                        Updates an existing set of source credentials.

                                                                        Note: All credentials are sent over an encrypted connection and encrypted at rest.

                                                                        Updates an existing set of source credentials.

                                                                        Note: All credentials are sent over an encrypted connection and encrypted at rest.

                                                                        Updates an existing set of source credentials.

                                                                        Note: All credentials are sent over an encrypted connection and encrypted at rest.

                                                                        Updates an existing set of source credentials.

                                                                        Note: All credentials are sent over an encrypted connection and encrypted at rest.

                                                                        PUT /v1/environments/{environment_id}/credentials/{credential_id}
                                                                        ServiceCall<Credentials> updateCredentials(UpdateCredentialsOptions updateCredentialsOptions)
                                                                        updateCredentials(params)
                                                                        update_credentials(
                                                                                self,
                                                                                environment_id: str,
                                                                                credential_id: str,
                                                                                *,
                                                                                source_type: str = None,
                                                                                credential_details: 'CredentialDetails' = None,
                                                                                status: 'StatusDetails' = None,
                                                                                **kwargs,
                                                                            ) -> DetailedResponse
                                                                        UpdateCredentials(string environmentId, string credentialId, string sourceType = null, CredentialDetails credentialDetails = null, StatusDetails status = null)

                                                                        Request

                                                                        Use the UpdateCredentialsOptions.Builder to create a UpdateCredentialsOptions object that contains the parameter values for the updateCredentials method.

                                                                        Path Parameters

                                                                        • The ID of the environment.

                                                                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                                        • The unique identifier for a set of source credentials.

                                                                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                                        Query Parameters

                                                                        • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                                        An object that defines an individual set of source credentials.

                                                                        Examples:
                                                                        {
                                                                          "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                          "source_type": "salesforce",
                                                                          "status": {
                                                                            "authenticated": true
                                                                          },
                                                                          "credential_details": {
                                                                            "credential_type": "username_password",
                                                                            "url": "login.salesforce.com",
                                                                            "username": "user@email.address"
                                                                          }
                                                                        }

                                                                        The updateCredentials options.

                                                                        parameters

                                                                        • The ID of the environment.

                                                                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                        • The unique identifier for a set of source credentials.

                                                                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                        • The source that this credentials object connects to.

                                                                          • box indicates the credentials are used to connect an instance of Enterprise Box.
                                                                          • salesforce indicates the credentials are used to connect to Salesforce.
                                                                          • sharepoint indicates the credentials are used to connect to Microsoft SharePoint Online.
                                                                          • web_crawl indicates the credentials are used to perform a web crawl. = cloud_object_storage indicates the credentials are used to connect to an IBM Cloud Object Store.

                                                                          Allowable values: [box,salesforce,sharepoint,web_crawl,cloud_object_storage]

                                                                        • Object containing details of the stored credentials.

                                                                          Obtain credentials for your source from the administrator of the source.

                                                                        • Object that contains details about the status of the authentication process.

                                                                        parameters

                                                                        • The ID of the environment.

                                                                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                        • The unique identifier for a set of source credentials.

                                                                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                        • The source that this credentials object connects to.

                                                                          • box indicates the credentials are used to connect an instance of Enterprise Box.
                                                                          • salesforce indicates the credentials are used to connect to Salesforce.
                                                                          • sharepoint indicates the credentials are used to connect to Microsoft SharePoint Online.
                                                                          • web_crawl indicates the credentials are used to perform a web crawl. = cloud_object_storage indicates the credentials are used to connect to an IBM Cloud Object Store.

                                                                          Allowable values: [box,salesforce,sharepoint,web_crawl,cloud_object_storage]

                                                                        • Object containing details of the stored credentials.

                                                                          Obtain credentials for your source from the administrator of the source.

                                                                        • Object that contains details about the status of the authentication process.

                                                                        parameters

                                                                        • The ID of the environment.

                                                                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                        • The unique identifier for a set of source credentials.

                                                                          Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                        • The source that this credentials object connects to.

                                                                          • box indicates the credentials are used to connect an instance of Enterprise Box.
                                                                          • salesforce indicates the credentials are used to connect to Salesforce.
                                                                          • sharepoint indicates the credentials are used to connect to Microsoft SharePoint Online.
                                                                          • web_crawl indicates the credentials are used to perform a web crawl. = cloud_object_storage indicates the credentials are used to connect to an IBM Cloud Object Store.

                                                                          Allowable values: [box,salesforce,sharepoint,web_crawl,cloud_object_storage]

                                                                        • Object containing details of the stored credentials.

                                                                          Obtain credentials for your source from the administrator of the source.

                                                                        • Object that contains details about the status of the authentication process.

                                                                        • curl -u "apikey":"{apikey}" -X PUT -H "Content-Type: application/json" -d '{  "source_type": "salesforce", "credential_details": { "credential_type": "username_password", "url": "login.salesforce.com", "username": "email@server.xyz", "password": "my_salesforce_passwordmy_salesforce_security_token"}}' "{url}/v1/environments/{environment_id}/credentials/{credential_id}?version=2019-04-30"
                                                                        • IamAuthenticator authenticator = new IamAuthenticator(
                                                                              apikey: "{apikey}"
                                                                              );
                                                                          
                                                                          DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                                          discovery.SetServiceUrl("{url}");
                                                                          
                                                                          string privateKey = "{privatekey}";
                                                                          var privateKeyBytes = System.Text.Encoding.UTF8.GetBytes(privateKey);
                                                                          var base64PrivateKey = Convert.ToBase64String(privateKeyBytes);
                                                                          
                                                                          var updatedCredentialDetails = new CredentialDetails()
                                                                          {
                                                                              CredentialType = "{credentialType}",
                                                                              EnterpriseId = "{EnterpriseId}",
                                                                              ClientId = "{ClientId}",
                                                                              ClientSecret = "{ClientSecret}",
                                                                              PublicKeyId = "{PublicKeyId}",
                                                                              Passphrase = "{Passphrase}",
                                                                              PrivateKey = "{PrivateKey}"
                                                                          };
                                                                          
                                                                          var result = discovery.UpdateCredentials(
                                                                              environmentId: "{environmentId}",
                                                                              credentialId: "{credentialId}",
                                                                              sourceType: "{sourceType}",
                                                                              credentialDetails: updatedCredentialDetails
                                                                              );
                                                                          
                                                                          Console.WriteLine(result.Response);
                                                                        • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                                          Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                                          discovery.setServiceUrl("{url}");
                                                                          
                                                                          String environmentId = "{environment_id}";
                                                                          String credentialId = "{credential_id}";
                                                                          String credentialType = "username_password";
                                                                          String oldUsername = "test@username.com";
                                                                          String oldPassword = "test_password";
                                                                          String newUrl = "https://newlogin.salesforce.com";
                                                                          String sourceType = "salesforce";
                                                                          
                                                                          CredentialDetails updatedDetails = new CredentialDetails();
                                                                          updatedDetails.setCredentialType(credentialType);
                                                                          updatedDetails.setUrl(newUrl);
                                                                          updatedDetails.setUsername(oldUsername);
                                                                          updatedDetails.setPassword(oldPassword);
                                                                          
                                                                          UpdateCredentialsOptions updateOptions = new UpdateCredentialsOptions.Builder()
                                                                            .environmentId(environmentId)
                                                                            .credentialId(credentialId)
                                                                            .sourceType(sourceType)
                                                                            .credentialDetails(updatedDetails)
                                                                            .build();
                                                                          
                                                                          Credentials response = discovery.updateCredentials(updateOptions).execute().getResult();
                                                                        • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                                          const { IamAuthenticator } = require('ibm-watson/auth');
                                                                          
                                                                          const discovery = new DiscoveryV1({
                                                                            version: '2019-04-30',
                                                                            authenticator: new IamAuthenticator({
                                                                              apikey: '{apikey}',
                                                                            }),
                                                                            serviceUrl: '{url}',
                                                                          });
                                                                          
                                                                          const updateCredentialsParams = {
                                                                            environmentId: '{environment_id}',
                                                                            credentialId: '{credential_id}',
                                                                            sourceType: 'sharepoint',
                                                                            credentialDetails: {
                                                                              credential_type: 'saml',
                                                                              username: 'new username',
                                                                              password: 'new password',
                                                                              organization_url: 'www.sharepoint-org.com/organization',
                                                                            },
                                                                          };
                                                                          
                                                                          discovery.updateCredentials(updateCredentialsParams)
                                                                            .then(credentials => {
                                                                              console.log(JSON.stringify(credentials, null, 2));
                                                                            })
                                                                            .catch(err => {
                                                                              console.log('error:', err);
                                                                            });

                                                                          Response

                                                                          Object containing credential information.

                                                                          Object containing credential information.

                                                                          Examples:
                                                                          {
                                                                            "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                            "source_type": "salesforce",
                                                                            "status": {
                                                                              "authenticated": true
                                                                            },
                                                                            "credential_details": {
                                                                              "credential_type": "username_password",
                                                                              "url": "login.salesforce.com",
                                                                              "username": "user@email.address"
                                                                            }
                                                                          }

                                                                          Object containing credential information.

                                                                          Examples:
                                                                          {
                                                                            "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                            "source_type": "salesforce",
                                                                            "status": {
                                                                              "authenticated": true
                                                                            },
                                                                            "credential_details": {
                                                                              "credential_type": "username_password",
                                                                              "url": "login.salesforce.com",
                                                                              "username": "user@email.address"
                                                                            }
                                                                          }

                                                                          Object containing credential information.

                                                                          Examples:
                                                                          {
                                                                            "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                            "source_type": "salesforce",
                                                                            "status": {
                                                                              "authenticated": true
                                                                            },
                                                                            "credential_details": {
                                                                              "credential_type": "username_password",
                                                                              "url": "login.salesforce.com",
                                                                              "username": "user@email.address"
                                                                            }
                                                                          }

                                                                          Object containing credential information.

                                                                          Examples:
                                                                          {
                                                                            "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                            "source_type": "salesforce",
                                                                            "status": {
                                                                              "authenticated": true
                                                                            },
                                                                            "credential_details": {
                                                                              "credential_type": "username_password",
                                                                              "url": "login.salesforce.com",
                                                                              "username": "user@email.address"
                                                                            }
                                                                          }

                                                                          Status Code

                                                                          • Credentials successfully updated.

                                                                          • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                                                                          • Authentication to source failed. The error message contains details about what caused the request to be rejected.

                                                                          • Not found. The error message contains details about what caused the request to be rejected.

                                                                          Example responses
                                                                          • {
                                                                              "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                              "source_type": "salesforce",
                                                                              "status": {
                                                                                "authenticated": true
                                                                              },
                                                                              "credential_details": {
                                                                                "credential_type": "username_password",
                                                                                "url": "login.salesforce.com",
                                                                                "username": "user@email.address"
                                                                              }
                                                                            }
                                                                          • {
                                                                              "credential_id": "00000d8c-0000-00e8-ba89-0ed5f89f718b",
                                                                              "source_type": "salesforce",
                                                                              "status": {
                                                                                "authenticated": true
                                                                              },
                                                                              "credential_details": {
                                                                                "credential_type": "username_password",
                                                                                "url": "login.salesforce.com",
                                                                                "username": "user@email.address"
                                                                              }
                                                                            }

                                                                          Delete credentials

                                                                          Deletes a set of stored credentials from your Discovery instance.

                                                                          Deletes a set of stored credentials from your Discovery instance.

                                                                          Deletes a set of stored credentials from your Discovery instance.

                                                                          Deletes a set of stored credentials from your Discovery instance.

                                                                          Deletes a set of stored credentials from your Discovery instance.

                                                                          DELETE /v1/environments/{environment_id}/credentials/{credential_id}
                                                                          ServiceCall<DeleteCredentials> deleteCredentials(DeleteCredentialsOptions deleteCredentialsOptions)
                                                                          deleteCredentials(params)
                                                                          delete_credentials(
                                                                                  self,
                                                                                  environment_id: str,
                                                                                  credential_id: str,
                                                                                  **kwargs,
                                                                              ) -> DetailedResponse
                                                                          DeleteCredentials(string environmentId, string credentialId)

                                                                          Request

                                                                          Use the DeleteCredentialsOptions.Builder to create a DeleteCredentialsOptions object that contains the parameter values for the deleteCredentials method.

                                                                          Path Parameters

                                                                          • The ID of the environment.

                                                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                                          • The unique identifier for a set of source credentials.

                                                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                                          Query Parameters

                                                                          • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                                          The deleteCredentials options.

                                                                          parameters

                                                                          • The ID of the environment.

                                                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                          • The unique identifier for a set of source credentials.

                                                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                          parameters

                                                                          • The ID of the environment.

                                                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                          • The unique identifier for a set of source credentials.

                                                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                          parameters

                                                                          • The ID of the environment.

                                                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                          • The unique identifier for a set of source credentials.

                                                                            Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                          • curl -u "apikey":"{apikey}" -X DELETE "{url}/v1/environments/{environment_id}/credentials/{credential_id}?version=2019-04-30"
                                                                          • IamAuthenticator authenticator = new IamAuthenticator(
                                                                                apikey: "{apikey}"
                                                                                );
                                                                            
                                                                            DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                                            discovery.SetServiceUrl("{url}");
                                                                            
                                                                            var result = discovery.DeleteCredentials(
                                                                                environmentId: "{environmentId}",
                                                                                credentialId: "{credentialId}"
                                                                                );
                                                                            
                                                                            Console.WriteLine(result.Response);
                                                                          • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                                            Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                                            discovery.setServiceUrl("{url}");
                                                                            
                                                                            String environmentId = "{environment_id}";
                                                                            String credentialId = "{credential_id}";
                                                                            
                                                                            DeleteCredentialsOptions deleteOptions = new DeleteCredentialsOptions.Builder()
                                                                              .environmentId(environmentId)
                                                                              .credentialId(credentialId)
                                                                              .build();
                                                                            
                                                                            DeleteCredentials response = discovery.deleteCredentials(deleteOptions).execute();
                                                                          • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                                            const { IamAuthenticator } = require('ibm-watson/auth');
                                                                            
                                                                            const discovery = new DiscoveryV1({
                                                                              version: '2019-04-30',
                                                                              authenticator: new IamAuthenticator({
                                                                                apikey: '{apikey}',
                                                                              }),
                                                                              serviceUrl: '{url}',
                                                                            });
                                                                            
                                                                            const deleteCredentialsParams = {
                                                                              environmentId: '{environment_id}',
                                                                              credentialId: '{credential_id}',
                                                                            };
                                                                            
                                                                            discovery.deleteCredentials(deleteCredentialsParams)
                                                                              .then(deleteCredentials => {
                                                                                console.log(JSON.stringify(deleteCredentials, null, 2));
                                                                              })
                                                                              .catch(err => {
                                                                                console.log('error:', err);
                                                                              });

                                                                            Response

                                                                            Object returned after credentials are deleted.

                                                                            Object returned after credentials are deleted.

                                                                            Object returned after credentials are deleted.

                                                                            Object returned after credentials are deleted.

                                                                            Object returned after credentials are deleted.

                                                                            Status Code

                                                                            • Credentials successfully deleted.

                                                                            • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                                                                            • Bad request if the request is incorrectly formatted. The error message contains details about what caused the request to be rejected.

                                                                            No Sample Response

                                                                            This method does not specify any sample responses.

                                                                            List Gateways

                                                                            List the currently configured gateways.

                                                                            List the currently configured gateways.

                                                                            List the currently configured gateways.

                                                                            List the currently configured gateways.

                                                                            List the currently configured gateways.

                                                                            GET /v1/environments/{environment_id}/gateways
                                                                            ServiceCall<GatewayList> listGateways(ListGatewaysOptions listGatewaysOptions)
                                                                            listGateways(params)
                                                                            list_gateways(
                                                                                    self,
                                                                                    environment_id: str,
                                                                                    **kwargs,
                                                                                ) -> DetailedResponse
                                                                            ListGateways(string environmentId)

                                                                            Request

                                                                            Use the ListGatewaysOptions.Builder to create a ListGatewaysOptions object that contains the parameter values for the listGateways method.

                                                                            Path Parameters

                                                                            • The ID of the environment.

                                                                              Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                                            Query Parameters

                                                                            • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                                            The listGateways options.

                                                                            parameters

                                                                            • The ID of the environment.

                                                                              Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                            parameters

                                                                            • The ID of the environment.

                                                                              Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                            parameters

                                                                            • The ID of the environment.

                                                                              Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                            • curl -u "apikey":"{apikey}" -X GET "{url}/v1/environments/{environment_id}/gateways?version=2019-04-30"
                                                                            • IamAuthenticator authenticator = new IamAuthenticator(
                                                                                  apikey: "{apikey}"
                                                                                  );
                                                                              
                                                                              DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                                              discovery.SetServiceUrl("{url}");
                                                                              
                                                                              var result = discovery.ListGateways(
                                                                                  environmentId: "{environmentId}"
                                                                                  );
                                                                                              
                                                                              Console.WriteLine(result.Response);
                                                                            • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                                              Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                                              discovery.setServiceUrl("{url}");
                                                                              
                                                                              String environmentId = "{environment_id}";
                                                                              
                                                                              ListGatewaysOptions options = new ListGatewaysOptions.Builder()
                                                                                .environmentId(environmentId)
                                                                                .build();
                                                                              
                                                                              GatewayList response = discovery.listGateways(options).execute().getResult();
                                                                            • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                                              const { IamAuthenticator } = require('ibm-watson/auth');
                                                                              
                                                                              const discovery = new DiscoveryV1({
                                                                                version: '2019-04-30',
                                                                                authenticator: new IamAuthenticator({
                                                                                  apikey: '{apikey}',
                                                                                }),
                                                                                serviceUrl: '{url}',
                                                                              });
                                                                              
                                                                              const listGatewaysParams = {
                                                                                environmentId: '{environment_id}',
                                                                              };
                                                                              
                                                                              discovery.listGateways(listGatewaysParams)
                                                                                .then(gatewayList => {
                                                                                  console.log(JSON.stringify(gatewayList, null, 2));
                                                                                })
                                                                                .catch(err => {
                                                                                  console.log('error:', err);
                                                                                });

                                                                              Response

                                                                              Object containing gateways array.

                                                                              Object containing gateways array.

                                                                              Object containing gateways array.

                                                                              Object containing gateways array.

                                                                              Object containing gateways array.

                                                                              Status Code

                                                                              • Success

                                                                              • Invalid Environment ID

                                                                              • Unknown Environment ID

                                                                              No Sample Response

                                                                              This method does not specify any sample responses.

                                                                              Create Gateway

                                                                              Create a gateway configuration to use with a remotely installed gateway.

                                                                              Create a gateway configuration to use with a remotely installed gateway.

                                                                              Create a gateway configuration to use with a remotely installed gateway.

                                                                              Create a gateway configuration to use with a remotely installed gateway.

                                                                              Create a gateway configuration to use with a remotely installed gateway.

                                                                              POST /v1/environments/{environment_id}/gateways
                                                                              ServiceCall<Gateway> createGateway(CreateGatewayOptions createGatewayOptions)
                                                                              createGateway(params)
                                                                              create_gateway(
                                                                                      self,
                                                                                      environment_id: str,
                                                                                      *,
                                                                                      name: str = None,
                                                                                      **kwargs,
                                                                                  ) -> DetailedResponse
                                                                              CreateGateway(string environmentId, string name = null)

                                                                              Request

                                                                              Use the CreateGatewayOptions.Builder to create a CreateGatewayOptions object that contains the parameter values for the createGateway method.

                                                                              Path Parameters

                                                                              • The ID of the environment.

                                                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                                              Query Parameters

                                                                              • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                                              The name of the gateway to created

                                                                              The createGateway options.

                                                                              parameters

                                                                              • The ID of the environment.

                                                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                              • User-defined name.

                                                                              parameters

                                                                              • The ID of the environment.

                                                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                              • User-defined name.

                                                                              parameters

                                                                              • The ID of the environment.

                                                                                Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                              • User-defined name.

                                                                              • curl -u "apikey":"{apikey}" -X POST -H "Content-Type: application/json" -d '{"name": "gateway_name"}' "{url}/v1/environments/{environment_id}/gateways?version=2019-04-30"
                                                                              • IamAuthenticator authenticator = new IamAuthenticator(
                                                                                    apikey: "{apikey}"
                                                                                    );
                                                                                
                                                                                DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                                                discovery.SetServiceUrl("{url}");
                                                                                
                                                                                var result = discovery.CreateGateway(
                                                                                    environmentId: "{environmentId}",
                                                                                    name: "gateway"
                                                                                    );
                                                                                
                                                                                Console.WriteLine(result.Response);
                                                                              • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                                                Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                                                discovery.setServiceUrl("{url}");
                                                                                
                                                                                String environmentId = "{environment_id}";
                                                                                String gatewayName = "example_gateway";
                                                                                
                                                                                CreateGatewayOptions options = new CreateGatewayOptions.Builder()
                                                                                  .environmentId(environmentId)
                                                                                  .name(gatewayName)
                                                                                  .build();
                                                                                
                                                                                Gateway response = discovery.createGateway(options).execute().getResult();
                                                                              • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                                                const { IamAuthenticator } = require('ibm-watson/auth');
                                                                                
                                                                                const discovery = new DiscoveryV1({
                                                                                  version: '2019-04-30',
                                                                                  authenticator: new IamAuthenticator({
                                                                                    apikey: '{apikey}',
                                                                                  }),
                                                                                  serviceUrl: '{url}',
                                                                                });
                                                                                
                                                                                const createGatewayParams = {
                                                                                  environmentId: '{environment_id}',
                                                                                  name: 'node-sdk-test',
                                                                                };
                                                                                
                                                                                discovery.createGateway(createGatewayParams)
                                                                                  .then(gateway => {
                                                                                    console.log(JSON.stringify(gateway, null, 2));
                                                                                  })
                                                                                  .catch(err => {
                                                                                    console.log('error:', err);
                                                                                  });

                                                                                Response

                                                                                Object describing a specific gateway.

                                                                                Object describing a specific gateway.

                                                                                Object describing a specific gateway.

                                                                                Object describing a specific gateway.

                                                                                Object describing a specific gateway.

                                                                                Status Code

                                                                                • Success

                                                                                • Invalid Environment ID

                                                                                • Unknown Environment ID

                                                                                No Sample Response

                                                                                This method does not specify any sample responses.

                                                                                List Gateway Details

                                                                                List information about the specified gateway.

                                                                                List information about the specified gateway.

                                                                                List information about the specified gateway.

                                                                                List information about the specified gateway.

                                                                                List information about the specified gateway.

                                                                                GET /v1/environments/{environment_id}/gateways/{gateway_id}
                                                                                ServiceCall<Gateway> getGateway(GetGatewayOptions getGatewayOptions)
                                                                                getGateway(params)
                                                                                get_gateway(
                                                                                        self,
                                                                                        environment_id: str,
                                                                                        gateway_id: str,
                                                                                        **kwargs,
                                                                                    ) -> DetailedResponse
                                                                                GetGateway(string environmentId, string gatewayId)

                                                                                Request

                                                                                Use the GetGatewayOptions.Builder to create a GetGatewayOptions object that contains the parameter values for the getGateway method.

                                                                                Path Parameters

                                                                                • The ID of the environment.

                                                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                                                • The requested gateway ID.

                                                                                Query Parameters

                                                                                • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                                                The getGateway options.

                                                                                parameters

                                                                                • The ID of the environment.

                                                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                                • The requested gateway ID.

                                                                                parameters

                                                                                • The ID of the environment.

                                                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                                • The requested gateway ID.

                                                                                parameters

                                                                                • The ID of the environment.

                                                                                  Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                                • The requested gateway ID.

                                                                                • curl -u "apikey":"{apikey}" -X GET "{url}/v1/environments/{environment_id}/gateways/{gateway_id}?version=2019-04-30"
                                                                                • IamAuthenticator authenticator = new IamAuthenticator(
                                                                                      apikey: "{apikey}"
                                                                                      );
                                                                                  
                                                                                  DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                                                  discovery.SetServiceUrl("{url}");
                                                                                  
                                                                                  var result = discovery.GetGateway(
                                                                                      environmentId: "{environmentId}",
                                                                                      gatewayId: "{gatewayId}"
                                                                                      );
                                                                                  
                                                                                  Console.WriteLine(result.Response);
                                                                                • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                                                  Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                                                  discovery.setServiceUrl("{url}");
                                                                                  
                                                                                  String environmentId = "{environment_id}";
                                                                                  String gatewayId = "{gateway_id}";
                                                                                  
                                                                                  GetGatewayOptions options = new GetGatewayOptions.Builder()
                                                                                    .environmentId(environmentId)
                                                                                    .gatewayId(gatewayId)
                                                                                    .build();
                                                                                  
                                                                                  Gateway response = discovery.getGateway(options).execute().getResult();
                                                                                • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                                                  const { IamAuthenticator } = require('ibm-watson/auth');
                                                                                  
                                                                                  const discovery = new DiscoveryV1({
                                                                                    version: '2019-04-30',
                                                                                    authenticator: new IamAuthenticator({
                                                                                      apikey: '{apikey}',
                                                                                    }),
                                                                                    serviceUrl: '{url}',
                                                                                  });
                                                                                  
                                                                                  const getGatewayParams = {
                                                                                    environmentId: '{environment_id}',
                                                                                    gatewayId: '{gateway_id}',
                                                                                  };
                                                                                  
                                                                                  discovery.getGateway(getGatewayParams)
                                                                                    .then(gateway => {
                                                                                      console.log(JSON.stringify(gateway, null, 2));
                                                                                    })
                                                                                    .catch(err => {
                                                                                      console.log('error:', err);
                                                                                    });

                                                                                  Response

                                                                                  Object describing a specific gateway.

                                                                                  Object describing a specific gateway.

                                                                                  Object describing a specific gateway.

                                                                                  Object describing a specific gateway.

                                                                                  Object describing a specific gateway.

                                                                                  Status Code

                                                                                  • Success

                                                                                  • Invalid or Unknown Environment ID

                                                                                  No Sample Response

                                                                                  This method does not specify any sample responses.

                                                                                  Delete Gateway

                                                                                  Delete the specified gateway configuration.

                                                                                  Delete the specified gateway configuration.

                                                                                  Delete the specified gateway configuration.

                                                                                  Delete the specified gateway configuration.

                                                                                  Delete the specified gateway configuration.

                                                                                  DELETE /v1/environments/{environment_id}/gateways/{gateway_id}
                                                                                  ServiceCall<GatewayDelete> deleteGateway(DeleteGatewayOptions deleteGatewayOptions)
                                                                                  deleteGateway(params)
                                                                                  delete_gateway(
                                                                                          self,
                                                                                          environment_id: str,
                                                                                          gateway_id: str,
                                                                                          **kwargs,
                                                                                      ) -> DetailedResponse
                                                                                  DeleteGateway(string environmentId, string gatewayId)

                                                                                  Request

                                                                                  Use the DeleteGatewayOptions.Builder to create a DeleteGatewayOptions object that contains the parameter values for the deleteGateway method.

                                                                                  Path Parameters

                                                                                  • The ID of the environment.

                                                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression ^[a-zA-Z0-9_-]*$

                                                                                  • The requested gateway ID.

                                                                                  Query Parameters

                                                                                  • Release date of the version of the API you want to use. Specify dates in YYYY-MM-DD format. The current version is 2019-04-30.

                                                                                  The deleteGateway options.

                                                                                  parameters

                                                                                  • The ID of the environment.

                                                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                                  • The requested gateway ID.

                                                                                  parameters

                                                                                  • The ID of the environment.

                                                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                                  • The requested gateway ID.

                                                                                  parameters

                                                                                  • The ID of the environment.

                                                                                    Possible values: 1 ≤ length ≤ 255, Value must match regular expression /^[a-zA-Z0-9_-]*$/

                                                                                  • The requested gateway ID.

                                                                                  • curl -u "apikey":"{apikey}" -X DELETE "{url}/v1/environments/{environment_id}/gateways/{gateway_id}?version=2019-04-30"
                                                                                  • IamAuthenticator authenticator = new IamAuthenticator(
                                                                                        apikey: "{apikey}"
                                                                                        );
                                                                                    
                                                                                    DiscoveryService discovery = new DiscoveryService("2019-04-30", authenticator);
                                                                                    discovery.SetServiceUrl("{url}");
                                                                                    
                                                                                    var result = discovery.DeleteGateway(
                                                                                        environmentId: "{environmentId}",
                                                                                        gatewayId: "{gatewayId}"
                                                                                        );
                                                                                    
                                                                                    Console.WriteLine(result.Response);
                                                                                  • IamAuthenticator authenticator = new IamAuthenticator("{apikey}");
                                                                                    Discovery discovery = new Discovery("2019-04-30", authenticator);
                                                                                    discovery.setServiceUrl("{url}");
                                                                                    
                                                                                    String environmentId = "{environment_id}";
                                                                                    String gatewayId = "{gateway_id}";
                                                                                    
                                                                                    DeleteGatewayOptions options = new DeleteGatewayOptions.Builder()
                                                                                      .environmentId(environmentId)
                                                                                      .gatewayId(gatewayId)
                                                                                      .build();
                                                                                    
                                                                                    GatewayDelete response = discovery.deleteGateway(options).execute();
                                                                                  • const DiscoveryV1 = require('ibm-watson/discovery/v1');
                                                                                    const { IamAuthenticator } = require('ibm-watson/auth');
                                                                                    
                                                                                    const discovery = new DiscoveryV1({
                                                                                      version: '2019-04-30',
                                                                                      authenticator: new IamAuthenticator({
                                                                                        apikey: '{apikey}',
                                                                                      }),
                                                                                      serviceUrl: '{url}',
                                                                                    });
                                                                                    
                                                                                    const deleteGatewayParams = {
                                                                                      environmentId: '{environment_id}',
                                                                                      gatewayId: '{gateway_id}',
                                                                                    };
                                                                                    
                                                                                    discovery.deleteGateway(deleteGatewayParams)
                                                                                      .then(gatewayDelete => {
                                                                                        console.log(JSON.stringify(gatewayDelete, null, 2));
                                                                                      })
                                                                                      .catch(err => {
                                                                                        console.log('error:', err);
                                                                                      });

                                                                                    Response

                                                                                    Gatway deletion confirmation

                                                                                    Gatway deletion confirmation.

                                                                                    Gatway deletion confirmation.

                                                                                    Gatway deletion confirmation.

                                                                                    Gatway deletion confirmation.

                                                                                    Status Code

                                                                                    • Success

                                                                                    • Invalid or Unknown request parameters

                                                                                    • Invalid or Unknown Environment ID

                                                                                    No Sample Response

                                                                                    This method does not specify any sample responses.

                                                                                    id=curlclassName=tab-item-selected