0

We have developed a watson assistant chatbot and integrated with client application. Now we want know how many times each user calling watson service from client application and its billing details per person.

We tried using watson settings(passing user id and customer id as parameter ) but we are not getting the per user details , we only got total user count details.

Please let me know how we can achieve this from application side or any other alternative approaches.

Code:

version_date: '2018-02-16',
version: 'v1',
context : {
    metadata : {
       "user_id": "{1234}"
       }
     },
 headers: {'X-Watson-Metadata':'customer_id=user777;customer_id=xyz'}
 });
user2319726
  • 143
  • 1
  • 1
  • 10
  • Hi All, How can we achieve above issue, Any Suggestions? – user2319726 Jun 24 '19 at 03:58
  • @data_henrik, we are using standard plan – user2319726 Jun 24 '19 at 09:15
  • @data_henrik, below is the code, we are able to see the user count increased by this but we are not getting per user api call details . var conversation = new ConversationV1({ url: 'https://gateway.watsonplatform.net/conversation/api', username: process.env.CONVERSATION_USERNAME, password: process.env.CONVERSATION_PASSWORD, version_date: '2018-02-16', version: 'v1', context : { metadata : { "user_id": "{1234}" } }, headers: {'X-Watson-Metadata':'customer_id=user777;customer_id=xyz'} }); – user2319726 Jun 24 '19 at 09:31
  • please edit your question and add the code – data_henrik Jun 24 '19 at 09:48

1 Answers1

0

You need to send the user_id and other information with each call to the message API. See the V2 API and its message method for the structure of the context object.

The message method is supported by the various SDKs (Node.js, Python, ...). Before making the call, you would need to make sure that the user_id information is added to the context object. The code that you shared seems to indicate that you only passed the information on the initialization.

Once the user_id is sent, the graphs described in this overview are generated. For other analytics you would need to use the log files. Obtain the logs (download them) and run your custom-analytics on them. AFAIK the Watson Assistant analytics only have averages across users.

data_henrik
  • 16,724
  • 2
  • 28
  • 49
  • yes we have added the use details in context, we can see the count increase in graph .. only the count we are seeing. We need to know the user based api calls details.. how we can get this from application side ? – user2319726 Jun 24 '19 at 10:13
  • So you are sending different values for user_id and the graphs show your user activity. What type of details are you looking for? – data_henrik Jun 24 '19 at 10:25
  • yes we are sending different user values. We want to know for each user what is the total message count or each user messages count per/total chat. – user2319726 Jun 24 '19 at 10:51