エンドポイント
Capgo cloudのパブリックAPIに関するドキュメントです。
アクセスするには、ヘッダーにAPIキーをauthorization
として追加してください。
組織
このエンドポイントでは、組織とそのメンバーを管理できます。
GET
https://apicapgoapp/organization
組織情報を取得します。パラメーターにorgId
が指定されている場合は1つの組織を返し、それ以外の場合はアクセス可能なすべての組織を返します。
interface Organization { id: string created_by: string created_at: string updated_at: string logo: string | null name: string management_email: string customer_id: string | null}
返り値:
return Organization[] | Organization
POST
https://apicapgoapp/organization
既存の組織を更新します。管理者権限が必要です。
interface OrganizationUpdate { orgId: string logo?: string name?: string management_email?: string}
OrganizationUpdate
型のリクエストボディが必要です。
成功時は以下を返します:
return { status: 'Organization updated', data: Organization }
PUT
https://apicapgoapp/organization
新しい組織を作成します。
interface OrganizationCreate { name: string}
OrganizationCreate
型のリクエストボディが必要です。
成功時は以下を返します:
return { status: 'Organization created', id: string }
APIキー
このエンドポイントでは、Capgo APIへのアクセスに使用するAPIキーを管理できます。
GET
https://apicapgoapp/apikey
アカウントのAPIキーを取得します。アクセス可能なすべてのAPIキーを返します。
interface ApiKey { created_at: string | null id: number key: string mode: 'read' | 'write' | 'upload' | 'all' name: string updated_at: string | null user_id: string}
返り値:
return ApiKey[]
POST
https://apicapgoapp/apikey
特定の組織の新しいAPIキーを作成します。
クエリパラメーター:
interface ApiKeyCreate { org_id: string mode: 'read' | 'write' | 'upload' | 'all'}
返り値:
return { apikey: ApiKey }
DELETE
https://apicapgoapp/apikey/:id
既存のAPIキーを削除します。
パラメーター:
id
: 削除するAPIキー
成功時の返り値:
return { success: true }
失敗時の返り値:
return { error: string, supabaseError?: any }
メンバー (/organization/members)
GET
組織メンバーを取得します。
{ orgId: string }
型のリクエストボディ(クエリパラメーター)が必要です。
成功時は以下を返します:
interface Member { uid: string; email: string; image_url: string; role: "invite_read" | "invite_upload" | "invite_write" | "invite_admin" | "invite_super_admin" | "read" | "upload" | "write" | "admin" | "super_admin";}return Member[]
DELETE
https://apicapgoapp/organization/members
組織メンバーを削除します。
interface MemberDelete { orgId: string email: string}
MemberDelete
型のリクエストボディ(クエリパラメーター)が必要です。
成功時は以下を返します:
return { status: 'OK' }
失敗時は以下を返します:
return { error: string, status: 'KO' }
統計情報
このエンドポイントでは、アプリと組織に関する様々な統計情報を取得できます。
GET /statistics/app/:app_id
特定のアプリの統計情報を取得します。
クエリパラメーター:
interface StatsQuery { from: Date to: Date graph?: 'mau' | 'storage' | 'bandwidth'}
返り値:
interface Stats { date: string mau: number // 月間アクティブユーザー storage: number // ストレージ使用量(バイト) bandwidth: number // 帯域幅使用量(バイト)}
graph
パラメーターが指定された場合、要求された指標のSVG画像による可視化を返します。
GET /statistics/user
ユーザーがアクセスできるすべての組織の集計統計を取得します。
クエリパラメーター:
interface StatsQuery { from: Date to: Date graph?: 'mau' | 'storage' | 'bandwidth'}
返り値:
graph
が指定されていない場合:
interface Stats { date: string mau: number // 月間アクティブユーザー storage: number // ストレージ使用量(バイト) bandwidth: number // 帯域幅使用量(バイト)}[]
graph
パラメーターが指定された場合、要求された指標のSVG画像による可視化を返します。
GET /statistics/org/:org_id
特定の組織の統計情報を取得します。
クエリパラメーター:
interface StatsQuery { from: Date to: Date graph?: 'mau' | 'storage' | 'bandwidth'}
返り値:
graph
が指定されていない場合:
interface Stats { date: string mau: number // 月間アクティブユーザー storage: number // ストレージ使用量(バイト) bandwidth: number // 帯域幅使用量(バイト)}[]
graph
パラメーターが指定された場合、要求された指標のSVG画像による可視化を返します。
チャンネル
このエンドポイントでは、アプリの利用可能なすべてのチャンネルを確認および変更できます。
POST
https://apicapgoapp/channel
チャンネルを作成または更新するために送信します。
type disable_update = "major" | "minor" | "version_number" | "none"interface ChannelSet { app_id: string channel: string version?: string public?: boolean disableAutoUpdateUnderNative?: boolean disableAutoUpdate?: disable_update ios?: boolean android?: boolean allow_device_self_set?: boolean allow_emulator?: boolean allow_dev?: boolean}
受け取る値:
{ "status": "ok" }
GET
https://apicapgoapp/channel
URLパラメーターとしてapp_id
を送信すると、最初の50個のチャンネルの配列を受け取ります。
page=1
を送信することで次の50個を取得できます。
interface Channel { id: number; created_at: string; name: string; app_id: string; version: { id: number, name: string }; created_by: string; updated_at: string; public: boolean; // デフォルトかどうか disableAutoUpdateUnderNative: boolean; disableAutoUpdate: boolean; allow_emulator: boolean; allow_dev: boolean;}[]
オプションでURLパラメーターとしてchannel
名を送信すると、1つのチャンネルを受け取ります:
interface Channel { id: number; created_at: string; name: string; app_id: string; version: { id: number, name: string }; created_by: string; updated_at: string; public: boolean; // デフォルトかどうか disableAutoUpdateUnderNative: boolean; disableAutoUpdate: boolean; allow_emulator: boolean; allow_dev: boolean;}
DELETE
https://apicapgoapp/channel
これをクエリパラメーターとして送信します
interface Channel { channel: string app_id: string}
受け取る値:
{ "status": "ok" }
デバイス
このエンドポイントでは、アプリにリンクされているすべてのデバイスを確認および変更できます。
POST
https://apicapgoapp/device
送信するデータ:
interface DeviceLink { app_id: string device_id: string version_id?: string // バージョン名(より良い名前に移行予定) channel?: string // チャンネル名}
受け取る値:
{ "status": "ok" }
GET
https://apicapgoapp/device
URLパラメーターとしてapp_id
を送信すると、最初の50個のデバイスの配列を受け取ります。page=1
を送信することで次のものを取得できます
interface Device{ created_at?: string | undefined; updated_at?: string | undefined; device_id: string; custom_id: string; version: { id: number, name: string }; app_id: string; platform?: "ios" | "android" | undefined; plugin_version: string; os_version?: string | undefined; version_build: string; is_prod: boolean; is_emulator: boolean;}[]
オプションでURLパラメータとしてdevice_id
を送信すると以下を受け取ります:
interface Device { created_at?: string | undefined; updated_at?: string | undefined; device_id: string; version: { id: number, name: string }; app_id: string; platform?: "ios" | "android" | undefined; plugin_version: string; os_version?: string | undefined;}
DELETE
このエンドポイントはチャネルとバージョンオーバーライドのリンクを解除するためのものです。Capgoからデバイスを削除することはできません
https://apicapgoapp/device
これをクエリパラメータとして送信
interface Device { device_id: string app_id: string}
これを受信:
{ "status": "ok" }
バンドル
このエンドポイントではアプリにリンクされているすべてのバンドルを確認および削除できます
GET
https://apicapgoapp/bundle
URLパラメータとしてapp_id
を送信すると最初の50個のバンドルの配列を受け取ります
page=1
を送信することで次のものを取得できます
interface Bundle { app_id: string bucket_id: string | null checksum: string | null created_at: string | null deleted: boolean external_url: string | null id: number minUpdateVersion: string | null name: string native_packages: Json[] | null owner_org: string r2_path: string | null session_key: string | null storage_provider: string updated_at: string | null user_id: string | null}[]
DELETE
クラウド内の1つのバンドルを削除
https://apicapgoapp/bundle
これをクエリパラメータとして送信
interface Bundle { app_id: string version: string}
これを受信:
{ "status": "ok" }
あるいは以下を送信することもできます
interface Bundle { app_id: string}
すべてのバンドルを削除するには