メインコンテンツまでスキップ
非公開のページ
このページは非公開です。 検索対象外となり、このページのリンクに直接アクセスできるユーザーのみに公開されます。

スプラットの公開

概要

スプラット(例:.ply または .sog)を、SuperSplatプラットフォームにプログラム的に公開します — Editorの公開ダイアログとsuperspl.atのDirect Uploadフローが使うのと同じバックエンドです。公開後、スプラットはユーザーのManageページに表示され、Studioで開いて視聴体験をキュレーションできます。

publish呼び出しのsettingsフィールドはExperience Settings JSON — Studioが書き、SuperSplat Viewerが読むのと同じコントラクト — を運びます。完全なスキーマはそちらのリファレンスを参照してください。

フローは主に次の 3 ステップで構成されます。

  1. バックエンドから署名付きアップロード URL を取得する
  2. その署名付き URL を使ってファイルを S3 に直接アップロードする
  3. バックエンド API を呼び出して処理ジョブを開始する

すべての API リクエストには、Authorization ヘッダーに有効な Bearer トークンを含める必要があります。トークンの取得方法はこのドキュメントを参照してください。

ルート

AWS S3 アップロード用の署名付き URL を取得

POST https://playcanvas.com/api/upload/signed-url

Body

{ "fileName": "scene.ply" }

Response

{ "signedUrl": "string", "s3Key": "string" }

例:

const response = await fetch(`https://playcanvas.com/api/upload/signed-url`, {
method: 'POST',
body: JSON.stringify({
fileName: filename
}),
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
}
});

署名付き URL を使った AWS S3 へのアップロード

PUT "signedUrl"

Response

{ "signedUrl": "string", "s3Key": "string" }

例:

const uploadResponse = await fetch(signedUrl, {
method: 'PUT',
body: fileData,
headers: {
'Content-Type': 'binary/octet-stream'
}
});

処理の開始

POST https://playcanvas.com/api/splats/publish

Body

{
"s3Key": "string",
"title": "string",
"description": "string",
"listed": boolean,
"settings": { /* Settings */ },
"format": "compressed.ply" // or "sog"
}

Settings:

const settings = {
camera: {
fov: 65, // field of view
position: [1,1,-1], target: [-0.1,0.6,-0.2],
startAnim: 'none',
animTrack:null
},
background: {
color: [0.4,0.4,0.4]
},
animTracks:[]
};

Response (Splat data)

{
"id": "string",
"hash": "string",
"title": "string",
"description": "string",
"format": "compressed.ply | sog",
"version": "string",
"release_notes": "string",
"thumbnails": number,
"size": number,
"views": number,
"comments": number,
"starred": number,
"listed": boolean,
"completedAt": DateTime,
"createdAt": DateTime,
"modifiedAt": DateTime
}

例:

const response = await fetch(`https://playcanvas.com/api/splats/publish`, {
method: 'POST',
body: JSON.stringify({
s3Key: s3Key,
title: 'Some Title',
description: 'Some Description',
listed: true,
settings: settings,
format: format
}),
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
}
});

レスポンスの例

{
"comments": 0,
"completedAt": null,
"createdAt": "2025-10-21T12:42:13.331Z",
"currentVersion": 1,
"description": "Some Description",
"featuredWeight": 0,
"format": "",
"hash": "982a2820",
"hasThumbnails": false,
"id": 50,
"listed": true,
"modifiedAt": "2025-10-21T12:42:13.331Z",
"releaseNotes": null,
"size": 0,
"starred": 0,
"tags": [],
"task": { "status": "running", "message": "" },
"title": "Some Title",
"url": "https://superspl.at/view?id=982a2820",
"userId": 7,
"version": 0,
"views": 0
}

ステータス — 201 成功

アップロードしたスプラットの状態を確認

GET https://playcanvas.com/api/splats/{ID}

Response (Splat)


{
"id": "string",
"hash": "string",
"title": "string",
"description": "string",
"format": "compressed.ply | sog"
}

例:

const response = await fetch(`https://playcanvas.com/api/splats/1000`)

エラー

コード説明
400不正なリクエスト/無効なペイロード/ストレージ上限超過
401未認証(トークンがない、または無効)
403禁止
404リソースが見つからない(例:sceneId
5xxアップロードまたは確定処理中のサーバー/S3 エラー