There are occasions where there is no specific API endpoint that will give you exactly what you are looking for within the product, however, with the use of filtering it is possible to extract your desired information by filtering a response from another endpoint.
For example, we have an API call that gets a list of all implemented countermeasures of a product (/api
To achieve this, we have an API call that returns a list of all the countermeasures of a product (/api
| jq '.[] | select(.state == "Recommended").ref'
The completed API call would be:
curl -s -X 'GET' \
'https://<instance>.iriusrisk.com/api/v1/products/<project_id>/controls' \
-H 'accept: application/json' \
-H 'api-token: <token>' \
| jq '.[] | select(.state == "Recommended").ref'
Note that the <instance> and the <token> variables need to be replaced for the real ones.
Comments
0 comments
Article is closed for comments.