Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Difficulty to access TestRail via its API (error 401)


#1

hello Tobias
I’ve complexity on reaching out TestRail via its API.

I’ve read and followed properly the official doc (as you can figure out, I use Python) & even an interesting previous thread (here) but it remains unclear how I can solve the error 401 that I have once intenting a GET.

I have then 2 questions regarding the info to provide in my scripts:
. is the URL in:
admin dashboard / site settings / application / Web Address (already picked)

. is the user name in:
my settings / user / full name (already picked)
or:
admin dashboard / site settings / application / installation name

thks in advance!


#2

Hi Guillaume,

You would need to use the username & password you use to log in to TestRail (usually your email address and a password):

http://docs.gurock.com/testrail-api2/accessing

You can also use your username and API keys you added on the My Settings page.

I hope this helps!

Cheers,
Tobias


#3

¨hey Tobias

thanks for your link posted.
That works! I can logged to any test case.

Then, what I understood is that:
client.password = 'mysuperpassword123’
client.user = ‘yourEmailAddressThatYouUseForLogging’

My mistake was that I figured out that my variable had to include ‘client.email’ instead ‘client.user’.

ps: I sould recommend such a little note in your Python doc, 'hoping that could help somebody else.
Thks again!


#4

Hi Guillaume,

Great to hear that it works now :slight_smile: The properties to use are already documented in the example but we will make sure to highlight this again:

http://docs.gurock.com/testrail-api2/bindings-python

Cheers,
Tobias