# プロジェクト ログ API

## 概要

プロジェクトの API キーを利用してそのプロジェクトの直近 30 日分の最大 1000 件のログを取得できます。

## セッションログ一覧

**API URL**: 

セッションログの一覧を取得します。

```console
$ curl -sS \
    -X POST \
    https://api.sora-cloud.shiguredo.app/projects/list-session-logs \
    -H "Authorization: Bearer <API-KEY>" \
    | jq .
[
    {
        "timestamp": "2023-12-21T10:13:59.947433Z",
        "channel_id": "channel-1@A5J467N5AWTQHFSA2VIKVNGDB2VK2DC9",
        "session_id": "DM2ASQDRF90H9DPS5S5ABKWTKM",
        "total_connections": 1,
        "max_connections": 1,
        "created_timestamp": "2023-12-21T10:13:21.731452Z",
        "destroyed_timestamp": "2023-12-21T10:13:59.947058Z",
        "duration_min": 0
    },
    {
        "timestamp": "2023-12-21T08:05:21.073115Z",
        "channel_id": "channel-2@A5J467N5AWTQHFSA2VIKVNGDB2VK2DC9",
        "session_id": "4HW0G1Y65H57519CFEHTGP5ZG0",
        "total_connections": 1,
        "max_connections": 1,
        "created_timestamp": "2023-12-21T08:03:24.052625Z",
        "destroyed_timestamp": "2023-12-21T08:05:21.072713Z",
        "duration_min": 1
    },
    ...
]
```

## コネクションログ一覧

**API URL**: 

コネクションログを取得します。

```console
$ curl -sS \
    -X POST \
    https://api.sora-cloud.shiguredo.app/projects/list-connection-logs \
    -H "Authorization: Bearer <API-KEY>" \
    | jq .
[
    {
        "timestamp": "2023-12-21T10:13:42.909631Z",
        "channel_id": "channel-1@A5J467N5AWTQHFSA2VIKVNGDB2VK2DC9",
        "session_id": "DM2ASQDRF90H9DPS5S5ABKWTKM",
        "client_id": "96NA2SW34N4HB948FZQATMKNV0",
        "bundle_id": "96NA2SW34N4HB948FZQATMKNV0",
        "connection_id": "96NA2SW34N4HB948FZQATMKNV0",
        "total_received_bytes": 1500758,
        "total_sent_bytes": 2272,
        "created_timestamp": "2023-12-21T10:13:21.938754Z",
        "destroyed_timestamp": "2023-12-21T10:13:42.909534Z",
        "duration_min": 0
    },
    {
        "timestamp": "2023-12-21T08:05:04.017143Z",
        "channel_id": "channel-2@A5J467N5AWTQHFSA2VIKVNGDB2VK2DC9",
        "session_id": "4HW0G1Y65H57519CFEHTGP5ZG0",
        "client_id": "J7DSDH13392X797FS0Z8A35R34",
        "bundle_id": "J7DSDH13392X797FS0Z8A35R34",
        "connection_id": "J7DSDH13392X797FS0Z8A35R34",
        "total_received_bytes": 7200849,
        "total_sent_bytes": 10596,
        "created_timestamp": "2023-12-21T08:03:24.262361Z",
        "destroyed_timestamp": "2023-12-21T08:05:04.016977Z",
        "duration_min": 1
    },
    ...
]
```

## API ログ一覧

**API URL**: 

API ログを取得します。

```console
$ curl -sS \
    -X POST \
    https://api.sora-cloud.shiguredo.app/projects/list-api-logs \
    -H "Authorization: Bearer <API-KEY>" \
    | jq .
[
    {
        "timestamp": "2023-12-21T10:19:58.216Z",
        "url": "https://api.sora-cloud.shiguredo.app/projects/list-connection-logs",
        "status": 200,
        "elapsed_time_ms": 4
    },
    {
        "timestamp": "2023-12-21T10:19:58.202Z",
        "url": "https://api.sora-cloud.shiguredo.app/projects/list-session-logs",
        "status": 200,
        "elapsed_time_ms": 6
    },
    ...
]
```

## Sora API ログ一覧

**API URL**: 

Sora API ログを取得します。

```console
$ curl -sS \
    -X POST \
    https://api.sora-cloud.shiguredo.app/projects/list-sora-api-logs \
    -H "Authorization: Bearer <API-KEY>" \
    | jq .
[
    {
        "timestamp": "2023-12-19T07:28:23.248Z",
        "sora_target": "Sora_20230628.TerminateSession",
        "channel_id": "channel-1@A5J467N5AWTQHFSA2VIKVNGDB2VK2DC9",
        "status": 200,
        "elapsed_time_ms": 2130
    },
    {
        "timestamp": "2023-12-19T04:12:05.857Z",
        "sora_target": "Sora_20161101.StopRecording",
        "channel_id": "channel-1@A5J467N5AWTQHFSA2VIKVNGDB2VK2DC9",
        "status": 200,
        "elapsed_time_ms": 5
    },
    {
        "timestamp": "2023-12-19T04:08:37.131Z",
        "sora_target": "Sora_20161101.StartRecording",
        "channel_id": "channel-1@A5J467N5AWTQHFSA2VIKVNGDB2VK2DC9",
        "status": 200,
        "elapsed_time_ms": 8
    },
    ...
]
```

## ウェブフックログ一覧

**API URL**: 

ウェブフックログを取得します。

```console
$ curl -sS \
    -X POST \
    https://api.sora-cloud.shiguredo.app/projects/list-webhook-logs \
    -H "Authorization: Bearer <API-KEY>" \
    | jq .
[
    {
        "timestamp": "2023-12-21T10:19:50.009Z",
        "type": "connection.created",
        "url": "https://example.com/event",
        "status": 200,
        "elapsed_time_ms": 4
    },
    {
        "timestamp": "2023-12-21T10:19:49.817Z",
        "type": "recording.started",
        "url": "https://example.com/session",
        "status": 200,
        "elapsed_time_ms": 4
    },
    ...
]
```
