# Sora Cloud API

## 概要

Sora Cloud では組織とプロジェクト向けの API を提供しています。

## 利用方法

**API ベース URL**: 

HTTP API を実行する例では [curl](https://curl.se/) を利用しています。
また、 curl の JSON レスポンスを整形するために、コマンドラインツール [jq](https://github.com/jqlang/jq) を利用しています。

> **重要**
>
> すべての API で `POST` を利用します。

```console
$ curl -sS \
    -X POST \
    https://api.sora-cloud.shiguredo.app/orgs/get-total-connections-this-month \
    -H "Authorization: Bearer <API-KEY>" \
    | jq .
```

Bearer トークンにはプロジェクトで作成した API キーを指定してください。

## 組織 API

組織 API を利用するにはプロジェクトでの API キーのパーミッションをプロジェクトと組織の両方を指定してください。

### ステータス API

[組織 ステータス API](org_api_status.html)

組織の現在のステータスを取得する API です。

### トラフィック API

[組織 トラフィック API](org_api_traffic.html)

組織のトラフィック情報を取得する API です。

### セッション API

[組織 セッション API](org_api_session.html)

組織のセッション情報を取得する API です。

### ログ API

[組織 ログ API](org_api_log.html)

組織のログ情報を取得する API です。

### 録画ログ API

[組織 録画ログ API](org_api_log_recording.html)

組織の録画ログ情報を取得する API です。

## プロジェクト API

無効 (disabled) に設定されているプロジェクトでは利用できません。

### アクセストークン API

[プロジェクト アクセストークン API](project_api_access_token.html)

アクセストークンを生成、管理する API です。

### トラフィック API

[プロジェクト トラフィック API](project_api_traffic.html)

プロジェクトのトラフィック情報を取得する API です。

### セッション API

[プロジェクト セッション API](project_api_session.html)

プロジェクトのセッション情報を取得する API です。

### ログ API

[プロジェクトログ API](project_api_log.html)

プロジェクトのログ情報を取得する API です。

### 録画ログ API

[プロジェクト 録画ログ API](project_api_log_recording.html)

プロジェクトの録画ログ情報を取得する API です。

## シーケンス図

```mermaid
sequenceDiagram
    participant cloud as Sora Cloud
    participant app as アプリケーションサーバー
    app->>+cloud: 今月の合計コネクション数 API<br>/orgs/get-total-connections-this-month
    cloud-->>-app: 200 OK
```
