---
title: "Panaya Salesforce APIs"
slug: "panaya-foresight-apis"
updated: 2024-12-12T08:14:31Z
published: 2024-12-12T08:14:31Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://success.panaya.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Panaya Salesforce APIs

This article will get you up to speed with Panaya's **Salesforce****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**](/v1/docs/getting-started-with-panaya-apis)

  

---

## **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](https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/manifest_samples.htm)

![](https://cdn.document360.io/f404076c-de23-4609-848e-2dfd4ef701b0/Images/Documentation/image-1733991139595.png)

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 |

![](https://cdn.document360.io/f404076c-de23-4609-848e-2dfd4ef701b0/Images/Documentation/image-1733991208121.png)

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:

![](https://cdn.document360.io/f404076c-de23-4609-848e-2dfd4ef701b0/Images/Documentation/image-1733991261930.png)

  

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.

![](https://cdn.document360.io/f404076c-de23-4609-848e-2dfd4ef701b0/Images/Documentation/update_analysis_result.jpg)

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

## Related

- [API Call Limits](/what-are-the-default-api-call-limits.md)
- [Panaya for Salesforce - Getting started with Panaya APIs](/getting-started-with-panaya-apis.md)
- [Authenticating via API with an Access Token](/how-to-authenticate-to-panaya-via-api-with-an-access-token.md)
- [API Tips and Tricks](/api-tips-and-tricks.md)
