I am trying to use the API to get the list of test suites available within my bot. I have successfully used the API to obtain content variables and other interactions, but all the test suite interactions are giving me a 401 Unauthorized.
My app is enabled in the BotBuilder API Scopes with permissions:
- Batch Test Execution
- Batch Tests Management
- Import Variables
- Export Variables
Can anyone else get the Test Suite API to work? Am I missing a permission or something somewhere else?
Test code below:
import jwt
import requests
appId = "my appId"
clientKey = "my appKey"
botId = "my botId"
payload = {
"appId": appId,
}
jwt = jwt.encode(payload, clientKey, algorithm="HS256")
headers = {'auth': jwt,
'bot-language': 'en',
}
resp = requests.post('https://bots.kore.ai/api/1.1/public/builder/stream/'+botId+'/variables/export',
headers=headers)
print("Variables export:", resp) # gives a 200 Success
resp = requests.get('https://bots.kore.ai/api/public/bot/'+botId+'/testsuite',
headers=headers)
print("Testsuite get:", resp) # gives a 401 Unauthorized
print()
if not resp.ok:
print("Failed REST call to", resp.url)
print("Status Code:", resp.status_code)
print("Reason:", resp.reason)
print(resp.text)