Skip to Content
Technical Articles
Author's profile photo Holger Neuert

Introducing Cloud Management Tools – CLI and APIs for SAP Cloud Platform (PART 2)

In the first part of the introduction of Cloud Management Tools I showed the Command Line Interface (CLI) of SAP Cloud Platform. In this blog I will show you the APIs (application programming interfaces) for SAP Cloud Platform.

SAP Cloud Platform – Core Service APIs (Beta)

The new core service APIs allow you to manage, build, and extend the core capabilities of SAP Cloud Platform. Each core service focuses on a different aspect of the platform, from the management of accounts and product entitlements, through to the registration and provisioning of subscriptions for multitenant applications and services.

Use this URL to access the interface where you can explore the available APIs and try them out:

You’ll find seven API packages that are offered by three main core services: Cloud Management, User Data Management, and Service Management. There is also an additional Events Service APIs. For more information see

Core Services APIs

Cloud Management (Beta)

This service offers the Accounts, Entitlements, Provisioning, SaaS Manager, and Events packages. To use them, use the sapcp CLI

  1. sapcp assign accounts/entitlement –to-subaccount subaccount1 –for-service cis –plan central –distribute ‘true’ –enable ‘true’ –auto-assign ‘true’ (where subaccount1 is your subaccount ID)
  2. cf create-service cis central cisinstance (where cisinstance is your instance name)

or go to the cockpit and entitle the “Cloud Management (Beta)” service to your account and enable it (create a service instance). To get full access to these API packages, use the service plan “central”.


Cloud Management – Entitlements

The next step is to create a service instance:


Service Instance

And then you must create a service key:


Service Key

First, we need an access token to use the APIs. You can get an access token via CLI or via API. Please keep a note of your <url><clientid>, and <clientsecret>.

Create an access token with command line using your <url>, <clientid>, and <clientsecret>  (get more information here):

Example for Mac OS:

curl -L -X POST '<url>/oauth/token’ \ 
-H 'Content-Type: application/x-www-form-urlencoded’ \ 
-u '<clientid>:<clientsecret>’ \ 
-d 'grant_type=password’ \ 
-d 'username=<user email>’ \ 
-d 'password=<password>’

Or, you can create an access token via API (for example, using Postman):

Use POST and enter <url>/oauth/token’, Content-Type:”application/x-www-form-urlencoded” and Authorization “no auth”

In the body, enter grant-type: password, and your SAP Cloud Platform login e-mail and password for username and password, respectively.

If all goes well, you’ll get your access_token. You must add this access token to Swagger to be authorized. Let me show you how…

Open Swagger and click on Accounts:

Then, click on

and add “Bearer <access_token>” into the Value field (remember to leave a space between “Bearer” and the actual token):

Now you can try out the service!


You should get a response that looks something like this:

  "guid": "…",
  "displayName": "…",
  "createdDate": 1597396380178,
  "modifiedDate": 1597396380178,
  "entityState": "OK",
  "stateMessage": "Global account created.",
  "subdomain": "atrial-ga",
  "contractStatus": "ACTIVE",
  "commercialModel": "Subscription",
  "consumptionBased": false,
  "licenseType": "TRIAL",
  "geoAccess": "STANDARD",
  "renewalDate": 1597396380060

Usage Data Management

The Usage Data Management currently offers the Resource Consumption API, which as its name suggests allows you generate reports based on the resource and cost consumption. Very useful. To use it, you must first entitle the Usage Data Management service and then enable it.

To get full access to this API package, use the service plan “uas”.


Service Instance UDM

And then create a service key similar to before:


Service Key

Again, to use the APIs you need to use <url> , <clientid>, and <clientsecret> to create an access token via CLI or API.

To create an access token with command line, see this example for Mac OS:

curl '<uaa_url>/oauth/token' -X POST \ 
-H 'Accept: application/json’ \ 
-d 'grant_type=client_credentials&client_id=<clientid>&client_secret=<clientsecret> '

Or you can create an access token via API (using e.g. Postman):


Postman – UDM Header

Use POST and enter <url>/oauth/token, Accept: application/json

And enter grant_type: client_credentials, with your client_id and client_secret in these fields, respectively:


Postman – UDM body

Open Swagger and click on


Resource Consumption

Click on


and add “Bearer <access_token>” into the Value field:


Now you can try out the service. Remember, if your account is new, you might not see much usage data.

Enter fromDate and toDate to specify the date range:

As a result, you should see this as example:

  "content": [
      "globalAccountId": "…",
      "globalAccountName": "atrial",
      "subaccountId": "…",
      "subaccountName": "Mars",
      "directoryId": "…",
      "directoryName": "DIRECTORY",
      "reportYearMonth": 202008,
      "serviceId": "hana-cloud",
      "serviceName": "SAP HANA Cloud",
      "plan": "hana",
      "planName": null,
      "environmentInstanceId": "…",
      "environmentInstanceName": "myname",
      "spaceId": "…",
      "spaceName": "dev",
      "instanceId": "…",
      "measureId": "capacity_units",
      "metricName": "Capacity Units",
      "unitSingular": "capacity unit",
      "unitPlural": "capacity units",
      "identityZone": "",
      "dataCenter": "cf-eu10",
      "dataCenterName": "cf-eu10",
      "usage": 41.48

With these two core services, you can now easily create and manage your account environment, activate services, and get usage reports.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo DJ Adams
      DJ Adams

      Great stuff Holger

      For those interested in watching some live stream recordings related to these great topics, you might want to check out the following episodes from our "Hands-on SAP dev" live stream series

      HandsOnSAPDev Ep.77 - Exploring sapcp - the CLI for SAP Cloud Platform

      HandsOnSAPDev Ep.79 - A first look at the Core Service APIs for SAP Cloud Platform


      Author's profile photo Murali Shanmugham
      Murali Shanmugham

      Thank you for those videos

      Author's profile photo Peter Asigbetse
      Peter Asigbetse

      Thanks for this Holger Neuert and for the videos DJ Adams, does anyone know how to get migrated from Feature Set A to Feature Set B? My trial account is B but I have access to another Neo account which is A and would like to get that to B as well.

      Thanks in advance.

      Author's profile photo Cristian Gonzalez Rivas
      Cristian Gonzalez Rivas

      Hello, we are in the same situation.

      We are awaiting the change of our feature set from A to B in our business account. Does anyone know when it's scheduled? Is it possible to order it on request?

      We are in a conversation with SAP support, but we're still waiting for a response and we would like to know if anyone has received a response from SAP or knows when this change will be effective.

      Thanks in advance.

      Author's profile photo Holger Neuert
      Holger Neuert
      Blog Post Author

      Hello Cristian, we are currently starting the the migration process with first customers and will soon blog post new information (also via the SAP Integration & Extension Suites Product Management Newsletter) how you can switch from Feature Set A to B. Stay tuned. Regards, Holger