Skip to content

Fcm Subscribe Topic

Description

FCM 訂閱 Topic

Resource

POST /v2/push/fcm/topic/subscribe

Request Body Parameters

Name Type Description
app_name string 推播APP
topic string Topic名稱
vip_list string[] 會員列表

Request

{
  "app_name": "m_store",
  "topic": "test_Topic",
  "vip_list": ["900000000000000052", "test"]
}

Response Body Parameters - Item

Name Type Description
success int 向FCM發送訂閱請求成功訂閱數量
failure int 向FCM發送訂閱請求訂閱失敗數量
errors object[] 向FCM發送訂閱請求訂閱失敗原因列表
error_members str[] 會員Token有誤列表
message str 訊息

Response

失敗

400

{
  "success": 0,
  "failure": 1,
  "errors": [
    {
      "reason": "INVALID_ARGUMENT",
      "vip_id": "900000000000000052"
    }
  ],
  "error_members": [
    "test"
  ],
  "message": "訂閱Topic失敗"
}

400

{
  "message": "查無會員token",
  "error_members": [
    "test"
  ]
}

部分成功

200

{
  "success": 1,
  "failure": 0,
  "error_members": [
    "test"
  ],
  "message": "訂閱Topic部分成功"
}

200

{
  "success": 1,
  "failure": 1,
  "errors": [
    {
      "reason": "NOT_FOUND",
      "vip_id": "TWNe01"
    }
  ],
  "message": "訂閱Topic部分成功"
}

成功

200

{
  "success": 1,
  "failure": 0,
  "message": "訂閱Topic成功"
}