Skip to Content

SAP HCP predictive services, Test the "Data Set" HCP predictive services using a REST client

Previous

SAP HCP predictive services, Test the "Data Set" HCP predictive services using a REST client

By Abdel Dadouche

Using a REST client, you will test the "Data Set" HCP predictive services

You will learn

  • How to “Register” your data set with the HCP predictive services using a REST Client

Details


In order to ease the readability of this tutorial, we have used tokens to replace long URLs.
Therefore you can replace any occurrence of the token by the value listed above.
Make sure you update the URL with your HCP identifier.

Token Value
<C4PA URL> http://aac4paservices<HCP Identifier>trial.hanatrial.ondemand.com/com.sap.aa.c4pa.services

  1. Open a new tab in Postman.

    Fill in the following information

    Field Name Value
    Request Type POST
    URL <C4PA URL>/api/analytics/dataset/sync

    Postman URL

    Select the Authorization tab

    Field Name Value
    Type Basic Auth
    Username your HCP Account login (usually the email address used to register your HCP account)
    Password* your HCP Account password

    Postman URL

    Select the Body tab, enable the raw mode and select JSON (application/json) in the drop down, then add the following entries

    {
      "hanaURL":"DEMO/TIME_SERIES"
    }
    

    Postman URL

    Click on Send

    Click on Send an additional 2 or 3 times, so you will have multiple dataset registered.

  2. It will now display the data set registration identifier, the number of rows and the variable descriptions.

    Now, we can use the ID value to reference the registered dataset with other HCP predictive services calls.

    {
      "ID": 1,
      "name": "TIME_SERIES",
      "numberOfColumns": 25,
      "numberOfRows": 272,
      "variables": [
         {
           "name": "Date",
           "position": 0,
           "storage": "date",
           "value": "continuous"
         },
         {
    
         }
      ]  
    }
    
  3. Open a new tab in Postman.

    Fill in the following information

    Field Name Value
    Request Type GET
    URL <C4PA URL>/api/analytics/dataset/1

    Select the Authorization tab and fill in the same details as in the previous call.

    Click on Send

    You should receive the same description as from the previous call. If you try with an unknown ID, you should receive an error message.

  4. Open a new tab in Postman.

    Fill in the following information

    Field Name Value
    Request Type GET
    URL <C4PA URL>/api/analytics/dataset/1/variable/1

    Select the Authorization tab and fill in the same details as in the previous call.

    Click on Send

    You should receive the description of the first variable from your data set.

  5. Open a new tab in Postman.

    Fill in the following information

    Field Name Value
    Request Type DELETE
    URL <C4PA URL>/api/analytics/dataset/2

    Select the Authorization tab and fill in the same details as in the previous call.

    Click on Send

    You have now deleted the second data set we have registered.

  6. Open a new tab in Postman.

    Fill in the following information

    Field Name Value
    Request Type GET
    URL <C4PA URL>/api/analytics/dataset/

    Select the Authorization tab and fill in the same details as in the previous call.

    Click on Send

    You have now listed all the data set registered in your environment.

Optional

For more details on the HCP predictive services, you can check the following URL:
- <C4PA URL>/raml/index.html?raml=../aa-cloud-services.raml

Next Steps

Next
Back to top