> ## 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 API guide - 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 | いいえ | 1ページあたりの件数、最大 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 と、他者から自分に許可された 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.