cancel
Showing results for 
Search instead for 
Did you mean: 

Zephyr Scale RESTAPI: Help needed with request format

SOLVED
jaredcscott
New Contributor

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
Server: AtlassianProxy/1.19.3.1
vary: Accept-Encoding
Content-Type: text/html;charset=UTF-8
Strict-Transport-Security: max-age=315360000; includeSubDomains; preload
Date: Tue, 29 Jun 2021 18:51:09 GMT
ATL-TraceId: c96e62b531211a3c
x-arequestid: 71fb5a96-1eeb-45e2-b713-c9213fc2bb1a
location: /login.jsp?os_destination=%2Fprojects%2FCI%2Frest%2Fatm%2F1.0%2Ftestcase%2FI2-T2&permission-violation=true
X-XSS-Protection: 1; mode=block
timing-allow-origin: *
x-envoy-upstream-service-time: 46
X-Content-Type-Options: nosniff
Connection: keep-alive
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
Content-Length: 0

 

The response redirects me to a n Atlassian 'Something went wrong' page. 

Any guidance for what I am doing wrong? 

1 ACCEPTED SOLUTION

Accepted Solutions
jaredcscott
New Contributor

Re: Zephyr Scale RESTAPI: Help needed with request format

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>

View solution in original post

1 REPLY 1
jaredcscott
New Contributor

Re: Zephyr Scale RESTAPI: Help needed with request format

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>

View solution in original post

New Here?
Join us and watch the welcome video:
Top Kudoed Authors