Quantcast
Channel: SAP APIs and API Management
Viewing all articles
Browse latest Browse all 51

How to use SAP API Management on HCP Trial

$
0
0

It is a busy time for the "SAP API world". Last week we announced the SAP Hub (Beta) on HCP Trial and this week you might have seen the blog from my colleagues Divya Mary on the release of the SAP API Management on HCP Trial.

This means that you can now enable your own API Management Portal and Developer Portal and start experiencing what the SAP API Management is all about.

 

In this blog I want to outline the concepts and first very basic steps to get you started. I will not yet cover some very important pieces like API Key Verification, Throtteling, URL Masking, Quota, Authentication or any of the other cool stuff that is possible. I just want to outline how you can use the SAP API Management Portal to create an API and then expose it to a developer community.

 

To start with I will use my favorite service GWSAMPLE_BASIC from the ES4 system (of course you can consume this service directly without an API Management; just imagine that this service would not be accessible directly and that you would need to secure it, that you want to learn a little more on who and how often different services are being used, ...) -- we will cover all these aspects over the next few week.

 

For the next steps, I assume that you have enabled API Management in your HCP Trial. Just follow the steps outlined by Divya in her blog.

 

Provisioning

For the provisioning part we will look at an API Owner who uses the SAP API Management Portal to create and maintain APIs. Lets start by logging on to the SAP API Management API Portal (HCP Trial Account  -> Services tab under -> Integration category -> SAP API Management)

01 - API Portal.png

 

 

The screen you can see now is to configure systems. Right now the list is empty.

02 - No Systems.png

 

 

Creating a System

The first step of the API Owner is to create a system. A system in API Management is a destination in HCP which allows you to connect to the backend systems from which you want to expose and manage your APIs. Following the Fiori UX click on Create on the bottom right corner. This will open the screen to Add a system

03 - System Settings.png

 

 

Fill in the properties like:

PropertyValue
NameSAPDevSystemES4
DescriptionSAP Developer System
Hostsapes4.sapdevcenter.com
Port443
Path Prefix/sap/opu/odata
Use SSLTrue
Authentication TypeBasic
Service Catalog URL/IWFND/CATALOGSERVICE/ServiceCollection

 

Before you click on Save you can also validate the Catalog URL and copy & paste the URL in your browser. As a result you should see the probably familiar Catalog Service from ES4 (if you never accessed ES4 or if you need to reset your passwored, please check out this blog: Sign up and get started with the SAP Gateway - Demo Consumption System):

04 - Catalog Service.png

Back in the System screen, make sure to click on Save now.

05 - First System.png

 

Since we have selected Basic Authentication we want to maintain the credentials. That can be done via the HCP Destination. So from the System view (see above) click on the Launch link which will open the Destination tab in your HCP Trial Account -> API Management Subscription.

Note: If this does not work, please go back to the HCP screen where you had enabled SAP API Management Trial and click on "SAP API Management API Portal (Roles & Destinations)". From here you can access the destinations.

08 - Destinations.png

 

 

In the destination you will be able to see the system that you just created in the SAP API Management Portal and can modify the configuration:

09 - Destination Details.png

 

Click on Edit and enter your credentials for the ES4 system:

10 - WithCredentials.png

 

 

Creating the API Proxy

Now we can continue with the next step which is creating an API Proxy. Back in the SAP API Management Portal click on the hambuger menu and select Manage.

06 - Manage.png

 

 

Similar to creating the system, the overview screen does not yet show any APIs. So click on Create -> Create API (the Import API can be used to easily transport APIs from a Test or QA API Management Portal to the next environment)

07 - Create API.png

 

 

From the Provider System drop down select the system we just created and click on Discover:

11 - Discover.png

 

 

This will connect to the catalog service on ES4 and retrieve the list of available OData service. Just search for "SAMPLE" and you will see the famous GWSAMPLE_BASIC service:

12 - Select GWSAMPLE.png

 

 

