푸시 토큰 관리 API Endpoints
🔔 최신화 일자: 2026-01-13
nachocode 푸시 토큰 관리 API를 활용하여 푸시 토큰을 관리 할 수 있습니다.
이 문서에서는 API 사용법, 요청/응답 형식, 에러 케이스 등을 다룹니다.
[DELETE] /api/push/v2/token
설명
- SDK의
registerPushToken()을 통해 토큰이 등록된 유저에 한하여, 해당 유저에게 매칭된 토큰을 모두 삭제합니다. - 유저 1명당 요청 건수를 차감합니다.
제한
요청 당 userId의 최대 개수는 100개입니다.
Request
-
Header
Parameter Type Required Description x-api-key string✔ API 키 x-secret-key string✔ Secret 키 -
Body
Parameter Type Required Constraints Description userIds (string | number)[]✔ 길이 100이하의 배열 토큰을 삭제할 유저 ID 배열 -
Example
curl -X DELETE "https://app.nachocode.io/api/push/v2/token" \
-H "Content-Type: application/json" \
-H "x-api-key: API_KEY_VALUE" \
-H "x-secret-key: SECRET_KEY_VALUE" \
-d '{
"userIds": ["USER_ID_1", "USER_ID_2", "USER_ID_3", ...]
}'
Response
-
Success Response
-
Property
Properties Type Description status numberHTTP 응답 상태 코드 (202) response DeleteTokenResult토큰삭제 성공, 등록 토큰 부재, 토큰삭제 실패 유저 의 목록 -
Example
{
"success": ["USER_ID_1", "USER_ID_2", "USER_ID_3"],
"tokenNotFound": ["USER_ID_5", "USER_ID_6"],
"failed": ["USER_ID_4"]
}
-
-
Error Response
-
Property
Parameter Type Description statusCode number상태 코드 path string요청 경로 code string에러 코드 message string에러 메세지 -
Example
{
"statusCode": 400,
"path": "/api/push/v2/token",
"code": "ERR-AB-VAL-00",
"message": "Incorrect request. Server cannot understand request."
}
-
상수 및 객체 상세 설명
DeletePushTokenResult
-
Property
Parameter Type Description success string[]userId를 통해 등록된 토큰이 존재하였고, 삭제에 성공한 userId들의 목록 tokenNotFound string[]userId를 통해 토큰이 발견되지 않은 userId들의 목록 failed string[]삭제에 실패한 userId들의 목록 (토큰 발견여부를 판별하기에 부적합합니다.) * 유저가 여러개의 토큰을 보유하고 있을 경우,
success,failed항목에 동일한 userId가 존재할 수 있습니다. -
Example
{
"success": ["USER_ID_1", "USER_ID_2", "USER_ID_3"],
"tokenNotFound": ["USER_ID_5", "USER_ID_6"],
"failed": ["USER_ID_4"]
}
공통 에러코드
샌드박스 혹은 운영환경에서 아래에 명세되지 않은 에러 코드를 수신받을 경우 나쵸코드로 문의해주세요.
| ErrorCode | StatusCode | Message | Description |
|---|---|---|---|
| ERR-AB-VAL-00 | 400 | Incorrect request. Server cannot understand request. | 요청 Body 데이터가 잘못된 경우 |
| ERR-AB-SGK-11 | 400 | Secret key not found. | Secret Key가 전달되지 않았을 경우 |
| ERR-AB-SGK-13 | 401 | Incorrect secret key. | 유효하지 않은 Secret Key |
| ERR-AB-KSY-11 | 400 | Required parameters missing. | API Key가 전달되지 않았을 경우 |
| ERR-AB-KSY-13 | 404 | Provided key information not found. Please check your key again. | 유효하지 않은 API Key |
| ERR-AB-AGK-11 | 400 | Api key not found. | Api Key가 전달되 지 않았을 경우 |
| ERR-AB-AGK-12 | 400 | Invalid api key type. | 유효하지 않은 API Key |