SendData
- Print
- PDF
SendData
- Print
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Summary
This API sends JSON data to the Cloud Insight Collector.
Request
API URL
URL: https://cw.apigw.ntruss.com/cw_collector/real/data
URL: https://cw.apigw.ntruss.com/cw_collector/real/ (Deprecated)
Method: POST
Request header
The request headers specified in common settings are required.
Content-Type: application/json
x-ncp-apigw-signature-v2: {generated signature}
x-ncp-apigw-timestamp: {current timestamp}
x-ncp-iam-access-key: {your iam access key}
Info
When sending data from the Singapore region (SGN), it is required to add X-NCP-REGION_NO=7 to the header.
If the above header is not added when sending data from the Singapore region (SGN), data aggregation and events may not work properly.
Request Body
{
"cw_key": "string",
"data": {
actual JSON data
}
}
- It can also send the following JSON data array.
{
"cw_key": "string",
"data": [
{
actual JSON data
},
{
actual JSON data
},
{
actual JSON data
}
]
}
Example
Request Example
The following code shows an example of how to send the data to a custom product with cw_key "xxxxxxxxxxxxxxxxxx" and schema using the following structure:
- Dimension :
instanceId
- Metric :
cpu
,sessionCount
,trafficIn
POST /cw_collector/real/data
Host: cw.apigw.ntruss.com
Content-Type: application/json
x-ncp-apigw-signature-v2: {generated signature}
x-ncp-apigw-timestamp: {current timestamp}
x-ncp-iam-access-key: {your iam access key}
{
"cw_key": "xxxxxxxxxxxxxxxxxx",
"data": {
"cpu": 1.5,
"sessionCount": 1290,
"trafficIn": 12984721,
"instanceId": "2194837"
}
}
Reference:
- Records without
cw_key
are ignored and discarded. - A data element with a record may contain one or more defined metric or dimension fields.
Response Example
The API returns HTTP code 200 as well as the response in the following JSON format if the data is sent without any errors.
{
"result": "success",
"dataId": -1,
"message": ""
}
Was this article helpful?