How to get the nowBotID & is it configurable?

Anay Sarkar
Kilo Contributor

How to get the nowBotID ? which is sent with the request from Inbound Rest Endpoint
https://<instance-url>/api/sn_va_as_service/bot/integration

Is nowBotID configurable, Can we pass our own ID?, And how to access it at the Outbound Response ?


Inbound request Body:

  "requestId": "asd2423-sda23-qwe23-we25", 
  "action": "START_CONVERSATION", 
  "enterpriseId": "ServiceNow", 
  "nowBotId": "A85PWLERF"
  "clientSessionId": "", 
  "nowSessionId": "",
  "message":{ 
    "text": "SENDING FROM POSTMAN", 
    "typed": true, 
    "clientMessageId": "ABC-123" 
  }, 
  "userId": "beth.anglin", 
  "emailId": "beth.anglin@example.com", 
  "timestamp": 1588824102, 
  "timezone": "America/New_York" 
}

My Outbound Response at my endpoint:

{
  "requestId": "asd2423-sda23-qwe23-we25",
  "clientSessionId": "",
  "nowSessionId": "",
  "message": {
    "text": "SENDING FROM POSTMAN",
    "typed": true,
    "clientMessageId": "ABC-123"
  },
  "userId": "beth.anglin",
  "body": [
    {
      "uiType": "OutputText",
      "group": "DefaultText",
      "value": "I am sorry but I didn't understand your request.",
      "maskType": "NONE"
    },
    {
      "uiType": "OutputText",
      "group": "DefaultText",
      "value": "Please try giving me your request in a different way. I'm currently better at understanding short sentences.",
      "maskType": "NONE"
    }
  ],
  "score": 0
}
22 REPLIES 22

@Rahul Kumar3, is this known issue or shall i highlight to service now vendor?

@nagarjun2 This is not a known issue. You can open a case for this issue

@Rahul Kumar3, A defect ticket PRB1639485 created by servicenow for this issue. Which will be fixed in future releases.  The issue is seen till tokyo version. FYI

 

For now to resolve the issue, added a custom BR(After insert/update), below is the code:

var prov_auth = new GlideRecord('message_auth');
prov_auth.addQuery('sys_id', '!=', current.provider_auth);
prov_auth.query();
while(prov_auth.next()){
var user_map = new GlideRecord('provider_user_map');
user_map.addQuery('provider_auth', prov_auth.sys_id.toString());
user_map.addQuery('user', current.user.toString());
user_map.query();
if(!user_map.next()){
var create_user_map = new GlideRecord('provider_user_map');
create_user_map.initialize();
create_user_map.provider_auth = prov_auth.sys_id.toString();
create_user_map.user = current.user.toString();
create_user_map.provider_user_id = current.user.user_name.toString();
create_user_map.active = true;
create_user_map.insert();
}
}

 

Thank you so much for all the help.