Curl
Overview
This article provides an example of calling the Dashboard Data API directly with curl, suitable for quickly verifying an API key and request format, or for integration into automation scripts.
Prerequisites
A valid API key has been obtained (created under [Dashboard] → [Dashboard API Keys] in the left menu); see Dashboard Data API.
Example
The following example calls the Get Tag History API (POST /dashboard/api/v2/open_api/history) to retrieve history data for two tags over a specified time range, aggregated as an hourly mean. Replace {your API key} with an actual API key, and adjust start, end, tags, and other parameters as needed:
bash
curl -X POST "https://www.weincloud.net/open-api/dashboard/api/v2/open_api/history" \
-H "X-API-KEY: {your API key}" \
-H "Content-Type: application/json" \
-d '{
"start": "2024-06-25T03:35:42.657Z",
"end": "2024-06-25T04:35:42.657Z",
"tags": [
{
"hw_key": "AAA",
"name": "tag1"
},
{
"hw_key": "BBB",
"name": "tag2"
}
],
"every": "1h",
"every_mode": "mean",
"option": {
"fill": "none",
"derivative": false
}
}'