Push Data API
Updated at:2025-11-03
API description
Push data to BCM for monitoring. With the Custom Monitor function, data can be pushed to BCM for real-time monitoring using this API.
Usage restrictions
Currently, the Custom Monitor function is available only in the Beijing, Guangzhou, Suzhou, and Hong Kong regions and unavailable elsewhere.
Request structure
- Method: POST
- URL:/json-api/v1/metricdata/{userid}/{scope}
- For the request body, refer to the request parameters and examples below
Request parameters
| Name | Types | Description | Required or not | Parameter location |
|---|---|---|---|---|
| userId | String | Tenant ID | Yes | URL parameter |
| scope | String, limited to the following character set: 0~9, A~Z, a~z, _ | Scope | Yes | URL parameter |
| metricData | List<MetricDatum> | Monitor item data | Yes | RequestBody |
MetricDatum
| Name | Types | Description | Required or not |
|---|---|---|---|
| metricName | String | Monitor item name | Yes |
| dimensions | List<Dimension> | Dimension | Yes |
| value | double | Monitor item value | No |
| timestamp | String | Time | Yes |
Dimension
| Name | Types | Description | Required or not |
|---|---|---|---|
| name | String | Dimension name | Yes |
| value | String | Dimension value | Yes |
Response parameters
| Name | Types | Description |
|---|---|---|
| requestId | String | Request identifier |
| code | String | Return code |
| message | String | Return information |
Request example
Plain Text
1POST /json-api/v1/metricdata/user1/UserDefined_BCC HTTP/1.1
2Host:bcm.bj.baidubce.com:80
3{
4 "metricData": [
5 {
6 "metricName": "pv",
7 "dimensions": [
8 {
9 "name": "os",
10 "value": "centos"
11 },
12 {
13 "name": "serviceName",
14 "value": "myService"
15 }
16 ],
17 "value": 1234567,
18 "timestamp": "2014-05-26T07:30:00Z"
19 },
20 {
21 "metricName": "responseTime",
22 "dimensions": [
23 {
24 "name": "os",
25 "value": "windows"
26 },
27 {
28 "name": "serviceName",
29 "value": "myService"
30 }
31 ],
32 "value": 1234568,
33 "timestamp": "2014-05-26T07:30:00Z"
34 }
35 ]
36}
Response example
Successful response example
Plain Text
1{
2 "requestId": "45113fb2-fe84-411f-809b-9383d43003cd",
3 "code": "OK",
4 "message": ""
5}
Unsuccessful response example
Plain Text
1{
2 "requestId": "45113fb2-fe84-411f-809b-9383d43003cd",
3 "code": "INVALID_PARAMETER_VALUE",
4 "message": "Metric data required"
5}
