Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Zephyr Squad Cloud REST API gives 400 Bad Request with Production URL

Shail Bala
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 25, 2021

Hello, I was trying out various GET requests given in the documentation, in python. I modified the cycleTest.py file from the zapi-cloud GitHub Project. When I use mock-url given in documentation, I get the mock-results as expected. But trying the same with production-url is giving me this error:

raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request

With Postman, I get the error:

400 Bad Request, API not found.

The JWT Token is generating properly.

These are the parameters I am using:

  • Method: GET
  • headers = {
    'Authorization': 'JWT '+token,
    'Content-Type': 'application/json',
    'zapiAccessKey': ACCESS_KEY
    }
    (The token generated, my access key)
  • BASE_URL = 'https://prod-api.zephyr4jiracloud.com/connect/'
  • RELATIVE_PATH1 = '/public/rest/api/1.0/teststep/statuses'
    Edit: This path works now. But the second path is still giving the same error.
  • RELATIVE_PATH2 = '/public/rest/api/1.0/cycles/search?versionId=11673&projectId=10252'

I searched online, a 400: Bad Request is generated when the request is not done properly. But the GET method does not have any body associated to send in the request.

Please help. Thank You.

1 answer

0 votes
Thomas Minney September 6, 2021

Each JWT token is specific to an endpoint. Are you using different JWT tokens for RELATIVE_PATH1 and RELATIVE_PATH2?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events