Querying SAP APIs in JavaScript or TypeScript

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

After completing this lesson, you will be able to:

  • Query an SAP API using the SAP Cloud SDK in a JavaScript and TypeScript program

Consulting the SAP Cloud SDK for JavaScript reference documentation

Access the reference documentation

The reference documentation of SAP Cloud SDK can be accessed via the following steps:

  1. Open: https://sap.github.io/cloud-sdk
  2. Choose Get started with the SDK for JavaScript.

The Core Libraries

The SDK consists of a few core libraries and a number of API-specific pregenerated libraries.

Pregenerated Libraries

While you can generate your own libraries, the SAP Cloud SDK for JavaScript provides pregenerated client libraries for the SAP S/4HANA Cloud and On-Premise APIs as well as the SAP Workflow service. These libraries are published under the SAP Developer license agreement and are free to use.

Pregenerated Libraries are API specific. The reference to their documentation can be found in the SAP API Business Hub. For example try the following steps:

  1. Open: https://api.sap.com
  2. Search: Business Partner A2X
  3. Click on the first API
  4. Choose the SAP Cloud SDK tab.
  5. Choose the JavaScript tab.
  6. Choose the link of the NPM Repository.

Using the libraries to consume the SAP APIs

Information about the way to use the libraries to interact with the SAP APIs is described in the following pages of the standard documentation:

Save progress to your learning plan by logging in or creating an account

Login or Register