apiGrowth plan機能

APIエンドポイント

Screenzzie REST APIの全エンドポイントの完全なリファレンス

docs.apiCtaBanner.title

docs.apiCtaBanner.description

APIエンドポイントリファレンス

利用可能なすべてのREST APIエンドポイントの完全なドキュメントです。

組織とイントロスペクション

現在のAPIコンテキストと組織に関する情報を取得します。

現在のコンテキストを取得

GET /api/v1/me

APIキー、組織、レート制限、利用可能な機能に関する情報を返します。このエンドポイントはレート制限にカウントされません。

リクエスト例:

curl -X GET "https://www.screenzzie.com/api/v1/me" \
  -H "Authorization: Bearer sk_live_xxx"

レスポンス例:

{
  "success": true,
  "data": {
    "apiKey": {
      "id": "uuid",
      "name": "My API Key",
      "keyPrefix": "sk_live_abc123",
      "scopes": ["screens:read", "screens:write", "playlists:read"],
      "expiresAt": null,
      "lastUsedAt": "2024-01-15T10:30:00Z"
    },
    "organization": {
      "id": "uuid",
      "name": "My Company",
      "planId": "growth",
      "subscriptionStatus": "active",
      "trialEndsAt": null,
      "maxScreensAllowed": 50,
      "activeScreensCount": 12
    },
    "rateLimits": {
      "limit": 100000,
      "used": 45,
      "remaining": 99955,
      "resetAtMs": 1704153600000
    },
    "features": {
      "sequences": true,
      "schedules": true,
      "api": true
    }
  }
}

組織一覧

GET /api/v1/organizations

APIキーでアクセス可能な組織を返します。現在、各APIキーは1つの組織に属しています。

クエリパラメータ:

パラメータタイプ説明
pagenumberページ番号(デフォルト:1)
limitnumber1ページあたりのアイテム数(デフォルト:20、最大:100)

リクエスト例:

curl -X GET "https://www.screenzzie.com/api/v1/organizations" \
  -H "Authorization: Bearer sk_live_xxx"

レスポンス例:

