RocketChat / rasa-kick-starter

Rocket.Chat connector kick starter for Rasa.AI
8 stars 16 forks source link

always returns 401 when call scripts/bot_config.py (solution) #8

Open salviof opened 2 years ago

salviof commented 2 years ago

always returns 401 when call scripts/bot_config.py Solution:

add header with 'User-Agent' in function get_authentication_token

Example:

headerLogin = {
    'Accept': 'application/json',
    'Content-Type': 'application/json',
    'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0'
     }

Can be: 'User-Agent':'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0' or 'User-Agent':'ScriptBot (Pyton)' Then update the request action with headers=headerLogin: response = requests.post(host + path,headers=headerLogin, data=json.dumps(login_data))