Hitachi Content Platform​

 View Only

 How to get next page from HCP Anywhere Reporting API?

  • Object Storage
  • Hitachi Content Platform HCP
  • Hitachi Content Platform HCP Anywhere
Jyri Aaltonen's profile image
Jyri Aaltonen posted 05-02-2019 07:57

Next page from reporting API. Could someone explain how to use that next page token? I don't understand how that PageToken is added to that curl. Here what is at help file.

Creating a paging token input parameter

Here is an example of how to edit the userReportParams.json file to request an additional page of the audit report. This example uses a shortened page token. The page token in an actual report is longer.

  1. userReportParams.json

{

"pageToken": "+pwZ104r7ERfS3vPnSI/qw9RcJhm4d/OqQEOJvjVTe0Q1\nf8R59hdu6OJu8Q\u003d"

}

Curl Command for requesting a subsequent page

Here is an example of how to request an additional page of the audit report. Notice that the curl command does not change, only the request body.

Curl command request

curl -kiX POST -T userReportParams.json -H "Accept: application/json" -H "Authorization: Bearer ya29.qwHWIcw1FLhJh4-Y84FP_mp-PqaTgS5vHCNENuAB42qQ_4C5QuO4tmvTFE-XeLbYtDFhDGN65dA6yg" -H "X-HCPAW-MANAGEMENT-API-VERSION: 2.1.0" -H "X-HCPAW-DEVICE-ID:myUniqueID" "https://api.anywhere.example.com:8000/mapi/report/audit/user/activity/file/modifications"


#HitachiContentPlatformHCP
#HitachiContentPlatformHCPAnywhere
Vern Lee's profile image
Vern Lee

Not sure if you already figured this out but thought I would tell you what I found. You actually modify the json file you are referencing in the command to include the returned next page token from your first query. I did a do while loop until no next page token is returned. I hope this helps.