> ## Documentation Index
> Fetch the complete documentation index at: https://docs.acedata.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# 取得 AceDataCloud 平台服務申請列表

> Platform 整合指南 - Ace Data Cloud

分頁返回帳戶擁有或獲授權使用的 Application，包括餘額、狀態、服務摘要和關聯憑證。適合批量餘額監控、查找 Application ID 和進入憑證管理。

## 準備工作

1. 登入 [AceDataCloud 平台](https://platform.acedata.cloud)。
2. 在 [Account Token 控制台](https://platform.acedata.cloud/console/platform-tokens)建立帳戶權杖。
3. 一般使用者使用 `user_id=me`；也可從 `GET /api/v1/platform-tokens/me/` 取得自己的 UUID。

```shell theme={null}
export PLATFORM_TOKEN='你的账户令牌'
```

## 介面概覽

| 項 | 內容 |
| - | - |
| 方法 | `GET` |
| URL | `https://platform.acedata.cloud/api/v1/applications/` |
| 鑑權 | Account Token，OAuth token 需 `applications:read` |
| 分頁 | `count` + `items` |

一般使用者應傳入 `user_id=me`。不傳入時查詢未先依帳戶縮小範圍，分頁遇到無權物件可能返回 `403`；管理員不傳入時可檢視全表。

## 查詢參數

| 參數 | 類型 | 必填 | 說明 |
| - | - | - | - |
| `user_id` | UUID / `me` | 一般使用者必填 | 查詢主體；支援重複參數 |
| `affiliation` | string | 否 | `owner`（預設）或 `granted`；可重複傳入兩者取聯集，僅在有 `user_id` 時生效 |
| `service_id` | UUID | 否 | 依服務篩選；支援重複參數 |
| `scope` | string | 否 | `Individual` 或 `Global`；支援重複參數 |
| `type` | string | 否 | `Usage` 或 `Period`；支援重複參數 |
| `limit` | integer | 否 | 每頁筆數，最大 100 |
| `offset` | integer | 否 | 分頁偏移量 |
| `ordering` | string | 否 | 僅支援 `created_at` 或 `-created_at` |

`paid`、`disabled`、`expired`、`low_balance` 和 `tag` 目前不是伺服器端篩選參數。餘額警示應拉取列表後，根據每個 Application 的 `remaining_amount`、`service.unit` 和業務閾值在用戶端判斷。

## 請求範例

```shell theme={null}
curl --get 'https://platform.acedata.cloud/api/v1/applications/' \
  --data-urlencode 'user_id=me' \
  --data-urlencode 'affiliation=owner' \
  --data-urlencode 'limit=100' \
  -H "Authorization: Bearer ${PLATFORM_TOKEN}"
```

同時檢視自己擁有和別人授權給自己的 Application：

```shell theme={null}
curl --get 'https://platform.acedata.cloud/api/v1/applications/' \
  --data-urlencode 'user_id=me' \
  --data-urlencode 'affiliation=owner' \
  --data-urlencode 'affiliation=granted' \
  -H "Authorization: Bearer ${PLATFORM_TOKEN}"
```

## 回應說明

回應為 `{count, items}`。每項包含 Application 模型欄位，並附加：

* `service`：`id`、`alias`、`title`、`type`、`unit`、`icon_url`；
* `credentials`：目前呼叫者有權看到的憑證摘要；
* `paid`、`remaining_amount`、`used_amount`、`disabled`、`allow_consume_global`；
* `scope` 的真實值為 `Individual` 或 `Global`；
* `type` 的真實值為 `Usage` 或 `Period`。

`remaining_amount` 可能為空；用戶端必須先判空，再進行數字比較。額度單位由 `service.unit` 決定。

## 下一步

* [查詢單一 Application 詳情](https://platform.acedata.cloud/documents/platform-application-detail)
* [餘額監控快速指南](https://platform.acedata.cloud/documents/application-remaining-amount)
* [建立 API 憑證](https://platform.acedata.cloud/documents/platform-credential-create)
* [建立儲值訂單](https://platform.acedata.cloud/documents/platform-order-create)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.