사용량 이벤트 일괄 수집
curl --request POST \
--url https://meterengine.com/v1/event-batches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
{
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"properties": {},
"timestamp": "2023-11-07T05:31:56Z",
"transaction_id": "<string>",
"type": "<string>"
}
]
}
'const url = 'https://meterengine.com/v1/event-batches';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: [
{
customer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
properties: {},
timestamp: '2023-11-07T05:31:56Z',
transaction_id: '<string>',
type: '<string>'
}
]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"results": [
{
"error": {
"code": "validation_error",
"message": "서버 내부 오류입니다",
"errors": [
{
"field": "event_type",
"message": "공백일 수 없습니다"
}
]
},
"index": 123,
"result": "stored",
"transaction_id": "<string>"
}
]
}{
"code": "validation_error",
"message": "서버 내부 오류입니다",
"errors": [
{
"field": "event_type",
"message": "공백일 수 없습니다"
}
]
}{
"code": "validation_error",
"message": "서버 내부 오류입니다",
"errors": [
{
"field": "event_type",
"message": "공백일 수 없습니다"
}
]
}{
"code": "validation_error",
"message": "서버 내부 오류입니다",
"errors": [
{
"field": "event_type",
"message": "공백일 수 없습니다"
}
]
}이벤트 일괄 전송
사용량 이벤트 일괄 수집
1건부터 100건까지 받아 입력 순서대로 stored, duplicate, rejected 결과를 돌려준다. 원소의 형식 오류는 다른 원소의 저장을 막지 않는다. 봉투 오류는 400이다.
POST
/
v1
/
event-batches
사용량 이벤트 일괄 수집
curl --request POST \
--url https://meterengine.com/v1/event-batches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"events": [
{
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"properties": {},
"timestamp": "2023-11-07T05:31:56Z",
"transaction_id": "<string>",
"type": "<string>"
}
]
}
'const url = 'https://meterengine.com/v1/event-batches';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
events: [
{
customer_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
properties: {},
timestamp: '2023-11-07T05:31:56Z',
transaction_id: '<string>',
type: '<string>'
}
]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));{
"results": [
{
"error": {
"code": "validation_error",
"message": "서버 내부 오류입니다",
"errors": [
{
"field": "event_type",
"message": "공백일 수 없습니다"
}
]
},
"index": 123,
"result": "stored",
"transaction_id": "<string>"
}
]
}{
"code": "validation_error",
"message": "서버 내부 오류입니다",
"errors": [
{
"field": "event_type",
"message": "공백일 수 없습니다"
}
]
}{
"code": "validation_error",
"message": "서버 내부 오류입니다",
"errors": [
{
"field": "event_type",
"message": "공백일 수 없습니다"
}
]
}{
"code": "validation_error",
"message": "서버 내부 오류입니다",
"errors": [
{
"field": "event_type",
"message": "공백일 수 없습니다"
}
]
}