cancel
Showing results for 
Search instead for 
Did you mean: 

APIM download API Providers and API Proxies List from external API Call

cmiron
Explorer
0 Kudos

Hello,

I am trying to build a tool to download and transport all API Providers and API Proxies from one tenant to another. For that I want to use the Standard API calls from API Portal /APIProvider and /APIProxy. Those 2 API calls should give me 2 lists of API's that I would then parse and I would transport the API Providers and Proxies one by one.
To use those APIs I need to create an instance in SAP BTP and generate a key, to be used as client credentials. That is the official documentation on how to create the instance credentials: Setting Up OAuth for Cloud Integration in Cloud Foundry | SAP Help Portal.

Once I've done that I should be able to send an external API call with the bearer token generated by the client credentials and I should get the list of providers or proxies that I want. But instead I get a redirect to a page that says "Not Found".

Am I doing something wrong or are the /APIProvider and /APIProxy not working properly?

Thank you very much in advance.

Best Regards,

Constantin

Accepted Solutions (0)

Answers (2)

Answers (2)

bmag
Discoverer

Hello Constantin,
Please check this blog https://blogs.sap.com/2022/03/23/exploring-api-portal-and-api-business-hub-enterprise-apis-of-sap-in...

PS: I would also propose you to evaluate the possibility to use cTMS for API artifacts transport instead of developping your own tool 🙂

cmiron
Explorer
0 Kudos

Hi Bruno,


Thanks for such a quick response. I have tried that previously and all I got was "401 Unauthorized access".

Also, the API calls I'm making are just for the purpose of finding out which credentials should I use. My application uses Project-piper functions for transporting API Providers and API Proxies between tenants, but as I mentioned, I don't know which credentials to send as the apiServiceKey, so I'm just testing with the APIs from the API Portal in Postman.
This is what I get if I put the apiServiceKey that is generated by apiportal-apiaccess key with Project-Piper:

If you have any ideas why would that happen, I would gladly try them.

Thanks in advance.

Best regards,

Constantin

bmag
Discoverer
0 Kudos

Hello Constantin,

  1. Create apiportal-apiaccess instance using the following JSON
    {
    "role": "APIPortal.Administrator"
    }
  2. Create a service key SK on this apiportal-apiaccess instance
  3. Use SK clientId/clientSecret to fetch a bearer token from SK tokenUrl
  4. Using this bearer token : GET on https://SK url/apiportal/api/1.0/Management.svc/$metadata to get the list of Entity sets

  5. GET on https://SK url/apiportal/api/1.0/Management.svc/APIProxies to get the list of API Proxies on your tenant

  6. GET on https://SK url/apiportal/api/1.0/Management.svc/APIProviders to get the list of API providers

It works perfectly for me.

Bruno