콘텐츠로 건너뛰기

Notify 일괄 처리

POST https://api.pushwoosh.com/messaging/v2/notify/batch

한 번의 호출로 여러 메시지를 보냅니다. 모든 항목은 독립적인 Notify입니다. 독립 실행형 Notify 요청과 똑같이 유효성 검사를 받으며, 자체 결과를 얻습니다.

요청 구조

Anchor link to
Shape
{
"items": [
{
"item_id": "caller-defined-id",
"request": { ... }
}
]
}
필드유형설명
itemsNotifyBatchItem 배열필수, 1~500개 항목(서버 구성 제한). 항목은 동시에 처리되며, 결과는 요청 순서에 관계없이 반환됩니다.

NotifyBatchItem

Anchor link to
필드유형설명
item_idstring호출자가 제공하는 선택적 상관관계 ID로, 일치하는 결과에 다시 에코됩니다. 그 외에는 Pushwoosh에서 사용되지 않습니다.
requestNotifyRequest단일 Notify 호출과 동일한 본문 — segment 또는 transactional, transaction_id 포함. 필수.
Terminal window
curl -X POST https://api.pushwoosh.com/messaging/v2/notify/batch \
-H "Authorization: Token YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"items": [
{
"item_id": "order-1001",
"request": {
"transactional": {
"application": "XXXXX-XXXXX",
"platforms": ["IOS", "ANDROID"],
"users": { "list": ["user-123"] },
"payload": {
"content": {
"localized_content": {
"en": { "ios": { "body": "Your order has shipped." } }
}
}
},
"schedule": { "at": "2026-05-01T12:00:00Z" },
"message_type": "MESSAGE_TYPE_TRANSACTIONAL",
"transaction_id": "order-1001-shipped"
}
}
},
{
"item_id": "order-1002",
"request": {
"transactional": {
"application": "XXXXX-XXXXX",
"platforms": ["IOS", "ANDROID"],
"users": { "list": ["user-456"] },
"payload": {
"content": {
"localized_content": {
"en": { "ios": { "body": "Your order has shipped." } }
}
}
},
"schedule": { "at": "2026-05-01T12:00:00Z" },
"message_type": "MESSAGE_TYPE_TRANSACTIONAL",
"transaction_id": "order-1002-shipped"
}
}
}
]
}'
{
"results": [
{
"item_id": "order-1001",
"index": 0,
"result": {
"message_code": "XXXXX-XXXXX-XXXXX",
"unknown_identifiers": []
}
},
{
"item_id": "order-1002",
"index": 1,
"error": {
"code": 3,
"message": "invalid argument",
"reason": "EmptySchedule",
"domain": "api.pushwoosh.com"
}
}
],
"succeeded": 1,
"failed": 1
}
필드유형설명
resultsNotifyBatchResult 배열요청된 항목당 하나의 항목, 요청 순서대로.
succeededinteger결과를 반환한 항목 수.
failedinteger오류를 반환한 항목 수.

NotifyBatchResult

Anchor link to
필드유형설명
item_idstring요청 항목 item_id의 에코.
indexinteger요청에서 항목의 0부터 시작하는 위치. item_id가 비어 있을 때 결과를 상호 연관시키는 데 사용합니다.
resultobject항목이 성공했을 때 설정됩니다. 단일 Notify 응답과 동일한 형태: message_code 및 unknown_identifiers.
errorNotifyBatchError항목이 실패했을 때 설정됩니다.

NotifyBatchError

Anchor link to
필드유형설명
codeintegergRPC 상태 코드(google.rpc.Code), 예: INVALID_ARGUMENT의 경우 3.
messagestring개발자 대상 오류 메시지, 영어로 제공됩니다.
reasonstring짧은 상태 이름 — 단일 Notify 호출이 반환하는 것과 동일한 값, 예: EmptySchedule.
domainstring오류 도메인, api.pushwoosh.com.

오류는 표준 gRPC-Gateway 오류 봉투를 사용합니다: { "code": ..., "message": ..., "details": [...] }. 이는 전체 요청을 실패시키는 봉투 수준의 오류입니다. 개별 항목이 실패하면 이러한 오류 대신 results[]에 항목별 error가 생성됩니다(위의 NotifyBatchError 참조).

HTTP 상태조건
400items가 비어 있습니다.
400items에 서버 구성 제한(기본값 500)보다 많은 항목이 있습니다.
400항목 중 하나에 request가 없습니다.

예시

제한이 500일 때 501개 항목을 보내면 HTTP 400이 반환됩니다:

{
"code": 3,
"message": "items must not exceed 500 entries, got 501",
"details": []
}

관련 항목

Anchor link to