Zephyr Scale RESTAPI: Help needed with request format
Hello, I am wanting to retrieve a list of test cases from Zephyr Scale for a project within Jira.
Here is my request:
curl -X GET -H "Authorization: Bearer:<Zephyr Scale API Token>" -i "https://campbellscientific.atlassian.net/projects/CI/rest/atm/1.0/testcase/I2-T2"
The response I receive is as follows:
HTTP/1.1 302 Found
Strict-Transport-Security: max-age=315360000; includeSubDomains; preload
Date: Tue, 29 Jun 2021 18:51:09 GMT
X-XSS-Protection: 1; mode=block
set-cookie: atlassian.xsrf.token=b24f8288-2294-4bb0-8c68-7ae969b4091d_6792bd27469ea9f755c68dc9fea9e35081799a54_lout; Path=/; Secure
Expect-CT: report-uri="https://web-security-reports.services.atlassian.com/expect-ct-report/global-proxy", enforce, max-age=86400
The response redirects me to a n Atlassian 'Something went wrong' page.
Any guidance for what I am doing wrong?
Solved! Go to Solution.
I found the answer and resolved my issues. Within the Authorization header I had an extra ':' after 'Bearer' and before my API token. Removing this and changing my base URI to https://api.zephyrscale.smartbear.com/v2 resolved my issues.
For full explanation here is the valid GET request format.
curl -X GET -H "Authorization: Bearer <API Token>" -i https://api.zephyrscale.smartbear.com/v2/testcases
In order to filter by project this is the request format
curl -X GET -H "Authorization: Bearer <API Token>" -i https://api.zephyrscale.smartbear.com/v2/testcases?projectKey=<Project Key>