Skip Navigation LinksHome Page > Forums > SpiraTest Forums > SpiraTest Issues & Questi... > Authentication failed usi...
Hello,I'm trying to get response form spiratest using python.
Here is the code I wrote.
import json, requests body = {"highlightedLinkId": -8} headers = { 'accept': 'application/json', 'Content-Type': 'application/json', 'User-Agent': "John Smith", } params = { 'username': 'SmithJ', 'api-key': '{XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX}', } url = "https://company.name.co.uk/SpiraTest/Services/Ajax/GlobalService.svc/GlobalNavigation_RetrieveWorkspaces" response = requests.post(url, data=json.dumps(body), params=params, headers=headers) print(response.text)
I've copied RSS / API Key from the settings.
However I have the following error:
'{"Message":"Authentication failed.","StackTrace":"","ExceptionType":""}'
Could you tell me please what I'm doing wrong, please.
Thank you in advance for any response.
That is not a valid API endpoint, that is in an internal service that requires an authenticated session.
Instead, please use one of these API endpoints:
https://api.inflectra.com/Spira/Services/
For example, for v7.0 REST API:
https://api.inflectra.com/Spira/Services/v7_0/RestService.svc
The documentation is here:
https://api.inflectra.com/Spira/Services/v7_0/RestService.aspx
And if you have any questions, please email or call us at +1 (202) 558-6885