Can PAPI return a CSV?

book

Article ID: 226017

calendar_today

Updated On:

Products

CA API Developer Portal

Issue/Introduction

Is there is a way to get a CSV formatted response via API calls from the following PAPI's endpoints:

  "PortalApiGetApisUrl": "/api-management/1.0/apis?size=10000",
  "PortalApiGetApplicationsUrl": "/api-management/1.0/applications?page=0&size=2000",
  "PortalApiGetUsersUrl": "/v2/users",
  "PortalApisInAnApplicationsUrl": "/Applications",
  "PortalApisGetOrganizations": "/tenant-admin/1.0/organizations?page=0&size=2000",
  "PortalDeveloperRoleTypes": "/developerRoleTypes",
  "PortalPublisherRoleTypes": "/publisherRoleTypes",
  "PortalApiGetApiGroups": "/api-management/1.0/api-groups",
  "PortalApiGetAppMetrics": "/analytics/metrics/v1/errors/apps?timerange=day&buckets=apps&sortorder=desc&sortby=errors",
  "PortalApiGetAppMetricshits": "/analytics/metrics/v1/hits/apis",
  "PortalApiGetAppMetricslatency": "/analytics/metrics/v1/latency/apis",
  "PortalApiGetAppMetricserrors": "/analytics/metrics/v1/errors/apis",
  "PortalAppGetAppMetricshits": "/analytics/metrics/v1/hits/apps",
  "PortalAppGetAppMetricslatency": "/analytics/metrics/v1/latency/apps",
  "PortalAppGetAppMetricserrors": "/analytics/metrics/v1/errors/apps",
  "PortalApiGetApikey": "/api-management/1.0/applications",

Environment

API Portal 5.0.X

Resolution

You cannot export this data from the PAPI but you can use a client (like Postman) to export the data to a CSV. Unfortunately, the response gets saved as a string, with no formatting, even if you save it as a JSON or XML.

You can save the response as a JSON or XML and use an online converter to get the JSON/XML into a proper CSV file.

Additional Information

Auditing is the only CSV-export in the PAPI.