Skip to content

Latest commit

 

History

History
53 lines (30 loc) · 2.12 KB

File metadata and controls

53 lines (30 loc) · 2.12 KB

User Access

The SAP Service Manager API can be accessed using OAuth 2.0 access tokens issued for named users, which have the proper roles assigned to them.

Procedure

  1. Get an access token:

    curl 'https://service-manager.cfapps.<region domain>/v1/oauth/<subdomain>/token' -i -X POST -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: application/json' --data 'grant_type=password&username=<username>&password=< password>'
    

    Note:

    If in Swagger, use your username and password. The subdomain is the subaccount subdomain, in which you would like to try the API. You can find it in the SAP BTP cockpit Overview tab of your subaccount.

    See Enable API Access to an XSUAA Configuration.

    Note:

    The access token received also contains the scopes that are granted for this access token. Therefore, only APIs which require one of these scopes can be used with this access token.

    {
      "access_token": "<access_token>",
      "token_type": "bearer",
      "expires_in": 43199,
      "scope": "<xsappname>.job.read <xsappname>.event.read"
    }
    
    
  2. Add the Authorization header to your request: “Authorization: Bearer <access token>”.