Hands-On Material

PALO ALTO PARTNER WORKSHOP 2015
SAP API Management – Hands-On Material
In this exercise, your aim is to understand the
concepts and steps to create, publish, discover
and manage APIs using SAP API Management
When you work your way through the exercise,
you will:
1. Create API from an ODATA Service, REST
Service and SOAP service coming from a
backend SAP Gateway System.
2. Add documentation. Add policies to
manage the traffic, authentication and
mediation in the SAP API Management’s
API Portal
3. Discover, test and consume the APIs that you earlier created from the Developer Portal
provided by SAP API Management.
Pre-requisites:
You have enabled SAP API Management in your HCP Trial. For more information, check the
blog http://scn.sap.com/community/api-management/blog/2016/02/02/free-trial-of-sap-apimanagement-on-hana-cloud-platform-is-available-now.
You shall implement the scenario in the following stages:
Stages
Stage 1: Create Systems
Description
Login to the API Portal
Create System
Explore Services from the System
Create SOAP API
Create REST API
Create OData API (from Gateway)
Stage 2: Create APIs
Stage 3:
Manage APIs
Go to the API you just created
Add/ change Documentation
Add XML to JSON policy
Add Quota Policy to limit the traffic to your APIs
Restrict certain operations and resources
Add new query parameters to the API
Stage 4:
Publish APIs
Login to the API Portal
Add API Key Verification policy for the API
Create Product
Add API to the Product
Publish the product
Stage 5:
Discover APIs to Consume
Login to the Developer Portal
Discover newly created API products
Subscribe to API and get the API key
Test the API
Login to the API Portal
Go to Analytics
Identify trends in API Traffic, response payloads,
response times and errors.
Stage 6:
Analyse APIs
2
SAP API Management – Hands-On Material
STAGE 1: CREATE SYSTEMS
Explanation
Screenshot
1. Log on to SAP API
Management API Portal
under HCP Trial Account > Services tab under ->
Integration category -> SAP
API Management using your
SCN user.
For this portion you will be in
the persona of
API Administrator
2. You should find yourself in the
“Systems” window by default,
if not, open the drop down
menu and select “Configure”
3. Choose “Create” from the
bottom right corner of the
screen, to create a system.
A system is a destination in
HCP that allows you to
connect to the backend
systems from which you want
to expose and manage APIs.
3
SAP API Management – Hands-On Material
4. In the Add System screen, fill
in the following properties:
Name – SAPDEVSystemES4
Description – SAP Developer
System
Host –
sapes4.sapdevcenter.com
Port – 443
Path Prefix - /sap/opu/odata
Use SSL – True
Authentication Type – Basic
Service Catalog URL /IWFND/CATALOGSERVICE/Ser
viceCollection
5. If you want to validate the
Catalog URL, copy and paste
the URL in your browser.
You will see a Catalog Service
from ES4. If you have not
accessed ES4 or if you need to
reset your password, check the
blog
http://scn.sap.com/docs/DOC40986
6. Choose Save.
4
SAP API Management – Hands-On Material
7. From the Systems view, click
on Launch link to open the
Destinations tab in your HCP
s
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.
8. 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:
5
SAP API Management – Hands-On Material
9. Click on Edit and enter your
credentials for the ES4 system:
10.
6
SAP API Management – Hands-On Material
STAGE 2: CREATE APIS
Now, you will create an API Proxy from the three supported Protocols:
1) SOAP
2) Generic REST
3) OData (via the ES4 system provisioned above, from SAP Gateway)
CREATING A SOAP API PROXY
SOAP, originally an acronym for Simple Object Access Protocol, is a protocol specification for
exchanging structured information in the implementation of web services in computer networks. A
common, older service implementation, you will create an API Proxy consuming a public SOAP
service.
Explanation
Screenshot
Back in the SAP API Management
Portal, go to the Manage Section
This will take you to the list of
APIs.
You will be back in the API portal
and not in HCP destination
anymore.
1. Click on Create -> Create API.
7
SAP API Management – Hands-On Material
2. The Create API Screen should
pop-up, similar to the
corresponding image.
3. Provider System: NONE
URL:
http://www.webservicex.net/globalwea
ther.asmx
Name: GlobalWeather
Title: GlobalWeather
Description: SOAP Channel
Base Path: /globalweather.asmx
Then select Service Type:
SOAP
4. Click “Create”
5. In the main screen:
Leave all the items here as
generated from the previous
screen. If additional controls
on resources contained in the
SOAP service were needed,
resources could be added
here.
6. Click the “Save” button to
save the API Proxy. A new
Proxy url is shown. This URL
would be the SAP API
Management URL exposed to
be consumed by an app.
8
SAP API Management – Hands-On Material
7. Open Test Console
8. This opens the Test
Console, a simple
SOAP/REST client, built
into SAP API Management,
to test basic operations,
change headers, and
cookies, on the API Proxies
in the system to simulate
data behavior.
9. Select the SOAP API from
the list on the left. If
needed, use the Search
function to locate your
exact API.
10. Note that when you select
the API the built-in client
auto-generates the URL for
the API Proxy
9
SAP API Management – Hands-On Material
11. Select POST radio button.
12. Click “Headers” then enter
Header name: Content-Type
Header Value: text/xml
13. Enter the following in POST
body:
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/so
ap/envelope/"
xmlns:web="http://www.webserviceX.NET">
<soapenv:Header/>
<soapenv:Body>
<web:GetCitiesByCountry>
<!--Optional:-->
<web:CountryName>india</web:CountryName>
</web:GetCitiesByCountry>
</soapenv:Body>
</soapenv:Envelope>
14. Click on Send to execute
the API.
The above POST body
sent the request to get a list
of all Cities by Country,
with the Country Value set
to “India”. The response
should be all cities in India
the weather service covers.
15. It is also possible to pass
requests by modifying the
query URL. Here is an
example:
Select “GET” Radio Button.
Append the following to the
end of your default URL:
/GetWeather?CityName=N
ew%20York&CountryName
=United%20States
Then click “Send”
10
SAP API Management – Hands-On Material
16. You should see in the
response the weather for
New York, US (in this case
from La Guardia Airport).
17. Now you have created and
consumed a SOAP service
through an API Proxy!
CREATING A REST API PROXY
While SOAP was originally the dominant protocol, REST with its greater simplicity has begun to usurp
the throne, with a majority of new public APIs being based on the REST protocol. Designed to be a
stateless protocol, it also tends to be more lightweight in use of bandwidth.
18. To create a new REST API,
return to the Manage
Section, to get back to the
list of APIs and be able to
create a new API.
19. Click on Create API
20. The Create API Screen
should be as follows
11
SAP API Management – Hands-On Material
21. Provider System. NONE
URL:
http://services.odata.org/V3/(S(z1r
bifbh4gvdwzwmzsoid1iz))/OData/
OData.svc/
Name: RestServiceRW
Title: RestServiceRW
Description: RESTServiceRW
Base Path: /RW
22. Click “Create”
23. In the main screen “add
Resource”
24. This will bring up an “Add
Resource” window. Enter:
Title: Products
Path Prefix: Products
12
SAP API Management – Hands-On Material
25. Deselect the check marks
for “PUT” and “DELETE”.
Then click “Add”
26. Click “Save” to save the
API Proxy. A new Proxy url
is shown.
27. Open Test Console
28. This opens the Test
Console, as before, to
perform operations on your
REST API.
13
SAP API Management – Hands-On Material
29. Select the REST API from
the list on the left. Use the
Search function if you are
having difficulty locating
your API.
30. Notice this time that the
Test Console automatically
fills in the URL for your API,
with the resource selected,
and also makes the
deselected operations
unusable.
31. Select GET radio button.
32. Edit the end of the url from
… / Products to
…/Products(0)
33. Click on Send to execute
the API.
34. You will see in the
Response Body the service
has returned a single
record (a “Read”) from the
Products list.
35. Click “Headers” then enter
Header name: ContentType
Header Value:
application/atom+xml
The header tells the service
to expect the POST body to
14
SAP API Management – Hands-On Material
be in standard ATOM+XML
format.
36. Edit the end of the url from
… / Products(0) to
…/Products
37. Make sure that POST is
selected
38. Enter the following in POST
body (replace any existing
data that is already there):
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom"
xmlns:d="http://schemas.microsoft.com/ado/2
007/08/dataservices"
xmlns:georss="http://www.georss.org/georss"
xmlns:gml="http://www.opengis.net/gml"
xmlns:m="http://schemas.microsoft.com/ado/
2007/08/dataservices/metadata"
xml:base="http://services.odata.org/V3/(S(z1r
bifbh4gvdwzwmzsoid1iz))/OData/OData.svc/"
>
<category term="ODataDemo.Product"
scheme="http://schemas.microsoft.com/ado/
2007/08/dataservices/scheme" />
<title type="text">Bread</title>
<summary type="text">Whole grain
bread</summary>
<content type="application/xml">
<m:properties>
<d:ID m:type="Edm.Int32">8990</d:ID>
<d:ReleaseDate
m:type="Edm.DateTime">1992-0101T00:00:00</d:ReleaseDate>
<d:DiscontinuedDate m:null="true" />
<d:Rating
m:type="Edm.Int16">4</d:Rating>
<d:Price
m:type="Edm.Double">2.5</d:Price>
</m:properties>
</content>
</entry>
Click “Send”
39. You have created a new
record of the same type
you retrieved earlier (the
Product is “Bread”) in the
service, using your API
Proxy.
40. To see your newly created
record, select the GET
radio button and change
your URL from
…/Products to
…/Products(8990)
This is the ID # in the
above POST body. Then
click “Send”.
15
SAP API Management – Hands-On Material
41. Now select “DELETE” from
the list of operations (when
modifying the URL to
include a specific product,
the operation will become
selectable). Then Click
“Send”. You should see an
error returned.
This is because you set the
DELETE operation to not
work for this Resource (the
error is the default error
created with API proxies).
42. To check and make sure
that the resource was not
deleted, send another GET
to the same URL. You
should see the same
response as before.
You have now created a
REST API Proxy, created a
specific resource and
defined allowed operations
on that resource!
CREATING AN ODATA API PROXY (FROM SAP GATEWAY)
OData is the SAP preferred protocol, as it is a powerful open-source protocol, which SAP has
adopted for many of its services, such as Fiori, HCI, Gateway, and other Extension applications to
connect backend business data. OData’s power comes from its comprehensive “Metadata” which
describes the data information, enabling relational data access for cloud services, and enforcing
permissions and authorizations. It also allows for simple document creation automatically, and more
that you will see in this exercise.
43. To create an OData API,
return to the Manage
screen as before.
44. Click on Create API
16
SAP API Management – Hands-On Material
45. The Create API Screen
should be as follows
46. Select the dropdown arrow
to bring up a list of Provider
Systems, then select
“SAPDEVSystemES4”.
This will allow you to browse
for an OData service on the
ES4 system.
If you need to reset your
password of ES4 system,
check the blog
http://scn.sap.com/docs/DOC40986
47. Click on Discover to see
the ODATA Services from
the provider system
48. Search and select the
ODATA Service
(GWSample_Basic) and click
OK.
17
SAP API Management – Hands-On Material
49. To auto-add SAP
documentation annotations
to the API Documentation,
pulled automatically from
the Metadata and backend
documentation leave
Documentation set to
“Yes”.
NOTE: This field is
applicable only while
fetching services from SAP
Gateway systems.
50. In the main screen, notice
that all the fields have been
auto-filled for you from the
Catalog. So not to conflict with
other participants change:
Name: GWSAMPLEBASIC
API Base Path:
/GWSAMPLEBasic
51. Click “Create”.
Note that unlike before, all
Resources have been pulled
automatically from the
backend.
Click the 2 downward arrows
next to the resource
“BusinessPartner” and scroll
down to see all field types
automatically documented,
including descriptions pulled
from the Backend.
52. To edit the details, select
the pencil icon.
At the top enter the following
text: “The Business
Partner end point allows you
to read or update the existing
business partners. Creation of
new business partner is not
allowed.”
Additionally, you can add
documentation under any of
the other fields, if desired.
18
SAP API Management – Hands-On Material
53. Click the “Apply” button to
save your changes to
documentation.
54. Save the API Proxy. A new
Proxy url is shown.
This will be the URL
exposed by SAP API
Management for
consumption, masking the
Url of the backend server.
55. To view the Target
Endpoint for this API Proxy,
select the highlighted icon.
56. You have not yet add this
API Proxy to any products,
but after you have, you can
view the products
associated with the API, by
selecting the highlighted
icon.
57. To add/view policies to the
API proxy and modify them,
select the highlighted icon.
58. To view the advanced
properties such as target
endpoint and proxy
endpoint details, select the
highlighted icon.
59. Select “Test” from the main
menu.
19
SAP API Management – Hands-On Material
60. This opens the Test
Console.
As before, select the API
you just created, and notice
that when you select the
API Proxy that you created,
the corresponding URL
appears automatically.
61. Select the drop down arrow
at the far right of the URL
bar, to see that the Test
Console has automatically
filled all the resource URLs
for you to select for this
API.
62. Unlike the previous two
Public services, this
backend requires
Authentication. Select
“Authentication: None” and
then select “Basic
Authentication” from the
drop down list. Enter the
following:
User Name:
Password:
These are your ES4
credentials.
63. Select the GET operation.
Click on Send to execute
the API.
As before the operations that
are not allowed in the original
creation, are greyed out in the
test console.
64. To view the response body
in raw format, select the
highlighted icon.
This allows you to copy and
paste the response body as
needed. If you want to
automatically use the full
response body content as
request to perform POST
operation, select the “Use
as Request” button.
20
SAP API Management – Hands-On Material
65. To view the sent/received
headers during the
operation, select the
highlighted icon.
66. To view any cookies sent
or received during the
operation, select the
highlighted icon.
67. The OData API was
generated with a single
selection from the Catalog
of the backend server,
along with all available
resources, which were
automatically populated
with rich documentation,
showing the power of
OData to simplify API
Creation.
Now that you have created
all the Protocols of API, it is
time to add governance.
21
SAP API Management – Hands-On Material
STAGE 3: MANAGE APIS
Explanation
Screenshot
1. Open the API Proxy that
you just created (your
OData API Proxy) by
navigating to the Manage
option.
2. Next, select your OData
API from the list, in order to
open it.
3. Select the API Artifacts
bubble showcased in Part 1
to launch the Debug viewer
to troubleshoot and monitor
APIs, by probing the details
of each step through the
API proxy flow.
4. In the API Debug Viewer,
choose Start Debug.
When you start the debug,
the API records details of
each step in the processing
pipeline. While the debug
session is running,
messages and contextual
data are captured from live
traffic.
Using the Test Console as before you
can call the API a few times.
One debug session supports
20 request/response
transactions per message
processor through the
selected API proxy. A debug
session automatically stops
after 10 minutes if you don't
22
SAP API Management – Hands-On Material
manually stop it. You can
also start the debug session
at any point in time of
working in the SAP API
management.
5.
If you want to view the
transaction details at any
point in time of an active
debug session,
choose Refresh.
Use the left side filter pane to
view any required API.
6.
When you've captured a
sufficient number of
requests, choose Stop
Debug.
7. Exit Debug Viewer and
select the API Artifacts
bubble showcased in Part 1
to launch the Policy
Designer for the API.
8. The Policy Designer
canvas provides a
representation of the
Request Response pipeline
of the API proxy.
Pipeline represents the flow
pattern and specifies the
condition on which this policy
should be executed.
23
SAP API Management – Hands-On Material
9.
Under “ProxyEndpoint”
select “PreFlow” of the
policy.
This means you are
creating a policy in the
PreFlow of the API proxy
that you created, and not of
the Target Endpoint.
10. Click on Edit to start
adding new policies.
11. Add Quota Policy by clicking
the “+” symbol next to Quota.
12. Enter the name for the Quota
policy as well as select the
stream as “Incoming Request”
13. The pre-flow should show the
policy in pipeline.
24
SAP API Management – Hands-On Material
14. The Policy Code editor lets
you change the default
parameters. Change the
“Allow Count” tag value from
“2” to “3”
15. Click on Update, and Save on
the Main Screen.
16. Test the API in the Test
Console, by sending more
requests than are allowed in
the quota settings (refer to test
console steps in Stage 1, Step
65-69). The quota set was 3
requests in 1 minute. Send 4
requests in under a minute.
17. Return to the Policy Designer
as in steps 1-3.
18. Open the Policy Designer,
Click Edit.
Select “Preflow” for
ProxyEndpoint.
Select XML to JSON policy
from the policy palette.
As before the PreFlow is for
the API proxy endpoint that
you created, and not of the
Target Endpoint
19. Enter the Name for the policy
and Select the Stream as
“Outgoing Response”, Click
Add
20. Keep the generated policy
definition as is.
Click Update from the Policy
designer.
25
SAP API Management – Hands-On Material
21. Click Save to update the API.
Now the policies will ensure
that the response from the
proxy is always in JSON
format, by converting the XML
data returned by the server,
into JSON format by the API
Proxy.
22. Open the Test Console as
before. Select your OData API
and send a GET request to
test the API.
Notice that the response
received by the client looks
very different in format from
before. Explore the JSON
response from the system to
see that all data remains the
same, simply in reduced
format.
23. Likely you’ll have noticed that
every time you opened the
Test Console, you had to reenter the Authorization
credentials. Sometimes it can
be advantageous to have the
API automatically pass
credentials to the backend.
24. Return to the Policy Designer
as in steps 1-3.
25. Open the Policy Designer,
Click Edit.
Select “Preflow” for
TargetEndpoint.
This means now we are
setting the policy to come in to
play directly before the API
Proxy sends data to the
backend server.
26
SAP API Management – Hands-On Material
26. Select “Basic Authentication”
policy from the Policy Pallete.
Name it “basicAuth”.
Select “Incoming Request
Stream”
Click “Add”
27. Replace the code in the
policy with the following:
<BasicAuthentication async='true'
continueOnError='false' enabled='true'
xmlns='http://www.sap.com/apimgmt'>
<Operation>Encode</Operation>
<IgnoreUnresolvedVariables>false</IgnoreU
nresolvedVariables>
<User ref="user"/>
<Password ref="pwd"/>
<AssignTo
createNew="false">request.header.Authoriz
ation</AssignTo>
</BasicAuthentication>
This will take “user” and
“pwd” and place them into an
Authorization header along with the
request.
28. Next add the “Key Value
Map Operations” policy
from the Policy Palette.
Name it
“setLoginCredentials”
Select “Incoming Request
Stream”
Click “Add”
29. Replace the code section
with the following:
Make sure to replace the
YourES4User with your ES4
username and YourES4Password
with your ES4 pasword
<!-- Key/value pairs can be stored, retrieved, and deleted from named
existing maps by configuring this policy by specifying PUT, GET, or
DELETE operations -->
<!-- mapIdentifier refers to the name of the key value map -->
<KeyValueMapOperations mapIdentifier="urlMapper" async="true"
continueOnError="false" enabled="true"
xmlns="http://www.sap.com/apimgmt">
<ExclusiveCache>false</ExclusiveCache>
<InitialEntries>
<Entry>
<Key>
<Parameter>username</Parameter>
</Key>
<Value>YourES4User</Value>
</Entry>
<Entry>
<Key>
<Parameter>password</Parameter>
</Key>
<Value>YourES4Password</Value>
</Entry>
</InitialEntries>
<Get assignTo="user">
<Key>
<Parameter>username</Parameter>
</Key>
27
SAP API Management – Hands-On Material
</Get>
<Get assignTo="pwd">
<Key>
<Parameter>password</Parameter>
</Key>
</Get>
<Scope>apiproxy</Scope>
</KeyValueMapOperations>
30. Your policy designer should
look like the corresponding
picture. However this is the
wrong order for policies. As
it sets the values to pass to
the server from basicAuth
before it the actual
credentials have been set.
Select setLoginCredentials,
and then click the left arrow
button (boxed in picture) to
move it to the right order.
31. Now that you have the
correct order, click
“Update” to update the
policies. Then click “Save”
to save the API.
32. Return to the API Test
Console, select your OData
API. Select GET operation
as before, but this time do
not input Authorization
credentials manually. Click
Send. You should receive a
valid response.
33. Now you have added some
of the most common
policies to your API Proxy,
it’s time to publish it for
consumption by
Developers.
28
SAP API Management – Hands-On Material
STAGE 4: PUBLISH APIS
Explanation
Screenshot
1. Open the API Proxy that
you just created by
navigating to the Manage
option and open the Policy
Designer, click on Edit and
select Preflow (as outlined
before)..
2. Add Verify API Key policy to
the pre-flow. The API Key is
used by the consuming
application to identify itself to
the API management system.
3. Enter the Policy Name and
Select the Stream to
“Incoming Request”
4. In the Policy definition editor,
Change the “<APIKey
ref='variable_containing_api_k
ey '/>” to
request.header.apikey
<VerifyAPIKey async='true' continueOnError='false'
enabled='true' xmlns='http://www.sap.com/apimgmt'>
<APIKey ref='request.header.apikey'/>
</VerifyAPIKey>
5. Click on Update and Save.
6. Go to the Resources pane of
the API Proxy and select GET
operation for BusinessPartner.
This is a shortcut that sends
you directly to the API Test
console, and selects the API,
auto-filling in the URL for the
{"fault":{"faultstring":"Failed to resolve API
Key variable
29
SAP API Management – Hands-On Material
selected Resource, for you to
try testing, to see if there is an
Error.
request.header.apikey","detail":{"errorcode":"
steps.oauth.v2.FailedToResolveAPIKey"}}}
7. Go to the “Manage Section”
and Select “Products” to List
the available products
Click on Create to Open the
Create Product screen.
Specify name, title and
description of the product.
Name: GWBASIC
Title: GWBASIC
8. Specify the quota limits for this
product.
To enforce quota on products,
you must define verify API key
and quota policies on the API.
Setting quota limits on a
product does not automatically
enforce quota on the API
proxies. The quota set on
product takes the precedence
with that of the API proxy. It is
a default limit that is
referenced in quota policies to
use uniform setting across all
API proxies in the product.
9. To enforce quota on product,
perform the following:
Select the API and launch
Policy Designer view, and select
a PreFlow.
30
SAP API Management – Hands-On Material
10. Select the Verify the API Key
policy and create a new policy.
Then, create a quota policy on the
same API where you want to
enforce quota. Use the given
payload to set the quota limits.
You will notice that the same API
Key is used, which is highlighted in
yellow. Then update the policy.
<!-- can be used to configure the number of
request messages that an app is allowed to
submit to an API over a course of unit time -->
<Quota async="false" continueOnError="false"
enabled="true" type="calendar"
xmlns="http://www.sap.com/apimgmt">
<Identifier ref='verifyapikey.<name of
verifyapikey>.client_id'/>
<!-- specifies the number of requests allowed
for the API Proxy -->
<Allow
countRef="verifyapikey.vap1.apiproduct.developer
.quota.limit" count="100"/>
<!-- the interval of time for
which the quota should be applied -->
31
SAP API Management – Hands-On Material
<Interval
ref="verifyapikey.<verifyapikey>.apiproduct.deve
loper.quota.interval">1</Interval>
<!-- used to specify if a
central counter should be maintained and
continuously synchronized across all message
processors -->
<Distributed>true</Distributed>
<!-- Use to specify the date and time when the
quota counter will begin counting,
regardless of whether any requests have been
received from any apps -->
<StartTime>2015-11-11
12:00:00</StartTime>
<!-- if set to true, the
distributed quota counter is updated
synchronously. This means that
the update to the counter will be made at the
same time the API call is quota-checked -->
<Synchronous>true</Synchronous>
<!-- Use to specify the unit of time applicable
to the quota. Can be second, minute, hour, day,
or month -->
<TimeUnit
ref="verifyapikey.vap1.apiproduct.developer.quot
a.timeunit">month</TimeUnit>
</Quota>
11. Click the “+” in order to add an
API to the Product. Select the
OData API that you had
created earlier and click OK.
Use the search if you cannot
find it easily.
12. You should see your API in
the list of APIs under the
Product.
Then click Publish.
STAGE 5: DISCOVER APIS TO CONSUME
Explanation
Screenshot
32
SAP API Management – Hands-On Material
1. Access the Dev portal
under HCP Trial Account > Services tab under ->
Integration category -> SAP
API Management using your
HCP user.
For this portion you will be in the
persona of
API Developer
1. Open the product that you had
created as an API
Administrator, which was
published to the Developer
Portal
2. Explore the APIs in the
product and the
documentation. Notice that
everything generated in the
API Portal, was automatically
translated to the Developer
Portal.
3. Click on Subscribe and select
New Application to Create a
New Application.
4. Enter the Application Details
(Name, Description) and
Save.
There is no need to enter
callback URL, as we are not
using oauth in the exercise.
33
SAP API Management – Hands-On Material
5. Go to the Consume Section to
See your App
6. On clicking on your
Application shows the details
of the app key and secret (this
is only used for Oauth).
Select and Copy the
“Application Key” (this is your
API Key).
You will use this API Key
again later, so open a
Notepad or other program to
keep it for use again later (or
else you will need to come
back to the App and copy it
again).
7. Select “Test” from the
Dropdown Menu, as you did
before as an API Administrator
to bring up the API Test
Console.
8. Select your API Proxy, and
Select the GET operation in
the Test Console. Click the
“Headers” button, and then
add a Header with name
“apikey” and the value as the
key copied.
9. Click on Send to get a
successful response.
34
SAP API Management – Hands-On Material
10. Now with your fully configured
OData API Proxy, with control
policies, and API Key, the API
is ready to have an App
developed on it!
STAGE 6: ANALYZE APIS
Explanation
Screenshot
1. Go back to the API Portal
by logging in as API
Administrator
For this portion you will be
in the persona of
API Administrator
2. Choose Analyze from the
menu and select the
required view.
Performance View:
Displays the performancerelated charts and KPIs,
such as API traffic for a
specific period of time.
Error View: Displays errorrelated charts and KPIs,
such as total number of API
errors.
3. Select the required parameter
in any view for more details.
4.
If you want to create a
custom chart, choose Analyze Data
at the bottom right corner of the
screen.
35
SAP API Management – Hands-On Material
5.
Select the required
measures and dimensions from the
left filter pane.
6.
Enter a name to the chart in
the Title field and choose Save.
7.
The chart appears in the
Custom View for your references.
© 2015 SAP SE or an SAP affiliate company. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP SE or an SAP
affiliate company. SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered
trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries.
Please see http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark for additional trademark information and notices.
36