Panaya ForeSight APIs
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Panaya ForeSight APIs

  • Dark
    Light
  • PDF

Article Summary

This article will get you up to speed with Panaya's ForeSight API methodology and functionality.
Use our API integration capabilities to develop seamless connectivity in any programming language.
Take a look at the examples in this guide to learn how to perform API functions.
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.
Prerequisites

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:

KeyValue
titleThe updated title of requirement/analysis
descriptionThe updated description of the requirement/analysis
ownerThe 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.

KeyValue
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