When you click on OK, the remaining fields will be populated. You can also leave the Documentation switch on Yes so that the available information from the OData service is used as a basis for the API documentation.

13 - Create API.png

 

 

With that we have created the API Proxy. In the overview screen you can see the available resources -- all of this information was automatically retrieved from the OData service. You can see which resources allow GET, POST, PUT, or DELETE operations. You can also go deeper and adjust the documentation which was generated automatically:

14 - Resources.png

 

 

Once your are done with your adjustments (you do not have to do anything :-)) just click on Save.

 

Of course you could now go on and add Policies or additional configuration, but for this very first blog we will skip this step.

 

Creating a Product

Developers working with the API Management Developer Portal will actuall develop their applications not on APIs, but on Products. So the next step is to create such a product and assign APIs to it. Go back to the APIs Overview screen

15 - Go Back.png

 

 

switch to the Product tab, and click on Create

16 - GoToProducts.png

 

 

Enter a product name and add the API that we just created.

PropertiesValue
NameEPMData
TitleEnterprise Procurement Model from GWSAMPLE_BASIC Serivce on ES4
DescriptionThis product exposes data from the GWSAMPLE_BASIC service hosted on the SAP Developer Center system. You can access data from the Enterprise Procurement Model.

 

For now we will again not do anything special and not assin any Quota. Instead just click on the "+" symbol in the API line

17 - Enter Product Data.png

 

 

and add the API that you just created (a product could contain more than one API, but right now we only have one :-))

18 - AddAPI.png

 

 

With these settings we can publish the product!

19 - PublishProduct.png

 

 

That's it on the provisioing side.. We now have one product that a developer can discover, subscribe and use.

20 - FirstProduct.png

 

 

So lets's switch personas!

 

Consumption

 

Back in the HCP Trial Account, where you activated the SAP API Management, there was another link to the SAP API Management Dev Portal.

21 - DevPortal.png

 

We now pretend to be a developer who wants to learn a little about enterprise procurement and needs to get started. The developer does not know much about SAP, but has found a SAP API Management Developer Portal (granted, the URL does not look very nice right now -- for me it is something like devportal-blablabla-myaccount.hanatrial.ondemand.com/#/shell/discover -- but obviously this could be beautified)


Well, as a developer I now reached this portal and I can see that there is one product available (actually the following steps are exactly the same as the ones outlined in the SAP API Hub (Beta))

22 - DevPortalOneProduct.png

 


Click on this Product and you can see all the details that we previously provided as the API Owner. You can also take a look at the API Proxies which are available via this product.

23 - ProductDetails.png

 


You can either Subscribe (which we will do in a second), or you can take a closer look at the API (just click on the API). From here you can see the the API Proxy URL, avaialble operations (GET, POST, ...) and can even give them a try (just click on the GET Method for the Business Partner Resource):

24 - TestAPIs.png


In the API Test Console click on the Authentication Link and provide your username and password for the ES4 system:

25 - Select Basic.png


 

 


Now just make sure that you select the HTTP Method GET and click on Send.

31 - Send.png

As a result you will see the response from the BusinessPartnerSet Collection in the GWSAMPLE_BASIC service.


Now that we have tested that, lets go back

When you subscribe to a product you can create a New Application for which you will get an API Key (as me

ntioned before, right now you do not need this key since we did not implement any API Key verification steps -- that's for the next blog to cover)

27 - SaveApplication.png

 

 

After saving the New Application you can switch to the consumption view

28 - GoToConsume.png

 

 

where you will see your Application

29 - ConsumptionView.png

 

 

and the generated Application Key.

30 - AppKey.png

 

 

 

With that we have everything to really get productive with the API Management. We have exposed our very first API which can be discovered and consumed via a Developer Portal. Granted, the value-add because of the steps outlined above is fairly limited. But in the next few weeks we will show you how you can monitor your calls, secure them, throttle them, enhance them, ... which will really show the power of SAP API Management.

 

Stay tuned!


Viewing all articles
Browse latest Browse all 51

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>