Configure API Proxy

Configure API Proxy

In this chapter you will publish the API you have created previously so it can easily be discovered, tested, and used by anyone.

Create an API product

In API Management, you can reuse artifacts. The same applies to API proxies: API proxies can be bundled in different API products to be published in different ways to developers (as freemium API, paid API, internal-only, …). This is what you will do next: create an API Product which will include your previously created API Proxy.

  1. Navigate to the Engage section of Integration Suite using the left-hand menu.

    Chap_3
  2. You will see Products and Applications. Click on Create.

    Chap_3
  3. Enter the following information

    Copy the the required text values below to complete the configuration:

    Chap_3
    1. Name: {placeholder|userid}_catalog
    2. Title: {placeholder|userid}_catalog
    3. Description: Sales Orders and product maintenance contracts.
  4. Click on the APIs tab, On the right, over the table , click on Add.

    Chap_3
  5. Search for your API proxy _MSO_API and select it to add it to the API Product.

    Chap_3

    Note

    It is also possible to limit the API proxy for specific resources to include only a subset of information in one API product, and then include more information in another API product, using the same API proxy.
  6. Click on Publish in the top right corner menu.

    Chap_3

    Note

    The API product is published on your

Create an API key

You will now act as consumer of the API proxy we have created and published.

  1. Open the Developer Hub by clicking on the link on the top right menu.

    Chap_3
  2. You can search for your user () and verify that you now have access to the product _catalog by selecting it.

    Chap_3
  3. Select the APIs tab to view the APIs contained in this API product.

    Chap_3
  4. Select the Subscribe button and choose Create New Application.

    Chap_3
  5. Enter the following text values to complete the configuration:

    1. Title: MSO App {placeholder|userid}
    2. Short Text: Maintenance and Sales Order application.
    3. Take me to this application now: checked
    4. Select Create

    Chap_3
  6. As can be seen, you now have access to an Application Key, also known as API Key or Application Secret. This key can be used to access the REST API we have previously configured, which is “secured” by an API key.

    Copy the value of the Application Key from the user interface and save it somewhere locally. This is the apikey which will be used later on.

    Chap_3

    Chap_3

Test API with Developer Hub

  1. Select API Reference and then choose Try out.

    As a developer or integration expert, you may want to use this API in your project. This means that you will get an API key from the Developer Hub which your application will provide every time the API is called. This not only allows to do a first authorization check, it also allows API management to know exactly who has used which API in an application context.

    Chap_3

Add Header

  1. Copy the the required text values below to complete the configuration:

    1. Add Parameters: Click the Add button
    2. Add Header
    3. Header Name: Authorization
    4. Header value:
    Code Snippet
    1
    {placeholder|auth_id}
    1. Execute

    Chap_3

    Note

    Return Code

Add Query Parameter

  1. Copy the the required text values below to complete the configuration:

    1. Add Parameters: Click the Add button
    2. Add Query
    3. Query Name: apikey
    4. Query value: paste in the apikey value which you have copied earlier
    5. Execute

Chap_3

A successful response should look as follows:

Chap_3

Use SAP Build Apps application

Now that you have finished the configuration of the API, let’s test it. To do so,

  1. Launch the Sales and Maintenance Orders web application.

    Chap_3

    Chap_3

Congratulations! You have completed this SAP Basic Trial!