Description
How to build a Fortify Hosted API query from Swagger and create the Curl command
Solution
1). Go to https://<your_SSC_hosted_name>/html/docs/api-reference/index.jsp
2). Login with FortifyToken <SSC REST api token>
3). Search for: Project-version-controller
4). Use:
GET /projectVersions
Note: The following example information is related to the Project Name and the version (the field names are the API filters):
project.name:Application_test
name:v01
5). This example query will return the version id where the project name and version name where provided.
Under Parameters define:
fields string (query): id
q string (query): project.name:Application_test+and+name:v01
Note: to have in the same query "Application_test" and "v01" you can you need to add this parameter: +and+
6). After you execute the query you can see the curl command you can use from MS-DOS or terminal window and also the query result.
Curl query example:
curl -X GET "https://<your_SSC_hosted_name>/api/v1/projectVersions?fields=id&start=0&limit=200&q=project.name%3AApplication_test%2Band%2Bname%3Av01&fulltextsearch=false&includeInactive=false&myAssignedIssues=false&onlyIfHasIssues=false" -H "accept: application/json" -H "Authorization: FortifyToken <SSC REST api token>"