> ## Documentation Index
> Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Truy xuất tài sản nhân vật

> Truy xuất tài sản nhân vật theo ID và đọc trạng thái xử lý trước khi dùng trong yêu cầu Seedance.

Truy xuất một tài sản thuộc tài khoản đã xác thực. Gửi mã thông báo truy cập thô trong tiêu đề `Authorization` mà không có tiền tố `Bearer`.

```bash theme={null}
curl \
  https://api.cometapi.com/api/asset/assets/<ASSET_ID> \
  -H "Authorization: $COMETAPI_ACCESS_TOKEN"
```

| Trường | Mô tả |
| - | - |
| `data.id` | ID tài sản được dùng trong `asset://<ASSET_ID>`. |
| `data.group_id` | Nhóm sở hữu tài sản. |
| `data.asset_type` | `image`, `video` hoặc `audio`. |
| `data.status` | `processing`, `active` hoặc `failed`. |
| `data.fail_reason` | Lý do đã được làm sạch khi xử lý thất bại. |

Chỉ dùng tài sản trong [Tạo video Seedance](https://apidoc.cometapi.com/vi/api/video/seedance/create.md) sau khi `data.status=active`. Tài sản không xác định, thất bại hoặc vẫn đang xử lý sẽ khiến yêu cầu video trả về lỗi yêu cầu.


## OpenAPI

````yaml api/openapi/video/seedance/get-character-asset.openapi.json GET /api/asset/assets/{id}
openapi: 3.1.0
info:
  title: Retrieve character asset API
  version: 1.0.0
  description: Retrieve a CometAPI character asset by ID and read its processing status.
servers:
  - url: https://api.cometapi.com
security:
  - accessTokenAuth: []
paths:
  /api/asset/assets/{id}:
    get:
      summary: Retrieve a character asset
      description: >-
        Read an asset that belongs to the authenticated account. Wait until
        status is active before using asset://<ASSET_ID> in a Seedance request.
      operationId: seedance_get_character_asset
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          description: CometAPI asset ID.
          example: as-example
      responses:
        '200':
          description: Character asset returned.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - message
                  - data
                properties:
                  success:
                    type: boolean
                    description: Whether the request succeeded.
                  message:
                    type: string
                    description: Status or error message.
                  data:
                    $ref: '#/components/schemas/AssetView'
              examples:
                success:
                  summary: Successful response
                  value:
                    success: true
                    message: ''
                    data: {}
        '401':
          description: The access token is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                message: unauthorized
        '404':
          description: The asset does not exist for the authenticated account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                message: asset not found
      x-codeSamples:
        - lang: Shell
          label: Character asset request
          source: |-
            curl \
              https://api.cometapi.com/api/asset/assets/<ASSET_ID> \
              -H "Authorization: $COMETAPI_ACCESS_TOKEN"
        - lang: Python
          label: Character asset request
          source: |
            import os
            import requests

            response = requests.get(
                "https://api.cometapi.com/api/asset/assets/<ASSET_ID>",
                headers={"Authorization": os.environ["COMETAPI_ACCESS_TOKEN"]},
                timeout=30,
            )
            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          label: Character asset request
          source: |
            const response = await fetch(
              "https://api.cometapi.com/api/asset/assets/<ASSET_ID>",
              { headers: { Authorization: process.env.COMETAPI_ACCESS_TOKEN } },
            );

            if (!response.ok) throw new Error(await response.text());
            console.log(await response.json());
components:
  schemas:
    AssetView:
      type: object
      required:
        - id
        - group_id
        - asset_type
        - status
        - created_at
      properties:
        id:
          type: string
          description: CometAPI asset ID.
          example: as-example
        group_id:
          type: string
          description: Owning group ID.
          example: ag-example
        name:
          type: string
          description: Optional asset name.
        asset_type:
          type: string
          enum:
            - image
            - video
            - audio
          description: Asset media type.
        status:
          type: string
          enum:
            - processing
            - active
            - failed
          description: Asset processing status.
        fail_reason:
          type: string
          description: Sanitized failure reason when processing fails.
        created_at:
          type: integer
          description: Creation time as a Unix timestamp in seconds.
    ErrorResponse:
      type: object
      required:
        - success
        - message
      properties:
        success:
          type: boolean
          description: Whether the request succeeded.
        message:
          type: string
          description: Description of the request error.
        data:
          type:
            - object
            - array
            - 'null'
          description: Error details when returned.
      additionalProperties: true
  securitySchemes:
    accessTokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Raw CometAPI access token. Do not prefix it with Bearer.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.