Introduction
You may wish to capture the threat model diagram via the API. This article will explain the basics.
Prerequisites:
API software:
Setup Insomnia for IriusRisk API
Setup Postman for IriusRisk API
Permissions and configuration:
- active API token
- access rights (ownership, BU etc) to the project
- GLOBAL permission: API_ACCESS
- Setting enabled: API Access (Settings > API > API Enabled)
Steps
Inside your API software of choice, configure for appropriate project:
- base url
- api-token
- project-id
Call the following GET request:
GET /api/v1/products/{product-id}/diagram/image
/api/v1/products/{product-id}/diagram/image
Send the request. Below is the output:
Via Console
These steps can also be done via the console if required.
WARNING: These steps will differ based on OS & distribution so please refer to your distribution documentation. This walkthrough is done via an ubuntu distribution.
First navigate to the folder you wish to save the image in. This cannot be viewed natively in most consoles so we must specify an output.
Then run the following command
curl https://<base-url>.iriusrisk.com/api/v1/products/<product-id>/diagram/image --header "api-token: <your-api-token>" --header "Content-Type: application/json" > filename.png
Below is the output:
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 103k 100 103k 0 0 122k 0 --:--:-- --:--:-- --:--:-- 121k
and opening the file:
Comments
0 comments
Article is closed for comments.