Query on Ali baba Cloud Billing API BOA

378 Views Asked by At

I was trying to get some data by using one of the api call QueryInstanceBill

The resulted JSON seems to be long and there is no date column to filter on how i got those many records.

Could someone here help me out

2

There are 2 best solutions below

0
Kishan On

QueryInstanceBill API returns data for billing cycle which is usually for a month (YYYY-MM)

If you want data for a particular date then in request parameter provide the value for field "BillingDate" in format: YYYY-MM-DD and the value for field "Granularity" should be "DAILY"

Check out the documentation:
https://www.alibabacloud.com/help/doc-detail/100400.htm

Also, you can use OpenAPI Explorer, I have provided BillingCycle as "2019-10", BillingDate as "2019-10-15" and Granularity as "DAILY":
https://api.aliyun.com/#/?product=BssOpenApi&version=2017-12-14&api=QueryInstanceBill&params={%22RegionId%22:%22cn-hangzhou%22,%22Granularity%22:%22DAILY%22,%22BillingCycle%22:%222019-10%22,%22BillingDate%22:%222019-10-15%22}&tab=DEMO&lang=JAVA

0
Juan Enrique Rojas Sanchez On

To be able to filter by date, The billing date only used when Granularity is DAILY,format: YYYY-MM-DD. Example 2020-07-29

You can also use the "BillingCycle" field in the request: The billing cycle. Format: YYYY-MM. Example: 2020-07

Documentation: https://www.alibabacloud.com/help/doc-detail/100400.htm