Sap Oracle

Step by Step Guide to Panaya APIs

This is a Step by Step guide, that will get you up to speed with Panaya's 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 retrieve your session token and 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
In order to connect to Panaya via API, the relevant Panaya user should be assigned with the API Execute permission
See also

Step 1 - Download an API Connection Software
We recommend using Postman as a tool for running the API connection. While there are many other tools available that will work for this purpose, in this guide we will be demonstrating the use of Postman.
Step 2 - Postman Setup
In the next steps you will receive a Panaya token ID. Before you continue to the next steps, you will need to set a global variable that will store the token ID,
  1. Open Postman and click on the Environment options button and then Manage Environments 

  2. Click Add to add a new environment 
  3. Give the new environment a name (e.g. Panaya) and click Add
  4. Click on Globals and set the Key to token

  5. Click Save
 
Select between the following options - 
 
 

 

Step 4 - Retrieve Project Metadata

Let's begin by retrieving the project details.
To do so, we can use the project API query - https://my.panaya.com/api/projects
Use GET with the following in the header - 

GET
Content-Typeapplication/json
x-auth-token{paste your token here}
Cache-Controlno-cache

For the Tests tab - add the following lines in order to reuse the token variable. 
This should be added for any new API call created.

var jsonData = JSON.parse(responseBody);
postman.setEnvironmentVariable("token",postman.getResponseHeader("X-Auth-Token"));

You should then receive all project metadata as a response.
Metadata includes the following details - 

  • projectId
    This is the project ID generated by Panaya and cannot be altered
  • projectName
    This is the project name, defined by the Project Manager and can be changed any time
  • projectDescription
  • creationDate
  • startDate
  • endDate
  • erpEtlExist
    Lets you know whether a custom code extraction was uploaded to Panaya for this ERP (System)
  • erpId
    This is the ERP (System) ID, automatically generated by Panaya
  • erpName
    This is the ERP (System) Name as defined in Panaya and can be changed any time

Step 5 - Retrieve Cycle Information 
Before we attempt to collect/change test metadata and details, we will need to address the parent Cycle.
Select one of your projects and use the corresponding projectID to retrieve all associated Cycles.

This can be done using the Cycle API - /projects/{projectId}/cycles/
For example, the following URL will retrieve all Cycles with their correspondence ID and Name for this project.
https://my.panaya.com/api/projects/22401/cycles/

Use the API to get the details on a specific cycle.
For example, for Cycle ID 10152, use the following URL -
https://my.panaya.com/api/projects/22401/cycles/10152/

Step 6 - Perform Actions

Edit Cycle Metadata

If you would like to make any changes to the cycle metadata, use PUT with the following BODY parameters (header should remain as before)

  • name
    This field is Mandatory
  • description
  • startDate
  • endDate
  • managerUserEmail
    Define the Cycle manager, by providing the email as defined in Panaya User Management
  • respOrg
    Define the responsible organization
  • testingPhase
    Define the phase of the Cycle - Planning, Execution, Completed
Note
Any null/empty value provided, will overwrite existing values
 
Create New Cycle
To create a new cycle, use POST (instead of PUT).
Use the same logic as described above and go through the various API functions described in Panaya API documentation.

Note
If the given new Cycle Name already exists for this project, a new cycle will be created as [existing_name] (1).