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
Assistantobject.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
Assistantobject.Declaration
Swift
public init(version: String, authenticator: Authenticator)Parameters
versionRelease date of the API version you want to use. Specify dates in YYYY-MM-DD format. The current version is
2021-06-14.authenticatorThe 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() -
message(workspaceID:input: intents: entities: alternateIntents: context: output: userID: nodesVisitedDetails: headers: completionHandler: ) 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
workspaceIDUnique identifier of the workspace.
inputAn input object that includes the input text.
intentsIntents 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.
entitiesEntities 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.
alternateIntentsWhether to return more than one intent. A value of
trueindicates that all matching intents are returned.contextState information for the conversation. To maintain state, include the context from the previous response.
outputAn output object that includes the response to the user, the dialog nodes that were triggered, and messages from the log.
userIDA 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.
nodesVisitedDetailsWhether to include additional diagnostic information about the dialog nodes that were visited during processing of the message.
headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
inputAn array of input utterances to classify.
headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
pageLimitThe number of records to return in each page of results.
includeCountWhether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true, thepaginationobject in the response includes thetotalproperty.sortThe attribute by which returned workspaces will be sorted. To reverse the sort order, prefix the value with a minus sign (
-).cursorA token identifying the page of results to retrieve.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA function executed when the request completes with a successful result or error
-
createWorkspace(name:description: language: dialogNodes: counterexamples: metadata: learningOptOut: systemSettings: webhooks: intents: entities: includeAudit: headers: completionHandler: ) 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
nameThe name of the workspace. This string cannot contain carriage return, newline, or tab characters.
descriptionThe description of the workspace. This string cannot contain carriage return, newline, or tab characters.
languageThe language of the workspace.
dialogNodesAn array of objects describing the dialog nodes in the workspace.
counterexamplesAn array of objects defining input examples that have been marked as irrelevant input.
metadataAny metadata related to the workspace.
learningOptOutWhether training data from the workspace (including artifacts such as intents and entities) can be used by IBM for general service improvements.
trueindicates that workspace training data is not to be used.systemSettingsGlobal settings for the workspace.
webhooksintentsAn array of objects defining the intents for the workspace.
entitiesAn array of objects describing the entities for the workspace.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
exportWhether 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.includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.sortIndicates how the returned workspace data will be sorted. This parameter is valid only if export=
true. Specifysort=stableto sort all workspace objects by unique identifier, in ascending alphabetical order.headersA dictionary of request headers to be sent with this request.
completionHandlerA function executed when the request completes with a successful result or error
-
updateWorkspace(workspaceID:name: description: language: dialogNodes: counterexamples: metadata: learningOptOut: systemSettings: webhooks: intents: entities: append: includeAudit: headers: completionHandler: ) 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
workspaceIDUnique identifier of the workspace.
nameThe name of the workspace. This string cannot contain carriage return, newline, or tab characters.
descriptionThe description of the workspace. This string cannot contain carriage return, newline, or tab characters.
languageThe language of the workspace.
dialogNodesAn array of objects describing the dialog nodes in the workspace.
counterexamplesAn array of objects defining input examples that have been marked as irrelevant input.
metadataAny metadata related to the workspace.
learningOptOutWhether training data from the workspace (including artifacts such as intents and entities) can be used by IBM for general service improvements.
trueindicates that workspace training data is not to be used.systemSettingsGlobal settings for the workspace.
webhooksintentsAn array of objects defining the intents for the workspace.
entitiesAn array of objects describing the entities for the workspace.
appendWhether 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.includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
headersA dictionary of request headers to be sent with this request.
completionHandlerA function executed when the request completes with a successful result or error
-
listIntents(workspaceID:export: pageLimit: includeCount: sort: cursor: includeAudit: headers: completionHandler: ) 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
workspaceIDUnique identifier of the workspace.
exportWhether 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.pageLimitThe number of records to return in each page of results.
includeCountWhether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true, thepaginationobject in the response includes thetotalproperty.sortThe attribute by which returned intents will be sorted. To reverse the sort order, prefix the value with a minus sign (
-).cursorA token identifying the page of results to retrieve.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
intentThe 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-.
descriptionThe description of the intent. This string cannot contain carriage return, newline, or tab characters.
examplesAn array of user input examples for the intent.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
intentThe intent name.
exportWhether 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.includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA function executed when the request completes with a successful result or error
-
updateIntent(workspaceID:intent: newIntent: newDescription: newExamples: append: includeAudit: headers: completionHandler: ) 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
workspaceIDUnique identifier of the workspace.
intentThe intent name.
newIntentThe 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-.
newDescriptionThe description of the intent. This string cannot contain carriage return, newline, or tab characters.
newExamplesAn array of user input examples for the intent.
appendWhether 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.includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
intentThe intent name.
headersA dictionary of request headers to be sent with this request.
completionHandlerA function executed when the request completes with a successful result or error
-
listExamples(workspaceID:intent: pageLimit: includeCount: sort: cursor: includeAudit: headers: completionHandler: ) 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
workspaceIDUnique identifier of the workspace.
intentThe intent name.
pageLimitThe number of records to return in each page of results.
includeCountWhether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true, thepaginationobject in the response includes thetotalproperty.sortThe attribute by which returned examples will be sorted. To reverse the sort order, prefix the value with a minus sign (
-).cursorA token identifying the page of results to retrieve.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
intentThe intent name.
textThe 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.
mentionsAn array of contextual entity mentions.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
intentThe intent name.
textThe text of the user input example.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
intentThe intent name.
textThe text of the user input example.
newTextThe 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.
newMentionsAn array of contextual entity mentions.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
intentThe intent name.
textThe text of the user input example.
headersA dictionary of request headers to be sent with this request.
completionHandlerA function executed when the request completes with a successful result or error
-
listCounterexamples(workspaceID:pageLimit: includeCount: sort: cursor: includeAudit: headers: completionHandler: ) 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
workspaceIDUnique identifier of the workspace.
pageLimitThe number of records to return in each page of results.
includeCountWhether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true, thepaginationobject in the response includes thetotalproperty.sortThe attribute by which returned counterexamples will be sorted. To reverse the sort order, prefix the value with a minus sign (
-).cursorA token identifying the page of results to retrieve.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
textThe 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.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
textThe text of a user input counterexample (for example,
What are you wearing?).includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
textThe text of a user input counterexample (for example,
What are you wearing?).newTextThe 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.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
textThe text of a user input counterexample (for example,
What are you wearing?).headersA dictionary of request headers to be sent with this request.
completionHandlerA function executed when the request completes with a successful result or error
-
listEntities(workspaceID:export: pageLimit: includeCount: sort: cursor: includeAudit: headers: completionHandler: ) 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
workspaceIDUnique identifier of the workspace.
exportWhether 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.pageLimitThe number of records to return in each page of results.
includeCountWhether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true, thepaginationobject in the response includes thetotalproperty.sortThe attribute by which returned entities will be sorted. To reverse the sort order, prefix the value with a minus sign (
-).cursorA token identifying the page of results to retrieve.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA function executed when the request completes with a successful result or error
-
createEntity(workspaceID:entity: description: metadata: fuzzyMatch: values: includeAudit: headers: completionHandler: ) 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
workspaceIDUnique identifier of the workspace.
entityThe 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.).
descriptionThe description of the entity. This string cannot contain carriage return, newline, or tab characters.
metadataAny metadata related to the entity.
fuzzyMatchWhether to use fuzzy matching for the entity.
valuesAn array of objects describing the entity values.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
entityThe name of the entity.
exportWhether 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.includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA function executed when the request completes with a successful result or error
-
updateEntity(workspaceID:entity: newEntity: newDescription: newMetadata: newFuzzyMatch: newValues: append: includeAudit: headers: completionHandler: ) 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
workspaceIDUnique identifier of the workspace.
entityThe name of the entity.
newEntityThe 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-.
newDescriptionThe description of the entity. This string cannot contain carriage return, newline, or tab characters.
newMetadataAny metadata related to the entity.
newFuzzyMatchWhether to use fuzzy matching for the entity.
newValuesAn array of objects describing the entity values.
appendWhether 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.includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
entityThe name of the entity.
headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
entityThe name of the entity.
exportWhether 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.includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA function executed when the request completes with a successful result or error
-
listValues(workspaceID:entity: export: pageLimit: includeCount: sort: cursor: includeAudit: headers: completionHandler: ) 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
workspaceIDUnique identifier of the workspace.
entityThe name of the entity.
exportWhether 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.pageLimitThe number of records to return in each page of results.
includeCountWhether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true, thepaginationobject in the response includes thetotalproperty.sortThe attribute by which returned entity values will be sorted. To reverse the sort order, prefix the value with a minus sign (
-).cursorA token identifying the page of results to retrieve.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA function executed when the request completes with a successful result or error
-
createValue(workspaceID:entity: value: metadata: type: synonyms: patterns: includeAudit: headers: completionHandler: ) 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
workspaceIDUnique identifier of the workspace.
entityThe name of the entity.
valueThe 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.
metadataAny metadata related to the entity value.
typeSpecifies the type of entity value.
synonymsAn 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.
patternsAn 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.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
entityThe name of the entity.
valueThe text of the entity value.
exportWhether 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.includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA function executed when the request completes with a successful result or error
-
updateValue(workspaceID:entity: value: newValue: newMetadata: newType: newSynonyms: newPatterns: append: includeAudit: headers: completionHandler: ) 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
workspaceIDUnique identifier of the workspace.
entityThe name of the entity.
valueThe text of the entity value.
newValueThe 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.
newMetadataAny metadata related to the entity value.
newTypeSpecifies the type of entity value.
newSynonymsAn 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.
newPatternsAn 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.
appendWhether 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.includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
entityThe name of the entity.
valueThe text of the entity value.
headersA dictionary of request headers to be sent with this request.
completionHandlerA function executed when the request completes with a successful result or error
-
listSynonyms(workspaceID:entity: value: pageLimit: includeCount: sort: cursor: includeAudit: headers: completionHandler: ) 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
workspaceIDUnique identifier of the workspace.
entityThe name of the entity.
valueThe text of the entity value.
pageLimitThe number of records to return in each page of results.
includeCountWhether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true, thepaginationobject in the response includes thetotalproperty.sortThe attribute by which returned entity value synonyms will be sorted. To reverse the sort order, prefix the value with a minus sign (
-).cursorA token identifying the page of results to retrieve.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
entityThe name of the entity.
valueThe text of the entity value.
synonymThe 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.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
entityThe name of the entity.
valueThe text of the entity value.
synonymThe text of the synonym.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
entityThe name of the entity.
valueThe text of the entity value.
synonymThe text of the synonym.
newSynonymThe 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.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
entityThe name of the entity.
valueThe text of the entity value.
synonymThe text of the synonym.
headersA dictionary of request headers to be sent with this request.
completionHandlerA function executed when the request completes with a successful result or error
-
listDialogNodes(workspaceID:pageLimit: includeCount: sort: cursor: includeAudit: headers: completionHandler: ) 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
workspaceIDUnique identifier of the workspace.
pageLimitThe number of records to return in each page of results.
includeCountWhether to include information about the number of records that satisfy the request, regardless of the page limit. If this parameter is
true, thepaginationobject in the response includes thetotalproperty.sortThe attribute by which returned dialog nodes will be sorted. To reverse the sort order, prefix the value with a minus sign (
-).cursorA token identifying the page of results to retrieve.
includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA function executed when the request completes with a successful result or error
-
createDialogNode(workspaceID:dialogNode: description: conditions: parent: previousSibling: output: context: metadata: nextStep: title: type: eventName: variable: actions: digressIn: digressOut: digressOutSlots: userLabel: disambiguationOptOut: includeAudit: headers: completionHandler: ) 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
workspaceIDUnique identifier of the workspace.
dialogNodeThe 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.
descriptionThe description of the dialog node. This string cannot contain carriage return, newline, or tab characters.
conditionsThe condition that will trigger the dialog node. This string cannot contain carriage return, newline, or tab characters.
parentThe unique ID of the parent dialog node. This property is omitted if the dialog node has no parent.
previousSiblingThe unique ID of the previous sibling dialog node. This property is omitted if the dialog node has no previous sibling.
outputThe output of the dialog node. For more information about how to specify dialog node output, see the documentation.
contextThe context for the dialog node.
metadataThe metadata for the dialog node.
nextStepThe next step to execute following this dialog node.
titleA 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
suggestionresponse type (unless it is overridden by the user_label property). The title is also used to populate the topic property in theconnect_to_agentresponse type. This string can contain only Unicode alphanumeric, space, underscore, hyphen, and dot characters.typeHow the dialog node is processed.
eventNameHow an
event_handlernode is processed.variableThe location in the dialog context where output is stored.
actionsAn array of objects describing any actions to be invoked by the dialog node.
digressInWhether this top-level dialog node can be digressed into.
digressOutWhether this dialog node can be returned to after a digression.
digressOutSlotsWhether the user can digress to top-level nodes while filling out slots.
userLabelA 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).
disambiguationOptOutWhether the dialog node should be excluded from disambiguation suggestions. Valid only when type=
standardorframe.includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
dialogNodeThe dialog node ID (for example,
node_1_1479323581900).includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA function executed when the request completes with a successful result or error
-
updateDialogNode(workspaceID:dialogNode: newDialogNode: newDescription: newConditions: newParent: newPreviousSibling: newOutput: newContext: newMetadata: newNextStep: newTitle: newType: newEventName: newVariable: newActions: newDigressIn: newDigressOut: newDigressOutSlots: newUserLabel: newDisambiguationOptOut: includeAudit: headers: completionHandler: ) 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
workspaceIDUnique identifier of the workspace.
dialogNodeThe dialog node ID (for example,
node_1_1479323581900).newDialogNodeThe 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.
newDescriptionThe description of the dialog node. This string cannot contain carriage return, newline, or tab characters.
newConditionsThe condition that will trigger the dialog node. This string cannot contain carriage return, newline, or tab characters.
newParentThe unique ID of the parent dialog node. This property is omitted if the dialog node has no parent.
newPreviousSiblingThe unique ID of the previous sibling dialog node. This property is omitted if the dialog node has no previous sibling.
newOutputThe output of the dialog node. For more information about how to specify dialog node output, see the documentation.
newContextThe context for the dialog node.
newMetadataThe metadata for the dialog node.
newNextStepThe next step to execute following this dialog node.
newTitleA 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
suggestionresponse type (unless it is overridden by the user_label property). The title is also used to populate the topic property in theconnect_to_agentresponse type. This string can contain only Unicode alphanumeric, space, underscore, hyphen, and dot characters.newTypeHow the dialog node is processed.
newEventNameHow an
event_handlernode is processed.newVariableThe location in the dialog context where output is stored.
newActionsAn array of objects describing any actions to be invoked by the dialog node.
newDigressInWhether this top-level dialog node can be digressed into.
newDigressOutWhether this dialog node can be returned to after a digression.
newDigressOutSlotsWhether the user can digress to top-level nodes while filling out slots.
newUserLabelA 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).
newDisambiguationOptOutWhether the dialog node should be excluded from disambiguation suggestions. Valid only when type=
standardorframe.includeAuditWhether to include the audit properties (
createdandupdatedtimestamps) in the response.headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
dialogNodeThe dialog node ID (for example,
node_1_1479323581900).headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
workspaceIDUnique identifier of the workspace.
sortHow 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 (
-).filterA cacheable parameter that limits the results to those matching the specified filter. For more information, see the documentation.
pageLimitThe number of records to return in each page of results.
cursorA token identifying the page of results to retrieve.
headersA dictionary of request headers to be sent with this request.
completionHandlerA 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
filterA 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 forrequest.context.system.assistant_id,workspace_id, orrequest.context.metadata.deployment. These required filters must be specified using the exact match (::) operator. For more information, see the documentation.sortHow 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 (
-).pageLimitThe number of records to return in each page of results.
cursorA token identifying the page of results to retrieve.
headersA dictionary of request headers to be sent with this request.
completionHandlerA 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-Metadataheader 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
customerIDThe customer ID for which all data is to be deleted.
headersA dictionary of request headers to be sent with this request.
completionHandlerA function executed when the request completes with a successful result or error
View on GitHub
Assistant Class Reference