본문으로 건너뛰기

푸시 토큰 관리 API Endpoints

Thumbnail Image

🔔 최신화 일자: 2026-01-13


nachocode 푸시 토큰 관리 API를 활용하여 푸시 토큰을 관리 할 수 있습니다.

이 문서에서는 API 사용법, 요청/응답 형식, 에러 케이스 등을 다룹니다.

[DELETE] /api/push/v2/token

설명

  • SDK의 registerPushToken()을 통해 토큰이 등록된 유저에 한하여, 해당 유저에게 매칭된 토큰을 모두 삭제합니다.
  • 유저 1명당 요청 건수를 차감합니다.
제한

요청 당 userId의 최대 개수는 100개입니다.


Request

  • Header

    ParameterTypeRequiredDescription
    x-api-keystringAPI 키
    x-secret-keystringSecret 키
  • Body

    ParameterTypeRequiredConstraintsDescription
    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

      PropertiesTypeDescription
      statusnumberHTTP 응답 상태 코드 (202)
      responseDeleteTokenResult토큰삭제 성공, 등록 토큰 부재, 토큰삭제 실패 유저의 목록
    • 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

      ParameterTypeDescription
      statusCodenumber상태 코드
      pathstring요청 경로
      codestring에러 코드
      messagestring에러 메세지
    • Example

      {
      "statusCode": 400,
      "path": "/api/push/v2/token",
      "code": "ERR-AB-VAL-00",
      "message": "Incorrect request. Server cannot understand request."
      }
    • 에러코드





상수 및 객체 상세 설명

DeletePushTokenResult

  • Property

    ParameterTypeDescription
    successstring[]userId를 통해 등록된 토큰이 존재하였고, 삭제에 성공한 userId들의 목록
    tokenNotFoundstring[]userId를 통해 토큰이 발견되지 않은 userId들의 목록
    failedstring[]삭제에 실패한 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"]
    }



공통 에러코드

샌드박스 혹은 운영환경에서 아래에 명세되지 않은 에러 코드를 수신받을 경우 나쵸코드로 문의해주세요.

ErrorCodeStatusCodeMessageDescription
ERR-AB-VAL-00400Incorrect request. Server cannot understand request.요청 Body 데이터가 잘못된 경우
ERR-AB-SGK-11400Secret key not found.Secret Key가 전달되지 않았을 경우
ERR-AB-SGK-13401Incorrect secret key.유효하지 않은 Secret Key
ERR-AB-KSY-11400Required parameters missing.API Key가 전달되지 않았을 경우
ERR-AB-KSY-13404Provided key information not found. Please check your key again.유효하지 않은 API Key
ERR-AB-AGK-11400Api key not found.Api Key가 전달되지 않았을 경우
ERR-AB-AGK-12400Invalid api key type.유효하지 않은 API Key