{
  "success": true,
  "data": {
    "items": [
      {
        "id": "uuid",
        "name": "My Company",
        "planId": "growth",
        "subscriptionStatus": "active",
        "maxScreensAllowed": 50,
        "activeScreensCount": 12,
        "createdAt": "2024-01-01T00:00:00Z"
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 20,
      "total": 1,
      "totalPages": 1,
      "hasMore": false
    }
  }
}

スクリーン

デジタルサイネージスクリーンを管理します。

スクリーン一覧

GET /api/v1/screens

クエリパラメータ:

パラメータタイプ説明
pagenumberページ番号(デフォルト:1)
limitnumber1ページあたりのアイテム数(デフォルト:20、最大:100)
isActivebooleanアクティブステータスでフィルタ
isOnlinebooleanオンラインステータスでフィルタ
screenGroupIduuidスクリーングループでフィルタ
workspaceIduuidワークスペースでフィルタ

リクエスト例:

curl -X GET "https://www.screenzzie.com/api/v1/screens?isOnline=true&limit=10" \
  -H "Authorization: Bearer sk_live_xxx"

レスポンス例:

{
  "success": true,
  "data": {
    "items": [
      {
        "id": "uuid",
        "name": "Lobby Display",
        "description": "Main entrance screen",
        "isActive": true,
        "isOnline": true,
        "lastSeenAt": "2024-01-01T12:00:00Z",
        "orientation": "landscape",
        "rotation": "0",
        "timezone": "Europe/Madrid",
        "location": "Building A, Floor 1",
        "cityName": "Madrid",
        "latitude": 40.4168,
        "longitude": -3.7038,
        "workspaceId": "uuid",
        "screenGroupId": null,
        "currentPlaylistId": "uuid",
        "currentSequenceId": null,
        "defaultPlaylistId": "uuid",
        "defaultSequenceId": null,
        "createdAt": "2024-01-01T00:00:00Z",
        "updatedAt": "2024-01-01T12:00:00Z"
      }
    ],
    "pagination": {
      "page": 1,
      "limit": 10,
      "total": 25,
      "totalPages": 3,
      "hasMore": true
    }
  }
}

スクリーン取得

GET /api/v1/screens/:screenId

パスパラメータ:

パラメータタイプ説明
screenIduuidスクリーンID

レスポンス例:

一覧レスポンスと同じ構造の単一スクリーンオブジェクトを返します。

スクリーン作成

POST /api/v1/screens

リクエストボディ:

フィールドタイプ必須説明
namestringはいスクリーン名(最大100文字)
descriptionstringいいえスクリーンの説明(最大500文字)
orientationstringいいえlandscapeまたはportrait(デフォルト:landscape
rotationstringいいえ090180、または270(デフォルト:0
timezonestringいいえIANAタイムゾーン(例:Europe/Madrid
locationstringいいえ物理的な場所の説明(最大200文字)
screenGroupIduuidいいえスクリーングループへの所属
workspaceIduuidいいえワークスペースの割り当て

プレイリストとシーケンスの割り当ては作成時に設定できません。作成後にスクリーン更新エンドポイントを使用してコンテンツを割り当ててください。

リクエスト例:

curl -X POST "https://www.screenzzie.com/api/v1/screens" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Conference Room A",
    "orientation": "landscape",
    "rotation": "0",
    "timezone": "Europe/Madrid",
    "location": "Building B, Room 101"
  }'

レスポンス例:

{
  "success": true,
  "data": {
    "id": "uuid",
    "name": "Conference Room A",
    "description": null,
    "isActive": true,
    "isOnline": false,
    "lastSeenAt": null,
    "orientation": "landscape",
    "rotation": "0",
    "timezone": "Europe/Madrid",
    "location": "Building B, Room 101",
    "cityName": null,
    "latitude": null,
    "longitude": null,
    "workspaceId": null,
    "screenGroupId": null,
    "currentPlaylistId": null,
    "currentSequenceId": null,
    "defaultPlaylistId": null,
    "defaultSequenceId": null,
    "createdAt": "2024-01-01T00:00:00Z",
    "updatedAt": "2024-01-01T00:00:00Z"
  }
}

スクリーン更新

PATCH /api/v1/screens/:screenId

すべてのフィールドはオプションです。更新したいフィールドのみ含めてください。

リクエストボディ:

フィールドタイプ説明
namestring新しいスクリーン名(最大100文字)
descriptionstring新しい説明(クリアする場合はnull)
orientationstringlandscapeまたはportrait
rotationstring090180、または270
timezonestringIANAタイムゾーン
locationstring物理的な場所(クリアする場合はnull)
workspaceIduuidワークスペースID(削除する場合はnull)
screenGroupIduuidスクリーングループID(削除する場合はnull)
currentPlaylistIduuid現在のプレイリスト(削除する場合はnull)
currentSequenceIduuid現在のシーケンス(削除する場合はnull)
defaultPlaylistIduuidデフォルトプレイリスト(削除する場合はnull)
defaultSequenceIduuidデフォルトシーケンス(削除する場合はnull)

リクエスト例:

curl -X PATCH "https://www.screenzzie.com/api/v1/screens/abc123" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Display Name",
    "currentPlaylistId": "playlist-uuid"
  }'

プレイリスト

スクリーン用のコンテンツプレイリストを管理します。

プレイリスト一覧

GET /api/v1/playlists

クエリパラメータ:

パラメータタイプ説明
pagenumberページ番号(デフォルト:1)
limitnumber1ページあたりのアイテム数(デフォルト:20、最大:100)
workspaceIduuidワークスペースでフィルタ

レスポンス例:

{
  "success": true,
  "data": {
    "items": [
      {
        "id": "uuid",
        "name": "Main Content",
        "description": "Primary playlist for lobby screens",
        "itemCount": 5,
        "totalDuration": 120,
        "workspaceId": null,
        "createdBy": "user-uuid",
        "createdAt": "2024-01-01T00:00:00Z",
        "updatedAt": "2024-01-01T12:00:00Z"
      }
    ],
    "pagination": { ... }
  }
}

プレイリスト取得

GET /api/v1/playlists/:playlistId

アイテム付きでプレイリストを返します。アイテムは常にレスポンスに含まれます。

パスパラメータ:

パラメータタイプ説明
playlistIduuidプレイリストID

レスポンス例:

{
  "success": true,
  "data": {
    "id": "uuid",
    "name": "Main Content",
    "description": "Primary playlist for lobby screens",
    "itemCount": 2,
    "totalDuration": 45,
    "workspaceId": null,
    "createdBy": "user-uuid",
    "createdAt": "2024-01-01T00:00:00Z",
    "updatedAt": "2024-01-01T12:00:00Z",
    "items": [
      {
        "id": "item-uuid-1",
        "position": 0,
        "duration": 15,
        "itemType": "media",
        "mediaId": "media-uuid",
        "config": null,
        "createdAt": "2024-01-01T00:00:00Z"
      },
      {
        "id": "item-uuid-2",
        "position": 1,
        "duration": 30,
        "itemType": "website",
        "mediaId": null,
        "config": { "url": "https://example.com" },
        "createdAt": "2024-01-01T00:00:00Z"
      }
    ]
  }
}

プレイリスト作成

POST /api/v1/playlists

リクエストボディ:

フィールドタイプ必須説明
namestringはいプレイリスト名(最大100文字)
descriptionstringいいえプレイリストの説明(最大500文字)
workspaceIduuidいいえワークスペースの割り当て

リクエスト例:

curl -X POST "https://www.screenzzie.com/api/v1/playlists" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Holiday Promotions",
    "description": "Seasonal content for December"
  }'

プレイリスト更新

PATCH /api/v1/playlists/:playlistId

リクエストボディ:

フィールドタイプ説明
namestring新しいプレイリスト名
descriptionstring新しい説明(クリアする場合はnull)
workspaceIduuidワークスペースID(削除する場合はnull)

プレイリスト削除

DELETE /api/v1/playlists/:playlistId

成功時は204 No Contentを返します。


メディア

メディアライブラリのファイルにアクセスし、登録します。

メディア一覧

GET /api/v1/media

クエリパラメータ:

パラメータタイプ説明
pagenumberページ番号(デフォルト:1)
limitnumber1ページあたりのアイテム数(デフォルト:20、最大:100)
typestringタイプでフィルタ:imageまたはvideo
folderIduuidフォルダでフィルタ
workspaceIduuidワークスペースでフィルタ

レスポンス例:

{
  "success": true,
  "data": {
    "items": [
      {
        "id": "uuid",
        "name": "promo-video.mp4",
        "type": "video",
        "fileUrl": "https://...",
        "thumbnailUrl": "https://...",
        "fileSize": 15728640,
        "duration": 30,
        "folderId": null,
        "workspaceId": null,
        "uploadedBy": "user-uuid",
        "createdAt": "2024-01-01T00:00:00Z",
        "updatedAt": "2024-01-01T00:00:00Z"
      }
    ],
    "pagination": { ... }
  }
}

メディア取得

GET /api/v1/media/:mediaId

一覧レスポンスと同じ構造の単一メディアオブジェクトを返します。

メディア登録

POST /api/v1/media

既にストレージにアップロードされたメディアファイルを登録します。このエンドポイントはファイルのアップロードを直接処理しません - ファイルのアップロードにはウェブダッシュボードを使用してください。

リクエストボディ:

フィールドタイプ必須説明
namestringはいメディア名(最大200文字)
typestringはいimageまたはvideo
fileUrlstringはいアップロードされたファイルのURL
thumbnailUrlstringいいえサムネイルのURL
fileSizenumberいいえファイルサイズ(バイト)
durationnumberいいえ動画の長さ(秒)
folderIduuidいいえフォルダの割り当て
workspaceIduuidいいえワークスペースの割り当て

リクエスト例:

curl -X POST "https://www.screenzzie.com/api/v1/media" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Company Logo",
    "type": "image",
    "fileUrl": "https://your-storage.com/logo.png",
    "thumbnailUrl": "https://your-storage.com/logo-thumb.png",
    "fileSize": 102400
  }'

