Assistant

public class Assistant

The IBM Watson™ Assistant service combines machine learning, natural language understanding, and an integrated dialog editor to create conversation flows between your apps and your users. The Assistant v1 API provides authoring methods your application can use to create or update a workspace.

  • The base URL to use when contacting the service.

    Declaration

    Swift

    public var serviceURL: String?
  • Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is 2021-06-14.

    Declaration

    Swift

    public var version: String
  • Service identifiers

    Declaration

    Swift

    public static let defaultServiceName: String
  • The default HTTP headers for all requests to the service.

    Declaration

    Swift

    public var defaultHeaders: [String : String]
  • Undocumented

    Declaration

    Swift

    public let authenticator: Authenticator
  • Create a Assistant object.

    If an authenticator is not supplied, the initializer will retrieve credentials from the environment or a local credentials file and construct an appropriate authenticator using these credentials. The credentials file can be downloaded from your service instance on IBM Cloud as ibm-credentials.env. Make sure to add the credentials file to your project so that it can be loaded at runtime.

    If an authenticator is not supplied and credentials are not available in the environment or a local credentials file, initialization will fail by throwing an exception. In that case, try another initializer that directly passes in the credentials.

    • serviceName: String = defaultServiceName
  • Create a Assistant object.

    Declaration

    Swift

    public init(version: String, authenticator: Authenticator)

    Parameters

    version

    Release date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is 2021-06-14.

    authenticator

    The Authenticator object used to authenticate requests to the service

  • Allow network requests to a server without verification of the server certificate. IMPORTANT: This should ONLY be used if truly intended, as it is unsafe otherwise.

    Declaration

    Swift

    public func disableSSLVerification()
  • Get response to user input.

    Send user input to a workspace and receive a response. Important: This method has been superseded by the new v2 runtime API. The v2 API offers significant advantages, including ease of deployment, automatic state management, versioning, and search capabilities. For more information, see the documentation.

    Declaration

    Swift

    public func message(
        workspaceID: String,
        input: MessageInput? = nil,
        intents: [RuntimeIntent]? = nil,
        entities: [RuntimeEntity]? = nil,
        alternateIntents: Bool? = nil,
        context: Context? = nil,
        output: OutputData? = nil,
        userID: String? = nil,
        nodesVisitedDetails: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<MessageResponse>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    input

    An input object that includes the input text.

    intents

    Intents to use when evaluating the user input. Include intents from the previous response to continue using those intents rather than trying to recognize intents in the new input.

    entities

    Entities to use when evaluating the message. Include entities from the previous response to continue using those entities rather than detecting entities in the new input.

    alternateIntents

    Whether to return more than one intent. A value of true indicates that all matching intents are returned.

    context

    State information for the conversation. To maintain state, include the context from the previous response.

    output

    An output object that includes the response to the user, the dialog nodes that were triggered, and messages from the log.

    userID

    A string value that identifies the user who is interacting with the workspace. The client must provide a unique identifier for each individual end user who accesses the application. For user-based plans, this user ID is used to identify unique users for billing purposes. This string cannot contain carriage return, newline, or tab characters. If no value is specified in the input, user_id is automatically set to the value of context.conversation_id. Note: This property is the same as the user_id property in the context metadata. If user_id is specified in both locations in a message request, the value specified at the root is used.

    nodesVisitedDetails

    Whether to include additional diagnostic information about the dialog nodes that were visited during processing of the message.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Identify intents and entities in multiple user utterances.

    Send multiple user inputs to a workspace in a single request and receive information about the intents and entities recognized in each input. This method is useful for testing and comparing the performance of different workspaces. This method is available only with Enterprise with Data Isolation plans.

    Declaration

    Swift

    public func bulkClassify(
        workspaceID: String,
        input: [BulkClassifyUtterance]? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<BulkClassifyResponse>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    input

    An array of input utterances to classify.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • List workspaces.

    List the workspaces associated with a Watson Assistant service instance.

    Declaration

    Swift

    public func listWorkspaces(
        pageLimit: Int? = nil,
        includeCount: Bool? = nil,
        sort: String? = nil,
        cursor: String? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<WorkspaceCollection>?, WatsonError?) -> Void)

    Parameters

    pageLimit

    The number of records to return in each page of results.

    includeCount

    Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is true, the pagination object in the response includes the total property.

    sort

    The attribute by which returned workspaces will be sorted. To reverse the sort order, prefix the value with a minus sign (-).

    cursor

    A token identifying the page of results to retrieve.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Create workspace.

    Create a workspace based on component objects. You must provide workspace components defining the content of the new workspace.

    Declaration

    Swift

    public func createWorkspace(
        name: String? = nil,
        description: String? = nil,
        language: String? = nil,
        dialogNodes: [DialogNode]? = nil,
        counterexamples: [Counterexample]? = nil,
        metadata: [String: JSON]? = nil,
        learningOptOut: Bool? = nil,
        systemSettings: WorkspaceSystemSettings? = nil,
        webhooks: [Webhook]? = nil,
        intents: [CreateIntent]? = nil,
        entities: [CreateEntity]? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Workspace>?, WatsonError?) -> Void)

    Parameters

    name

    The name of the workspace. This string cannot contain carriage return, newline, or tab characters.

    description

    The description of the workspace. This string cannot contain carriage return, newline, or tab characters.

    language

    The language of the workspace.

    dialogNodes

    An array of objects describing the dialog nodes in the workspace.

    counterexamples

    An array of objects defining input examples that have been marked as irrelevant input.

    metadata

    Any metadata related to the workspace.

    learningOptOut

    Whether training data from the workspace (including artifacts such as intents and entities) can be used by IBM for general service improvements. true indicates that workspace training data is not to be used.

    systemSettings

    Global settings for the workspace.

    webhooks

    intents

    An array of objects defining the intents for the workspace.

    entities

    An array of objects describing the entities for the workspace.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Get information about a workspace.

    Get information about a workspace, optionally including all workspace content.

    Declaration

    Swift

    public func getWorkspace(
        workspaceID: String,
        export: Bool? = nil,
        includeAudit: Bool? = nil,
        sort: String? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Workspace>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    export

    Whether to include all element content in the returned data. If export=false, the returned data includes only information about the element itself. If export=true, all content, including subelements, is included.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    sort

    Indicates how the returned workspace data will be sorted. This parameter is valid only if export=true. Specify sort=stable to sort all workspace objects by unique identifier, in ascending alphabetical order.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Update workspace.

    Update an existing workspace with new or modified data. You must provide component objects defining the content of the updated workspace.

    Declaration

    Swift

    public func updateWorkspace(
        workspaceID: String,
        name: String? = nil,
        description: String? = nil,
        language: String? = nil,
        dialogNodes: [DialogNode]? = nil,
        counterexamples: [Counterexample]? = nil,
        metadata: [String: JSON]? = nil,
        learningOptOut: Bool? = nil,
        systemSettings: WorkspaceSystemSettings? = nil,
        webhooks: [Webhook]? = nil,
        intents: [CreateIntent]? = nil,
        entities: [CreateEntity]? = nil,
        append: Bool? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Workspace>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    name

    The name of the workspace. This string cannot contain carriage return, newline, or tab characters.

    description

    The description of the workspace. This string cannot contain carriage return, newline, or tab characters.

    language

    The language of the workspace.

    dialogNodes

    An array of objects describing the dialog nodes in the workspace.

    counterexamples

    An array of objects defining input examples that have been marked as irrelevant input.

    metadata

    Any metadata related to the workspace.

    learningOptOut

    Whether training data from the workspace (including artifacts such as intents and entities) can be used by IBM for general service improvements. true indicates that workspace training data is not to be used.

    systemSettings

    Global settings for the workspace.

    webhooks

    intents

    An array of objects defining the intents for the workspace.

    entities

    An array of objects describing the entities for the workspace.

    append

    Whether the new data is to be appended to the existing data in the object. If append=false, elements included in the new data completely replace the corresponding existing elements, including all subelements. For example, if the new data for a workspace includes entities and append=false, all existing entities in the workspace are discarded and replaced with the new entities. If append=true, existing elements are preserved, and the new elements are added. If any elements in the new data collide with existing elements, the update request fails.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Delete workspace.

    Delete a workspace from the service instance.

    Declaration

    Swift

    public func deleteWorkspace(
        workspaceID: String,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Void>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • List intents.

    List the intents for a workspace.

    Declaration

    Swift

    public func listIntents(
        workspaceID: String,
        export: Bool? = nil,
        pageLimit: Int? = nil,
        includeCount: Bool? = nil,
        sort: String? = nil,
        cursor: String? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<IntentCollection>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    export

    Whether to include all element content in the returned data. If export=false, the returned data includes only information about the element itself. If export=true, all content, including subelements, is included.

    pageLimit

    The number of records to return in each page of results.

    includeCount

    Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is true, the pagination object in the response includes the total property.

    sort

    The attribute by which returned intents will be sorted. To reverse the sort order, prefix the value with a minus sign (-).

    cursor

    A token identifying the page of results to retrieve.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Create intent.

    Create a new intent. If you want to create multiple intents with a single API call, consider using the Update workspace method instead.

    Declaration

    Swift

    public func createIntent(
        workspaceID: String,
        intent: String,
        description: String? = nil,
        examples: [Example]? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Intent>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    intent

    The name of the intent. This string must conform to the following restrictions:

    • It can contain only Unicode alphanumeric, underscore, hyphen, and dot characters.
    • It cannot begin with the reserved prefix sys-.

    description

    The description of the intent. This string cannot contain carriage return, newline, or tab characters.

    examples

    An array of user input examples for the intent.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Get intent.

    Get information about an intent, optionally including all intent content.

    Declaration

    Swift

    public func getIntent(
        workspaceID: String,
        intent: String,
        export: Bool? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Intent>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    intent

    The intent name.

    export

    Whether to include all element content in the returned data. If export=false, the returned data includes only information about the element itself. If export=true, all content, including subelements, is included.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Update intent.

    Update an existing intent with new or modified data. You must provide component objects defining the content of the updated intent. If you want to update multiple intents with a single API call, consider using the Update workspace method instead.

    Declaration

    Swift

    public func updateIntent(
        workspaceID: String,
        intent: String,
        newIntent: String? = nil,
        newDescription: String? = nil,
        newExamples: [Example]? = nil,
        append: Bool? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Intent>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    intent

    The intent name.

    newIntent

    The name of the intent. This string must conform to the following restrictions:

    • It can contain only Unicode alphanumeric, underscore, hyphen, and dot characters.
    • It cannot begin with the reserved prefix sys-.

    newDescription

    The description of the intent. This string cannot contain carriage return, newline, or tab characters.

    newExamples

    An array of user input examples for the intent.

    append

    Whether the new data is to be appended to the existing data in the object. If append=false, elements included in the new data completely replace the corresponding existing elements, including all subelements. For example, if the new data for the intent includes examples and append=false, all existing examples for the intent are discarded and replaced with the new examples. If append=true, existing elements are preserved, and the new elements are added. If any elements in the new data collide with existing elements, the update request fails.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Delete intent.

    Delete an intent from a workspace.

    Declaration

    Swift

    public func deleteIntent(
        workspaceID: String,
        intent: String,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Void>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    intent

    The intent name.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • List user input examples.

    List the user input examples for an intent, optionally including contextual entity mentions.

    Declaration

    Swift

    public func listExamples(
        workspaceID: String,
        intent: String,
        pageLimit: Int? = nil,
        includeCount: Bool? = nil,
        sort: String? = nil,
        cursor: String? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<ExampleCollection>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    intent

    The intent name.

    pageLimit

    The number of records to return in each page of results.

    includeCount

    Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is true, the pagination object in the response includes the total property.

    sort

    The attribute by which returned examples will be sorted. To reverse the sort order, prefix the value with a minus sign (-).

    cursor

    A token identifying the page of results to retrieve.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Create user input example.

    Add a new user input example to an intent. If you want to add multiple examples with a single API call, consider using the Update intent method instead.

    Declaration

    Swift

    public func createExample(
        workspaceID: String,
        intent: String,
        text: String,
        mentions: [Mention]? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Example>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    intent

    The intent name.

    text

    The text of a user input example. This string must conform to the following restrictions:

    • It cannot contain carriage return, newline, or tab characters.
    • It cannot consist of only whitespace characters.

    mentions

    An array of contextual entity mentions.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Get user input example.

    Get information about a user input example.

    Declaration

    Swift

    public func getExample(
        workspaceID: String,
        intent: String,
        text: String,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Example>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    intent

    The intent name.

    text

    The text of the user input example.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Update user input example.

    Update the text of a user input example. If you want to update multiple examples with a single API call, consider using the Update intent method instead.

    Declaration

    Swift

    public func updateExample(
        workspaceID: String,
        intent: String,
        text: String,
        newText: String? = nil,
        newMentions: [Mention]? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Example>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    intent

    The intent name.

    text

    The text of the user input example.

    newText

    The text of the user input example. This string must conform to the following restrictions:

    • It cannot contain carriage return, newline, or tab characters.
    • It cannot consist of only whitespace characters.

    newMentions

    An array of contextual entity mentions.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Delete user input example.

    Delete a user input example from an intent.

    Declaration

    Swift

    public func deleteExample(
        workspaceID: String,
        intent: String,
        text: String,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Void>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    intent

    The intent name.

    text

    The text of the user input example.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • List counterexamples.

    List the counterexamples for a workspace. Counterexamples are examples that have been marked as irrelevant input.

    Declaration

    Swift

    public func listCounterexamples(
        workspaceID: String,
        pageLimit: Int? = nil,
        includeCount: Bool? = nil,
        sort: String? = nil,
        cursor: String? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<CounterexampleCollection>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    pageLimit

    The number of records to return in each page of results.

    includeCount

    Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is true, the pagination object in the response includes the total property.

    sort

    The attribute by which returned counterexamples will be sorted. To reverse the sort order, prefix the value with a minus sign (-).

    cursor

    A token identifying the page of results to retrieve.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Create counterexample.

    Add a new counterexample to a workspace. Counterexamples are examples that have been marked as irrelevant input. If you want to add multiple counterexamples with a single API call, consider using the Update workspace method instead.

    Declaration

    Swift

    public func createCounterexample(
        workspaceID: String,
        text: String,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Counterexample>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    text

    The text of a user input marked as irrelevant input. This string must conform to the following restrictions:

    • It cannot contain carriage return, newline, or tab characters.
    • It cannot consist of only whitespace characters.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Get counterexample.

    Get information about a counterexample. Counterexamples are examples that have been marked as irrelevant input.

    Declaration

    Swift

    public func getCounterexample(
        workspaceID: String,
        text: String,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Counterexample>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    text

    The text of a user input counterexample (for example, What are you wearing?).

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Update counterexample.

    Update the text of a counterexample. Counterexamples are examples that have been marked as irrelevant input.

    Declaration

    Swift

    public func updateCounterexample(
        workspaceID: String,
        text: String,
        newText: String? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Counterexample>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    text

    The text of a user input counterexample (for example, What are you wearing?).

    newText

    The text of a user input marked as irrelevant input. This string must conform to the following restrictions:

    • It cannot contain carriage return, newline, or tab characters.
    • It cannot consist of only whitespace characters.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Delete counterexample.

    Delete a counterexample from a workspace. Counterexamples are examples that have been marked as irrelevant input.

    Declaration

    Swift

    public func deleteCounterexample(
        workspaceID: String,
        text: String,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Void>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    text

    The text of a user input counterexample (for example, What are you wearing?).

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • List entities.

    List the entities for a workspace.

    Declaration

    Swift

    public func listEntities(
        workspaceID: String,
        export: Bool? = nil,
        pageLimit: Int? = nil,
        includeCount: Bool? = nil,
        sort: String? = nil,
        cursor: String? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<EntityCollection>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    export

    Whether to include all element content in the returned data. If export=false, the returned data includes only information about the element itself. If export=true, all content, including subelements, is included.

    pageLimit

    The number of records to return in each page of results.

    includeCount

    Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is true, the pagination object in the response includes the total property.

    sort

    The attribute by which returned entities will be sorted. To reverse the sort order, prefix the value with a minus sign (-).

    cursor

    A token identifying the page of results to retrieve.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Create entity.

    Create a new entity, or enable a system entity. If you want to create multiple entities with a single API call, consider using the Update workspace method instead.

    Declaration

    Swift

    public func createEntity(
        workspaceID: String,
        entity: String,
        description: String? = nil,
        metadata: [String: JSON]? = nil,
        fuzzyMatch: Bool? = nil,
        values: [CreateValue]? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Entity>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    entity

    The name of the entity. This string must conform to the following restrictions:

    • It can contain only Unicode alphanumeric, underscore, and hyphen characters.
    • If you specify an entity name beginning with the reserved prefix sys-, it must be the name of a system entity that you want to enable. (Any entity content specified with the request is ignored.).

    description

    The description of the entity. This string cannot contain carriage return, newline, or tab characters.

    metadata

    Any metadata related to the entity.

    fuzzyMatch

    Whether to use fuzzy matching for the entity.

    values

    An array of objects describing the entity values.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Get entity.

    Get information about an entity, optionally including all entity content.

    Declaration

    Swift

    public func getEntity(
        workspaceID: String,
        entity: String,
        export: Bool? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Entity>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    entity

    The name of the entity.

    export

    Whether to include all element content in the returned data. If export=false, the returned data includes only information about the element itself. If export=true, all content, including subelements, is included.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Update entity.

    Update an existing entity with new or modified data. You must provide component objects defining the content of the updated entity. If you want to update multiple entities with a single API call, consider using the Update workspace method instead.

    Declaration

    Swift

    public func updateEntity(
        workspaceID: String,
        entity: String,
        newEntity: String? = nil,
        newDescription: String? = nil,
        newMetadata: [String: JSON]? = nil,
        newFuzzyMatch: Bool? = nil,
        newValues: [CreateValue]? = nil,
        append: Bool? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Entity>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    entity

    The name of the entity.

    newEntity

    The name of the entity. This string must conform to the following restrictions:

    • It can contain only Unicode alphanumeric, underscore, and hyphen characters.
    • It cannot begin with the reserved prefix sys-.

    newDescription

    The description of the entity. This string cannot contain carriage return, newline, or tab characters.

    newMetadata

    Any metadata related to the entity.

    newFuzzyMatch

    Whether to use fuzzy matching for the entity.

    newValues

    An array of objects describing the entity values.

    append

    Whether the new data is to be appended to the existing data in the entity. If append=false, elements included in the new data completely replace the corresponding existing elements, including all subelements. For example, if the new data for the entity includes values and append=false, all existing values for the entity are discarded and replaced with the new values. If append=true, existing elements are preserved, and the new elements are added. If any elements in the new data collide with existing elements, the update request fails.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Delete entity.

    Delete an entity from a workspace, or disable a system entity.

    Declaration

    Swift

    public func deleteEntity(
        workspaceID: String,
        entity: String,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Void>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    entity

    The name of the entity.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • List entity mentions.

    List mentions for a contextual entity. An entity mention is an occurrence of a contextual entity in the context of an intent user input example.

    Declaration

    Swift

    public func listMentions(
        workspaceID: String,
        entity: String,
        export: Bool? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<EntityMentionCollection>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    entity

    The name of the entity.

    export

    Whether to include all element content in the returned data. If export=false, the returned data includes only information about the element itself. If export=true, all content, including subelements, is included.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • List entity values.

    List the values for an entity.

    Declaration

    Swift

    public func listValues(
        workspaceID: String,
        entity: String,
        export: Bool? = nil,
        pageLimit: Int? = nil,
        includeCount: Bool? = nil,
        sort: String? = nil,
        cursor: String? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<ValueCollection>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    entity

    The name of the entity.

    export

    Whether to include all element content in the returned data. If export=false, the returned data includes only information about the element itself. If export=true, all content, including subelements, is included.

    pageLimit

    The number of records to return in each page of results.

    includeCount

    Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is true, the pagination object in the response includes the total property.

    sort

    The attribute by which returned entity values will be sorted. To reverse the sort order, prefix the value with a minus sign (-).

    cursor

    A token identifying the page of results to retrieve.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Create entity value.

    Create a new value for an entity. If you want to create multiple entity values with a single API call, consider using the Update entity method instead.

    Declaration

    Swift

    public func createValue(
        workspaceID: String,
        entity: String,
        value: String,
        metadata: [String: JSON]? = nil,
        type: String? = nil,
        synonyms: [String]? = nil,
        patterns: [String]? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Value>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    entity

    The name of the entity.

    value

    The text of the entity value. This string must conform to the following restrictions:

    • It cannot contain carriage return, newline, or tab characters.
    • It cannot consist of only whitespace characters.

    metadata

    Any metadata related to the entity value.

    type

    Specifies the type of entity value.

    synonyms

    An array of synonyms for the entity value. A value can specify either synonyms or patterns (depending on the value type), but not both. A synonym must conform to the following resrictions:

    • It cannot contain carriage return, newline, or tab characters.
    • It cannot consist of only whitespace characters.

    patterns

    An array of patterns for the entity value. A value can specify either synonyms or patterns (depending on the value type), but not both. A pattern is a regular expression; for more information about how to specify a pattern, see the documentation.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Get entity value.

    Get information about an entity value.

    Declaration

    Swift

    public func getValue(
        workspaceID: String,
        entity: String,
        value: String,
        export: Bool? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Value>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    entity

    The name of the entity.

    value

    The text of the entity value.

    export

    Whether to include all element content in the returned data. If export=false, the returned data includes only information about the element itself. If export=true, all content, including subelements, is included.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Update entity value.

    Update an existing entity value with new or modified data. You must provide component objects defining the content of the updated entity value. If you want to update multiple entity values with a single API call, consider using the Update entity method instead.

    Declaration

    Swift

    public func updateValue(
        workspaceID: String,
        entity: String,
        value: String,
        newValue: String? = nil,
        newMetadata: [String: JSON]? = nil,
        newType: String? = nil,
        newSynonyms: [String]? = nil,
        newPatterns: [String]? = nil,
        append: Bool? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Value>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    entity

    The name of the entity.

    value

    The text of the entity value.

    newValue

    The text of the entity value. This string must conform to the following restrictions:

    • It cannot contain carriage return, newline, or tab characters.
    • It cannot consist of only whitespace characters.

    newMetadata

    Any metadata related to the entity value.

    newType

    Specifies the type of entity value.

    newSynonyms

    An array of synonyms for the entity value. A value can specify either synonyms or patterns (depending on the value type), but not both. A synonym must conform to the following resrictions:

    • It cannot contain carriage return, newline, or tab characters.
    • It cannot consist of only whitespace characters.

    newPatterns

    An array of patterns for the entity value. A value can specify either synonyms or patterns (depending on the value type), but not both. A pattern is a regular expression; for more information about how to specify a pattern, see the documentation.

    append

    Whether the new data is to be appended to the existing data in the entity value. If append=false, elements included in the new data completely replace the corresponding existing elements, including all subelements. For example, if the new data for the entity value includes synonyms and append=false, all existing synonyms for the entity value are discarded and replaced with the new synonyms. If append=true, existing elements are preserved, and the new elements are added. If any elements in the new data collide with existing elements, the update request fails.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Delete entity value.

    Delete a value from an entity.

    Declaration

    Swift

    public func deleteValue(
        workspaceID: String,
        entity: String,
        value: String,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Void>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    entity

    The name of the entity.

    value

    The text of the entity value.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • List entity value synonyms.

    List the synonyms for an entity value.

    Declaration

    Swift

    public func listSynonyms(
        workspaceID: String,
        entity: String,
        value: String,
        pageLimit: Int? = nil,
        includeCount: Bool? = nil,
        sort: String? = nil,
        cursor: String? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<SynonymCollection>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    entity

    The name of the entity.

    value

    The text of the entity value.

    pageLimit

    The number of records to return in each page of results.

    includeCount

    Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is true, the pagination object in the response includes the total property.

    sort

    The attribute by which returned entity value synonyms will be sorted. To reverse the sort order, prefix the value with a minus sign (-).

    cursor

    A token identifying the page of results to retrieve.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Create entity value synonym.

    Add a new synonym to an entity value. If you want to create multiple synonyms with a single API call, consider using the Update entity or Update entity value method instead.

    Declaration

    Swift

    public func createSynonym(
        workspaceID: String,
        entity: String,
        value: String,
        synonym: String,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Synonym>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    entity

    The name of the entity.

    value

    The text of the entity value.

    synonym

    The text of the synonym. This string must conform to the following restrictions:

    • It cannot contain carriage return, newline, or tab characters.
    • It cannot consist of only whitespace characters.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Get entity value synonym.

    Get information about a synonym of an entity value.

    Declaration

    Swift

    public func getSynonym(
        workspaceID: String,
        entity: String,
        value: String,
        synonym: String,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Synonym>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    entity

    The name of the entity.

    value

    The text of the entity value.

    synonym

    The text of the synonym.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Update entity value synonym.

    Update an existing entity value synonym with new text. If you want to update multiple synonyms with a single API call, consider using the Update entity or Update entity value method instead.

    Declaration

    Swift

    public func updateSynonym(
        workspaceID: String,
        entity: String,
        value: String,
        synonym: String,
        newSynonym: String? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Synonym>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    entity

    The name of the entity.

    value

    The text of the entity value.

    synonym

    The text of the synonym.

    newSynonym

    The text of the synonym. This string must conform to the following restrictions:

    • It cannot contain carriage return, newline, or tab characters.
    • It cannot consist of only whitespace characters.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Delete entity value synonym.

    Delete a synonym from an entity value.

    Declaration

    Swift

    public func deleteSynonym(
        workspaceID: String,
        entity: String,
        value: String,
        synonym: String,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Void>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    entity

    The name of the entity.

    value

    The text of the entity value.

    synonym

    The text of the synonym.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • List dialog nodes.

    List the dialog nodes for a workspace.

    Declaration

    Swift

    public func listDialogNodes(
        workspaceID: String,
        pageLimit: Int? = nil,
        includeCount: Bool? = nil,
        sort: String? = nil,
        cursor: String? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<DialogNodeCollection>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    pageLimit

    The number of records to return in each page of results.

    includeCount

    Whether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is true, the pagination object in the response includes the total property.

    sort

    The attribute by which returned dialog nodes will be sorted. To reverse the sort order, prefix the value with a minus sign (-).

    cursor

    A token identifying the page of results to retrieve.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Create dialog node.

    Create a new dialog node. If you want to create multiple dialog nodes with a single API call, consider using the Update workspace method instead.

    Declaration

    Swift

    public func createDialogNode(
        workspaceID: String,
        dialogNode: String,
        description: String? = nil,
        conditions: String? = nil,
        parent: String? = nil,
        previousSibling: String? = nil,
        output: DialogNodeOutput? = nil,
        context: DialogNodeContext? = nil,
        metadata: [String: JSON]? = nil,
        nextStep: DialogNodeNextStep? = nil,
        title: String? = nil,
        type: String? = nil,
        eventName: String? = nil,
        variable: String? = nil,
        actions: [DialogNodeAction]? = nil,
        digressIn: String? = nil,
        digressOut: String? = nil,
        digressOutSlots: String? = nil,
        userLabel: String? = nil,
        disambiguationOptOut: Bool? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<DialogNode>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    dialogNode

    The unique ID of the dialog node. This is an internal identifier used to refer to the dialog node from other dialog nodes and in the diagnostic information included with message responses. This string can contain only Unicode alphanumeric, space, underscore, hyphen, and dot characters.

    description

    The description of the dialog node. This string cannot contain carriage return, newline, or tab characters.

    conditions

    The condition that will trigger the dialog node. This string cannot contain carriage return, newline, or tab characters.

    parent

    The unique ID of the parent dialog node. This property is omitted if the dialog node has no parent.

    previousSibling

    The unique ID of the previous sibling dialog node. This property is omitted if the dialog node has no previous sibling.

    output

    The output of the dialog node. For more information about how to specify dialog node output, see the documentation.

    context

    The context for the dialog node.

    metadata

    The metadata for the dialog node.

    nextStep

    The next step to execute following this dialog node.

    title

    A human-readable name for the dialog node. If the node is included in disambiguation, this title is used to populate the label property of the corresponding suggestion in the suggestion response type (unless it is overridden by the user_label property). The title is also used to populate the topic property in the connect_to_agent response type. This string can contain only Unicode alphanumeric, space, underscore, hyphen, and dot characters.

    type

    How the dialog node is processed.

    eventName

    How an event_handler node is processed.

    variable

    The location in the dialog context where output is stored.

    actions

    An array of objects describing any actions to be invoked by the dialog node.

    digressIn

    Whether this top-level dialog node can be digressed into.

    digressOut

    Whether this dialog node can be returned to after a digression.

    digressOutSlots

    Whether the user can digress to top-level nodes while filling out slots.

    userLabel

    A label that can be displayed externally to describe the purpose of the node to users. If set, this label is used to identify the node in disambiguation responses (overriding the value of the title property).

    disambiguationOptOut

    Whether the dialog node should be excluded from disambiguation suggestions. Valid only when type=standard or frame.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Get dialog node.

    Get information about a dialog node.

    Declaration

    Swift

    public func getDialogNode(
        workspaceID: String,
        dialogNode: String,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<DialogNode>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    dialogNode

    The dialog node ID (for example, node_1_1479323581900).

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Update dialog node.

    Update an existing dialog node with new or modified data. If you want to update multiple dialog nodes with a single API call, consider using the Update workspace method instead.

    Declaration

    Swift

    public func updateDialogNode(
        workspaceID: String,
        dialogNode: String,
        newDialogNode: String? = nil,
        newDescription: String? = nil,
        newConditions: String? = nil,
        newParent: String? = nil,
        newPreviousSibling: String? = nil,
        newOutput: DialogNodeOutput? = nil,
        newContext: DialogNodeContext? = nil,
        newMetadata: [String: JSON]? = nil,
        newNextStep: DialogNodeNextStep? = nil,
        newTitle: String? = nil,
        newType: String? = nil,
        newEventName: String? = nil,
        newVariable: String? = nil,
        newActions: [DialogNodeAction]? = nil,
        newDigressIn: String? = nil,
        newDigressOut: String? = nil,
        newDigressOutSlots: String? = nil,
        newUserLabel: String? = nil,
        newDisambiguationOptOut: Bool? = nil,
        includeAudit: Bool? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<DialogNode>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    dialogNode

    The dialog node ID (for example, node_1_1479323581900).

    newDialogNode

    The unique ID of the dialog node. This is an internal identifier used to refer to the dialog node from other dialog nodes and in the diagnostic information included with message responses. This string can contain only Unicode alphanumeric, space, underscore, hyphen, and dot characters.

    newDescription

    The description of the dialog node. This string cannot contain carriage return, newline, or tab characters.

    newConditions

    The condition that will trigger the dialog node. This string cannot contain carriage return, newline, or tab characters.

    newParent

    The unique ID of the parent dialog node. This property is omitted if the dialog node has no parent.

    newPreviousSibling

    The unique ID of the previous sibling dialog node. This property is omitted if the dialog node has no previous sibling.

    newOutput

    The output of the dialog node. For more information about how to specify dialog node output, see the documentation.

    newContext

    The context for the dialog node.

    newMetadata

    The metadata for the dialog node.

    newNextStep

    The next step to execute following this dialog node.

    newTitle

    A human-readable name for the dialog node. If the node is included in disambiguation, this title is used to populate the label property of the corresponding suggestion in the suggestion response type (unless it is overridden by the user_label property). The title is also used to populate the topic property in the connect_to_agent response type. This string can contain only Unicode alphanumeric, space, underscore, hyphen, and dot characters.

    newType

    How the dialog node is processed.

    newEventName

    How an event_handler node is processed.

    newVariable

    The location in the dialog context where output is stored.

    newActions

    An array of objects describing any actions to be invoked by the dialog node.

    newDigressIn

    Whether this top-level dialog node can be digressed into.

    newDigressOut

    Whether this dialog node can be returned to after a digression.

    newDigressOutSlots

    Whether the user can digress to top-level nodes while filling out slots.

    newUserLabel

    A label that can be displayed externally to describe the purpose of the node to users. If set, this label is used to identify the node in disambiguation responses (overriding the value of the title property).

    newDisambiguationOptOut

    Whether the dialog node should be excluded from disambiguation suggestions. Valid only when type=standard or frame.

    includeAudit

    Whether to include the audit properties (created and updated timestamps) in the response.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • Delete dialog node.

    Delete a dialog node from a workspace.

    Declaration

    Swift

    public func deleteDialogNode(
        workspaceID: String,
        dialogNode: String,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Void>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    dialogNode

    The dialog node ID (for example, node_1_1479323581900).

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • List log events in a workspace.

    List the events from the log of a specific workspace. This method requires Manager access.

    Declaration

    Swift

    public func listLogs(
        workspaceID: String,
        sort: String? = nil,
        filter: String? = nil,
        pageLimit: Int? = nil,
        cursor: String? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<LogCollection>?, WatsonError?) -> Void)

    Parameters

    workspaceID

    Unique identifier of the workspace.

    sort

    How to sort the returned log events. You can sort by request_timestamp. To reverse the sort order, prefix the parameter value with a minus sign (-).

    filter

    A cacheable parameter that limits the results to those matching the specified filter. For more information, see the documentation.

    pageLimit

    The number of records to return in each page of results.

    cursor

    A token identifying the page of results to retrieve.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • List log events in all workspaces.

    List the events from the logs of all workspaces in the service instance.

    Declaration

    Swift

    public func listAllLogs(
        filter: String,
        sort: String? = nil,
        pageLimit: Int? = nil,
        cursor: String? = nil,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<LogCollection>?, WatsonError?) -> Void)

    Parameters

    filter

    A cacheable parameter that limits the results to those matching the specified filter. You must specify a filter query that includes a value for language, as well as a value for request.context.system.assistant_id, workspace_id, or request.context.metadata.deployment. These required filters must be specified using the exact match (::) operator. For more information, see the documentation.

    sort

    How to sort the returned log events. You can sort by request_timestamp. To reverse the sort order, prefix the parameter value with a minus sign (-).

    pageLimit

    The number of records to return in each page of results.

    cursor

    A token identifying the page of results to retrieve.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error

  • 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. Note: This operation is intended only for deleting data associated with a single specific customer, not for deleting data associated with multiple customers or for any other purpose. For more information, see Labeling and deleting data in Watson Assistant.

    Declaration

    Swift

    public func deleteUserData(
        customerID: String,
        headers: [String: String]? = nil,
        completionHandler: @escaping (WatsonResponse<Void>?, WatsonError?) -> Void)

    Parameters

    customerID

    The customer ID for which all data is to be deleted.

    headers

    A dictionary of request headers to be sent with this request.

    completionHandler

    A function executed when the request completes with a successful result or error