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

How to use api key?


#1

Hello

I would like to use api key instead of password.
I could generate API Key from my user setting and use in authorization request

the problem is everytime i use username/apikey i get Authentication failed while using username/password i could access test rail API


#2

Hi there,

Thank you for your post. With API keys you would simply use your username and the API key instead of your password. You may have already looked at our documentation for this but if not you can find more information here:

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

I would recommend trying a simple CURL request using API keys if you have not yet to test this.


#3

Should that be in the format username:APIkey in the request? I’m trying that and it doesn’t work; I am only able to get it to work with username:password (where username is my email address).


#4

Hi Alex,

Thanks for your reply! Yes, you can use your username:APIkey when accessing the API, and you would just need to be sure that the API key was saved to your profile after adding this, otherwise it wouldn’t provide access to the API. So after generating and adding the key, be sure to also click “Save Settings” at the bottom of the page so that the API key can be saved to your profile.

Hope this helps!

Regards,
Marco