Ask a Question

How to Create a Zephyr Scale API for my Organization ?

SOLVED
Vallalarasu_P
Frequent Contributor

How to Create a Zephyr Scale API for my Organization ?

Hi Team,

 

I've Zephyr Scale - Cloud integrated with my Jira instance. I wish to access the Zephyr Scale Cloud using API. Can you provide the step to access the same.

 

Can i access my org zephyr scale using the same API - "https://api.zephyrscale.smartbear.com/v2" ?  and only the bearer token changes ? . 

 

Please comment, If my API must be customized ?

 

Also, how to i access these API using ReadyAPI/SoapUI/Postman. 

 

 

 

Vallalarasu_P_0-1637666536338.png

 

 Regards

Valla

With Regards
Vallalarasu Pandiyan
https://www.linkedin.com/in/vallalarasupandiyan/
1 ACCEPTED SOLUTION

Accepted Solutions
Vallalarasu_P
Frequent Contributor

Re: How to Create a Zephyr Scale API for my Organization ?

Found the Solution and its working.

 

To access the API in ReadyAPI/Postman - We need to use the yml file  ( api.cloud.expanded.yml) from API Documentation (https://support.smartbear.com/zephyr-scale-cloud/api-docs/) with authorization token for ZephyrScale Cloud API - Access token from Jira.

 

To Access from TestComplete, The below code works.

 

Sub ZephyrScaleAPI_TestComplete
'Definitions
API_Address_Endpoint = "https://api.zephyrscale.smartbear.com/v2/projects/?maxResults=10&startAt=0"
CurrentToken = "Update your token" "
Log.Message ("API_Address_EndPoint: " + API_Address_Endpoint)
Log.Message ("CurrentToken: "+ CurrentToken)

'Calling Rest API
Set aqHttpRequest = aqHttp.CreateGetRequest(API_Address_Endpoint)
Call aqHttpRequest.SetHeader("Authorization","Bearer " + CurrentToken)
'Call aqHttpRequest.SetTimeouts(50000,70000,50000,70000)
Set aqHttpResponse = aqHttpRequest.Send()

'Getting Reponses
If Not aqHttpResponse Is Nothing Then
Log.Message("All Headers : " + aqHttpResponse.AllHeaders)
Log.Message("A specific header : " + aqHttpResponse.GetHeader("Content-Type"))
Log.Message("Status Code : " + aqHttpResponse.StatusCode)
Log.Message("Status Text : " + aqHttpResponse.StatusText)
Log.Message("Respone Body : "+ aqHttpResponse.Text)
aqHttpResponse.SaveToFile(Project.Path & "body.txt")
End If
End Sub

 

Sample Respone File :

 

{"next":null,"startAt":0,"maxResults":3,"total":3,"isLast":true,"values":[{"id":12345,"jiraProjectId":54321,"key":"abc","enabled":true},{"id":12346,"jiraProjectId":54322,"key":"ABCDEF","enabled":false},{"id":12347,"jiraProjectId":54323,"key":"ABCD","enabled":false}]}

 

 

 

With Regards
Vallalarasu Pandiyan
https://www.linkedin.com/in/vallalarasupandiyan/

View solution in original post

1 REPLY 1
Vallalarasu_P
Frequent Contributor

Re: How to Create a Zephyr Scale API for my Organization ?

Found the Solution and its working.

 

To access the API in ReadyAPI/Postman - We need to use the yml file  ( api.cloud.expanded.yml) from API Documentation (https://support.smartbear.com/zephyr-scale-cloud/api-docs/) with authorization token for ZephyrScale Cloud API - Access token from Jira.

 

To Access from TestComplete, The below code works.

 

Sub ZephyrScaleAPI_TestComplete
'Definitions
API_Address_Endpoint = "https://api.zephyrscale.smartbear.com/v2/projects/?maxResults=10&startAt=0"
CurrentToken = "Update your token" "
Log.Message ("API_Address_EndPoint: " + API_Address_Endpoint)
Log.Message ("CurrentToken: "+ CurrentToken)

'Calling Rest API
Set aqHttpRequest = aqHttp.CreateGetRequest(API_Address_Endpoint)
Call aqHttpRequest.SetHeader("Authorization","Bearer " + CurrentToken)
'Call aqHttpRequest.SetTimeouts(50000,70000,50000,70000)
Set aqHttpResponse = aqHttpRequest.Send()

'Getting Reponses
If Not aqHttpResponse Is Nothing Then
Log.Message("All Headers : " + aqHttpResponse.AllHeaders)
Log.Message("A specific header : " + aqHttpResponse.GetHeader("Content-Type"))
Log.Message("Status Code : " + aqHttpResponse.StatusCode)
Log.Message("Status Text : " + aqHttpResponse.StatusText)
Log.Message("Respone Body : "+ aqHttpResponse.Text)
aqHttpResponse.SaveToFile(Project.Path & "body.txt")
End If
End Sub

 

Sample Respone File :

 

{"next":null,"startAt":0,"maxResults":3,"total":3,"isLast":true,"values":[{"id":12345,"jiraProjectId":54321,"key":"abc","enabled":true},{"id":12346,"jiraProjectId":54322,"key":"ABCDEF","enabled":false},{"id":12347,"jiraProjectId":54323,"key":"ABCD","enabled":false}]}

 

 

 

With Regards
Vallalarasu Pandiyan
https://www.linkedin.com/in/vallalarasupandiyan/

View solution in original post

cancel
Showing results for 
Search instead for 
Did you mean: