User Manual

Assets - Update asset

ルートURL

PUT https://playcanvas.com/api/assets/:assetId

説明

既存のアセットのファイルをアップデートします。

This endpoint currently only supports updating `script`, `html`, `css`, `text`, `shader` and `json` type assets.

他のREST API エンドポイントとは異なり、Update Assetエンドポイントはデータがmultipart/form-dataに送信されることを予期します。*

curl -H "Authorization: Bearer {accessToken}" -X PUT -F 'pow2={pow2}' -F 'file=@./script.js' "https://playcanvas.com/api/assets/{assetId}"

パラメータ

branchId: string

The id of the branch

file: file

Data to update asset file with

pow2 [optional]: boolean

Only used for textures and defaults to false. Resize the texture to power of two dimensions (true | false)

応答のスキーマ

Status: 200
{
    "id": int,
    "modifiedAt": date,
    "createdAt": date,
    "state": "ready" | "processing" | "error",
    "name": string,
    "type": string,
    "scope":{
        "type": string,
        "id": int
    },
    "source": bool,
    "sourceId": bool,
    "tags": list of strings,
    "preload": bool,
    "data": {
        ... asset data
    },
    "file": {
        "hash": string,
        "filename": string,
        "size": int,
        "url": string
    },
    "parent": int
}

エラー

401

Unauthorized

403

Forbidden

404

Project or Asset not found

429

Too many requests

レート制限

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

This site is translated by the community. If you want to get involved visit this page