REST API経由での直接ファイルアップロードは利用できません。ウェブダッシュボードでファイルをアップロードするか、独自のストレージにアップロードしてこのエンドポイントでURLを登録してください。

メディア削除

DELETE /api/v1/media/:mediaId

成功時は204 No Contentを返します。


スケジュール

スケジュールはGrowthプラン以上でのみ利用可能です。

特定の時間にコンテンツを再生するスケジュールを設定します。

スケジュール一覧

GET /api/v1/schedules

クエリパラメータ:

パラメータタイプ説明
pagenumberページ番号(デフォルト:1)
limitnumber1ページあたりのアイテム数(デフォルト:20、最大:100)
workspaceIduuidワークスペースでフィルタ
screenIduuidスクリーンでフィルタ
isActivebooleanアクティブステータスでフィルタ

レスポンス例:

{
  "success": true,
  "data": {
    "items": [
      {
        "id": "uuid",
        "name": "Weekend Promotions",
        "playlistId": "playlist-uuid",
        "sequenceId": null,
        "screenId": null,
        "screenGroupId": null,
        "targetType": "all_screens",
        "dayOfWeek": [0, 6],
        "startTime": "09:00",
        "endTime": "21:00",
        "startDate": null,
        "endDate": null,
        "priority": 10,
        "isActive": true,
        "color": "#3B82F6",
        "workspaceId": null,
        "createdAt": "2024-01-01T00:00:00Z",
        "updatedAt": "2024-01-01T00:00:00Z"
      }
    ],
    "pagination": { ... }
  }
}

