How to modify document in collection in discovery service - ibm-watson

How can I modify or delete document in my collection in IBM Watson Discovery service ?

You can delete a document by calling the delete document API.
You can update a document by calling the update document API.

Related

How to list all google directory subscription channels

I'm working on integration with Google Directory and create subscription channels to watch users updates using this API https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/watch
POST https://admin.googleapis.com/admin/directory/v1/users/watch
I created some channels and don't have their id and resourceId to stop them according to this documentation and now I can't create any new channels https://developers.google.com/admin-sdk/directory/reference/rest/v1/channels/stop
I didn't find any API endpoint to list all my current customer id channels to stop them. How can I stop any subscription (watch) channels related to the customer id so I can create new watchers?
Unfortunately, Google has not enabled support for a way to list (i.e: a LIST method) active subscriptions enabled for a given admin user/domain. The only method they've exposed is a STOP method to stop an existing subscription, but it requires the caller already know the channel metadata associated with the subscription.
The good news here is if you did not store this information upon creation, you should be able to find the required parameters as a part of an event notification. I believe they might be in the headers accompanying each notification event.

API for fetching Support tickets for a user from salesforce

I am working with Salesforce API and need to fetch all the support tickets against a user but I am not able to find any REST API for fetching the tickets.
Can anyone let me know if there is such REST API is there?
There is no standard object in Salesforce called a Support Ticket. You may be using the Case standard object, or a custom object; regardless, it won't have its own API endpoint.
You'll want to use the Query REST endpoint to execute a SOQL query to locate the records you need.

How to use the Watson Assistant "listLogs" API function for a versioned workspace?

How can I use the Watson Assistant "listLogs" API Function to list the user conversations from a specific assistant ? We have one skill linked to three assistants for our environments (DEV/TEST/PROD), and I want to retrieve the conversations from PROD assistant only. What filters do I have to use ?
What I already tried:
When using the listLogs function with just the "workspace_id" as parameter, it is returning just an empty list.
When using the listAllLogs function with a filter parameter (language::de,workspace_id::my-workspace-id), the resulting list is empty as well
When using the listAllLogs function with another filter parameter (language::de,meta.conversation.assistant_and_skill_reference::"my-assistant-id:main+skill"), again an empty list is returned
As the skill is used in live chatbot, there are thousands of logged conversations, all visible in the Analytics tab of the Watson Assistant console, so the data is definitely there.
UPDATE: This is the out from the Watson Conversation Tool, it's empty
I finally got the information from IBM Support that this is currently not possible.

Retrieve a Chat Log watson assistant

I'm using Watson Assistant and Cloud Function in a basic chatbot. How can i retrieve via Cloud Function (node.js) the chatlog of a specific conversation? I'd like to implement this user functionality. So for example, if the user types "Chat Log", Watson Assistant send him back (via Cloud Function) his chatlog. Thanks.
In case you are using v1 version of the Watson Assistant(WA), you will get the logs via the API: https://cloud.ibm.com/apidocs/assistant/assistant-v1#listlogs
In case you are using v2 version of the Watson Assistant(WA), you will get the logs via the API: https://cloud.ibm.com/apidocs/assistant/assistant-v2#listlogs
In both of these versions, you will find a filter parameter which can be set to the current chat conversation ID or session ID and could be used to get the chat log.
Now there is a REST API that allows to get the user conversations - however this gets all users conversations so you would need to implement some kind of a proxy that would filter these logs anyway.
For this particular use case, I believe, it would be the best to log the conversations into a separate database where the data would be organized by user id. First of all - separate results for particular user can be achieved easilly in this case, second of all - in IBM Cloud in Watson Assistant the chat logs are kept for 30 days - that might not be enough for this kind of functionality.

How to specify a particular document to be searched in IBM Watson discovery service

IBM Watson Discovery service
I want to get the set of keywords in a particular document in a collection using discovery service. I tried the below url:
https://watson-api-explorer.mybluemix.net/discovery/api/v1/environments/{environment secret key}/collections/{collection secret key}/query?passages=true&count=10&highlight=true&version=2017-11-07
But, it is fetching from all documents in that collection. How can I specify a particular document to be searched?
It's important to know: The collections can have a lot of documents, so the query will search across all your documents inside your collection that you specified if you won't put a field id inside the query.
According to the IBM Watson Discovery Expert #Anish Mathur you can query for a particular document using a field query.
So something like
enviroment/{id envir}/collections/{id coll}/query?query=id:{document_id}
See the Official API Reference for query with WDS.

Resources