Get error while import new API using PAPI tools on dev portal new version (unable to graduate APis)
search cancel

Get error while import new API using PAPI tools on dev portal new version (unable to graduate APis)

book

Article ID: 275557

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

Getting errors using custom Powershell scripts to create new Developer Portal APIs 

2023-09-19T17:28:45.7112465Z     + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException

2023-09-19T17:28:45.7113389Z     + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,ApiImport

2023-09-19T17:28:45.7114048Z  

2023-09-19T17:28:45.8009530Z ##[error]PowerShell exited with code '1'.

Environment

API Portal 5.2.1

Resolution

The use of Powershell scripts is custom tool that needs to adhere to the swagger 

Link to swagger: PAPI Swagger File 5.1.2  

Similar procedure using POSTMAN and a proper JSON file 

The JSON file has a few problems:

1. Portal Name value pairs are case sensitive  name Not Name

2. The Uuid for the new API should be auto generated  "Uuid":  "{{GENERATED_GUID}}"

3. apiEulaUuid should be looked up the Uuid and added to the json as below 

Get Fetch eula GET   https://apim-ssg.<portal_domain>/<tenantID>/api-management/1.0/eulas

 

4. POSTNAME leaving out the json file 

{

   "name":"<api_Nsme>",

   "version":"1",

   "apiEulaUuid":"Euls_fetched_from _step3",

   "privateDescription":"",

   "accessStatus":"PRIVATE",

   "description":"<test api desc>",

"Uuid":  "{{GENERATED_GUID}}",

   "orgUuid":null,

   "ssgUrl":"<uri_gateway>",

   "authenticationType":"NONE",

   "authenticationParameters":"{}",

   "locationUrl":"https://<URL_location/<URI>",

   "apiServiceType":"REST",

   "type":"BASIC"

}