スケジュール取得

GET /api/v1/schedules/:scheduleId

一覧レスポンスと同じ構造の単一スケジュールオブジェクトを返します。

スケジュール作成

POST /api/v1/schedules

リクエストボディ:

フィールドタイプ必須説明
namestringいいえスケジュール名(最大100文字)
playlistIduuidいいえ*スケジュールするプレイリスト
sequenceIduuidいいえ*スケジュールするシーケンス
targetTypestringはいscreenscreen_groupall_screens、またはmultiple_screens
screenIduuid条件付きtargetTypescreenの場合は必須
screenGroupIduuid条件付きtargetTypescreen_groupの場合は必須
dayOfWeeknumber[]いいえ曜日(0=日曜、6=土曜)
startTimestringいいえ開始時刻(HH:MM形式)
endTimestringいいえ終了時刻(HH:MM形式)
startDatestringいいえ開始日(ISO形式)
endDatestringいいえ終了日(ISO形式)
prioritynumberいいえ優先度0〜100(デフォルト:0)
isActivebooleanいいえアクティブかどうか(デフォルト:true)
colorstringいいえ表示色(例:#3B82F6
workspaceIduuidいいえワークスペースの割り当て

*コンテンツをスケジュールするにはplaylistIdまたはsequenceIdを指定する必要があります。

ターゲットタイプの条件付き要件:

targetType必須フィールド
screenscreenId
screen_groupscreenGroupId
all_screensなし
multiple_screensなし(別のエンドポイントでスクリーンを追加)

リクエスト例:

curl -X POST "https://www.screenzzie.com/api/v1/schedules" \
  -H "Authorization: Bearer sk_live_xxx" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Weekend Promotions",
    "playlistId": "abc123",
    "targetType": "all_screens",
    "dayOfWeek": [0, 6],
    "startTime": "09:00",
    "endTime": "21:00",
    "priority": 10,
    "color": "#3B82F6"
  }'

スケジュール更新

PATCH /api/v1/schedules/:scheduleId

すべてのフィールドはオプションです。スケジュール作成と同じフィールド定義を使用します。

スケジュール削除

DELETE /api/v1/schedules/:scheduleId

成功時は204 No Contentを返します。


HTTPステータスコード

コード説明
200成功
201作成完了
204コンテンツなし(削除成功)
400不正なリクエスト(バリデーションエラー)
401未認証(無効なAPIキー)
403禁止(権限またはプラン不足)
404見つからない
429リクエストが多すぎる(レート制限)
500内部サーバーエラー