列出产品
列出应用下的所有 Product。用于控制台同步与 catalog 管理。
GET
/v1/products参数
| 参数 | 类型 | 位置 | 说明 |
|---|---|---|---|
Authorization必填 | string | Header | Bearer {secret_key} |
app_id必填 | string | Query | 应用 ID。 |
请求示例
HTTP
GET /v1/products?app_id=app_01KFOCUSIOS HTTP/1.1
Host: api.subhub.dev
Authorization: Bearer sk_live_neostudio_8f3k2m9x4l0p7q2r5s8u1v响应示例
HTTP
HTTP/1.1 200 OK
Content-Type: application/json
{
"object": "list",
"data": [
{
"id": "prod_01PROMO",
"name": "Premium 首月优惠",
"identifier": "com.neo.focustimer.promo",
"entitlement_identifier": "premium",
"type": "subscription",
"status": "active"
},
{
"id": "prod_02PROYR",
"name": "Premium 年费",
"identifier": "com.neo.focustimer.pro.yearly",
"entitlement_identifier": "premium",
"type": "subscription",
"status": "active"
}
]
}代码示例
var components = URLComponents(string: "https://api.subhub.dev/v1/products")!
components.queryItems = [URLQueryItem(name: "app_id", value: "app_01KFOCUSIOS")]