メインコンテンツまでスキップ

アプリ - Download app

ルートURL​

POST https://playcanvas.com/api/apps/download

説明​

自分のサーバーでセルフホストすることができるアプリをダウンロードできます。リクエストによりダウンロードジョブが開始され、ジョブの詳細がレスポンスで返されます。idを指定してジョブをポールして、そのステータスが「完了」または「エラー」になるまで待ちます。ジョブが完了すると、そのdata.download_urlプロパティにアプリパッケージをダウンロードするためのURLが入ります。

formatでパッケージタイプを選択します。省略するかstaticに設定すると標準のセルフホスト用パッケージ、npmに設定するとViteベースのnpmプロジェクトとしてダウンロードされます。利用可能なダウンロード形式とNPMプロジェクト構造の詳細については、ビルドのダウンロードを参照してください。

例​

curl -H "Authorization: Bearer {accessToken}" -H "Content-Type: application/json" -X POST -d '{"project_id": {projectId}, "scenes": [{sceneId}], "name": "My App", "format": "npm"}' "https://playcanvas.com/api/apps/download"

パラメーター​

名前タイプ必須デフォルト説明
project_idnumber✔️—The id of the project.
namestring✔️—The name of the app. Must be less than 1000 characters.
scenesnumber[]✔️—A list of scene ids to be included in the app. When you specify scenes then the first scene in the list will be used as the initial scene of the application.
branch_idstringメインブランチThe id of the branch.
descriptionstring—The description of the app. Must be less than 10,000 characters.
versionstring—The version of the app. Can be a string up to 20 characters.
release_notesstring—Release notes for the app. Can be a string up to 10,000 characters.
scripts_concatenatebooleanfalseSet it to true if you want scripts to be concatenated.
scripts_minifybooleanfalseスクリプトを最小化する場合は true に設定します。scripts_concatenate が true の場合にのみ適用されます。
scripts_sourcemapsbooleanfalseSet it to true if you want script sourcemaps to be generated.
optimize_scene_formatbooleanfalseSet it to true if you want scenes to be in an optimized format (see Optimize Scene Format for more information).
formatstringstaticダウンロードするパッケージタイプ: staticまたはnpm。ビルドのダウンロードを参照してください。
engine_versionstringサポートされる最新版特定のバージョンが必要な場合は、Engine のバージョン文字列(リリースの一覧)を設定します。省略すると、プロジェクトのメジャーバージョンで Editor がサポートする最新の Engine バージョンが使用されます。

レスポンススキーマ​

ステータス:201 Created
{
"status": "running" | "complete" | "error",
"messages": list of strings,
"created_at": date,
"modified_at": date,
"data": {
"concatenate": boolean,
"branch_id": string,
"optimize_scene_format": boolean,
"format": "static" | "npm",
"minify": boolean,
"name": string,
"sourcemaps": boolean,
"scenes": list of int scene ids,
"engineVersion": string,
"preload_bundle": boolean,
"project_id": int,
"owner_id": int
},
"id": int
}

エラー​

コード説明
401Unauthorized
403Forbidden
404Project not found
404Owner not found
404Scene not found
429Too many requests

レート制限​

このルートはstrictなレート制限を使用します。