- 2 Minutes to read
- Print
- DarkLight
- PDF
Panaya ForeSight APIs
- 2 Minutes to read
- Print
- DarkLight
- PDF
Use our API integration capabilities to develop seamless connectivity in any programming language.
It is highly recommended to follow this guide and get familiar with the various functions available before initiating the process of developing your current tool extensions to Panaya.
You have already set up Postman and imported Panaya ForeSight APIs Examples and the Foresight Shared Environment
Step 1 - Creating an 'Analysis' type Requirement with scope items
Let's begin by creating an 'Analysis' entity and loading it with scope items.
To do so, we can use the requirements API - {{url}}/api/v1/projects/{{projectId}}/requirements/impactanalysis/scopeitems
Note
This guide will refer to the 'Requirement' as 'Analysis.'
Select the "Create Analysis" API call. In the Body, you will notice that the packageFile Key has a package.xml; this will need to be replaced with your file containing the components desired as a Scope Item. Learn more about Package XML
The result of that POST request is that an Analysis entity will be created in ForeSight, and it will add the components from the package.xml file as Scope Items.
* Note: The package.xml file is not mandatory in the request's Body, but removing it from the request will end up with an analysis created with no scope items in it.
Request Params will contain title, description, and owner, update them according to your needs:
Key | Value |
title | The updated title of requirement/analysis |
description | The updated description of the requirement/analysis |
owner | The updated username of the owner of the requirement/analysis |
Out of the response, you'll be able to extract the following fields:
- requirementId
This is the ID of the analysis generated by ForeSight - analysisFeatureLink
- This is a direct URL to the analysis in ForeSight
Step 2 - Updating an existing Analysis
In case we want to update an existing analysis, we can use the requirements API - {{url}}/api/v1/projects/{{projectId}}/requirements/{{requirementId}}/impactanalysis/scopeitems
This method can either update the metadata of the analysis(e.g., title/description) or modify the list of scope items like shown below.
* Note: All analysis data will be overridden, both metadata and scope items list.
Select the "Update Analysis" API call:
Request Body should hold the new package.xml file containing the components desired as a Scope Item.
Key | Value |
packageFile | {{Package.xml}} |
The result of that POST request is that the Analysis entity will be updated in ForeSight, and it will update the list of scope items based on the package.xml file.
* Note: All parameters and headers are mandatory in the 'Update' method, and all information is overridden, so you should leave the original value of a specific parameter if you want it to be unmodified.
The response is the same as the 'Create' method.
Out of the response, you'll be able to extract the following fields:
- requirementId
This is the ID of the analysis generated by ForeSight - analysisFeatureLink
- This is a direct URL to the analysis in ForeSight