Integrating the SAP Build Apps Extension With an API

Objectives
After completing this lesson, you will be able to:

After completing this lesson, you will be able to:

  • Make an HTTP request with an API URL
  • Set up the API data resource
  • Test the API call

Introduction: Integrating the SAP Build Apps Extension With an API

Up to this point, you’ve laid out your UI, and built the underlying logic to power the workflow. Now, we need to connect it to the data that will display a result on the screen after the barcode is scanned. The data we need for the Barcode Scanner App is stored in a modern database in the cloud that can be retrieved via an Application Programming Interface (API).

APIs are the foundation of how many modern applications are built because they are separate from the apps using them, and actually allow many different applications to make use of the same centralized data resources at the same time.

APIs can be accessed using URLs, which fetch the information we need in our app.

Making an HTTP Request with an API URL

Now we need to integrate with the API for the Barcode Scanner App, to make a connection to the OpenFoodFacts database. OpenFoodFactshas provided the following URL to read data for a product, which we’ll use in this lesson:https://world.openfoodfacts.org/api/v0/product/[barcode].json

To make the app work, we need to make an HTTP request with the scanned barcode to this API URL.

Set Up the API Data Resource

Follow Along Step-By-Step to Create the Data Resource

In SAP AppGyver, we will integrate with the API of OpenFoodFacts by creating a data resource. Data resources serve as connectors between data sources, such as APIs, and the application.

Test the API Call

Follow Along Step-By-Step to Create the Data Resource

In SAP AppGyver, we will integrate with the API of OpenFoodFacts by creating a data resource. Data resources serve as connectors between data sources, such as APIs, and the application.

Log in to track your progress & complete quizzes