Skip to content

Instantly share code, notes, and snippets.

@andybak
Created February 5, 2025 15:19
Show Gist options
  • Save andybak/b96af6717949aa0f18b8b29b20b51448 to your computer and use it in GitHub Desktop.
Save andybak/b96af6717949aa0f18b8b29b20b51448 to your computer and use it in GitHub Desktop.

Poly API Documentation

Version: v1
Title: Poly API
Base URL: https://poly.googleapis.com/
MTLS Root URL: https://poly.mtls.googleapis.com/
Batch Path: batch

The Poly API provides read access to assets hosted on poly.google.com to all, and upload access for poly.google.com for whitelisted accounts.

Documentation Link


Endpoints

Assets

Get Asset

  • Method: GET
  • Path: /v1/{+name}
  • Description: Returns detailed information about an asset given its name. PRIVATE assets are returned only if the authenticated user is the author.
  • Path Parameters:
    • name (string, required): An asset's name in the form assets/{ASSET_ID}.
  • Response: Asset

List Assets

  • Method: GET
  • Path: /v1/assets
  • Description: Lists all public, remixable assets.
  • Query Parameters:
    • category (string): Filter by category.
    • curated (boolean): Return only curated assets.
    • format (string): Filter by format. Acceptable values: BLOCKS, FBX, GLTF, GLTF2, OBJ, TILT.
    • keywords (string): Search terms.
    • maxComplexity (string): Filter by complexity. Values: COMPLEXITY_UNSPECIFIED, COMPLEX, MEDIUM, SIMPLE.
    • orderBy (string): Ordering. Values: BEST, NEWEST, OLDEST.
    • pageSize (integer): Number between 1 and 100 (default is 20).
    • pageToken (string): Continuation token.
  • Response: ListAssetsResponse

Users

List User Assets

  • Method: GET
  • Path: /v1/{+name}/assets
  • Description: Lists assets authored by the given user. Only the special value me is supported.
  • Path Parameters:
    • name (string, required): User ID (only me is supported).
  • Query Parameters:
    • format (string): Filter by format.
    • orderBy (string): Ordering. Values: BEST, NEWEST, OLDEST.
    • pageSize (integer): Number between 1 and 100 (default is 20).
    • pageToken (string): Continuation token.
    • visibility (string): Visibility filter. Values: VISIBILITY_UNSPECIFIED, PUBLISHED, PRIVATE.
  • Response: ListUserAssetsResponse

List Liked Assets

  • Method: GET
  • Path: /v1/{+name}/likedassets
  • Description: Lists assets that the user has liked. Only the special value me is supported.
  • Path Parameters:
    • name (string, required): User ID (only me is supported).
  • Query Parameters:
    • format (string): Filter by format.
    • orderBy (string): Ordering. Values: BEST, NEWEST, OLDEST, LIKED_TIME.
    • pageSize (integer): Number between 1 and 100 (default is 20).
    • pageToken (string): Continuation token.
  • Response: ListLikedAssetsResponse

Schemas

Asset

  • authorName (string): The author's publicly visible name.
  • createTime (string, google-datetime): Time when the asset was published or created.
  • description (string): Human-readable asset description.
  • displayName (string): Human-readable asset name.
  • formats (array of Format): Representations of the asset.
  • isCurated (boolean): Whether the asset has been curated.
  • license (string): License. Values: UNKNOWN, CREATIVE_COMMONS_BY, ALL_RIGHTS_RESERVED.
  • metadata (string): Application-defined metadata.
  • name (string): Unique identifier in the form assets/{ASSET_ID}.
  • presentationParams (PresentationParams): Display hints.
  • remixInfo (RemixInfo): Information about remixed sources.
  • thumbnail (File): Thumbnail image.
  • updateTime (string, google-datetime): Last modified time.
  • visibility (string): Visibility. Values: VISIBILITY_UNSPECIFIED, PRIVATE, UNLISTED, PUBLIC.

AssetImportMessage

  • code (string): Error code. Values include CODE_UNSPECIFIED, NO_IMPORTABLE_FILE, EMPTY_MODEL, OBJ_PARSE_ERROR, EXPIRED, IMAGE_ERROR, EXTRA_FILES_WITH_ARCHIVE, DEFAULT_MATERIALS, FATAL_ERROR, INVALID_ELEMENT_TYPE.
  • filePath (string): Optional file path.
  • imageError (ImageError): Details of an image error.
  • objParseError (ObjParseError): Details of an OBJ parse error.

File

  • contentType (string): MIME content-type.
  • relativePath (string): Path relative to the root.
  • url (string): URL to retrieve the file.

Format

  • formatComplexity (FormatComplexity): Complexity statistics.
  • formatType (string): Format type. E.g., FBX, GLTF, GLTF2, OBJ, TILT.
  • resources (array of File): Dependent resource files.
  • root (File): Root file of the representation.

FormatComplexity

  • lodHint (integer): Level-of-detail hint.
  • triangleCount (string, int64): Estimated triangle count.

ImageError

  • code (string): Image error code. Values: CODE_UNSPECIFIED, INVALID_IMAGE, IMAGE_TOO_BIG, WRONG_IMAGE_TYPE.
  • filePath (string): File path related to the error.

ListAssetsResponse

  • assets (array of Asset): List of matching assets.
  • nextPageToken (string): Token for the next page.
  • totalSize (integer): Total number of assets.

ListLikedAssetsResponse

  • assets (array of Asset): List of liked assets.
  • nextPageToken (string): Token for the next page.
  • totalSize (integer): Total number of assets.

ListUserAssetsResponse

  • nextPageToken (string): Token for the next page.
  • totalSize (integer): Total number of assets.
  • userAssets (array of UserAsset): List of user assets.

ObjParseError

  • code (string): OBJ parse error code.
  • endIndex (integer): Ending character index of the error.
  • filePath (string): File path where the error occurred.
  • line (string): The problematic line (may be truncated).
  • lineNumber (integer): Line number of the error.
  • startIndex (integer): Starting character index of the error.

PresentationParams

  • backgroundColor (string): Hex color (e.g., #FF0000).
  • colorSpace (string): Color space. Values: UNKNOWN, LINEAR, GAMMA.
  • orientingRotation (Quaternion): Rotation to display the asset upright.

Quaternion

  • w (number): Scalar component.
  • x (number): X component.
  • y (number): Y component.
  • z (number): Z component.

RemixInfo

  • sourceAsset (array of string): Source asset IDs in the form assets/{ASSET_ID}.

StartAssetImportResponse

  • assetId (string): ID of the newly created asset.
  • assetImportId (string): ID of the asset import.
  • assetImportMessages (array of AssetImportMessage): Messages from the import process.
  • publishUrl (string): URL to publish the asset.

UserAsset

  • asset (Asset): The asset data.

Global Query Parameters

  • $.xgafv: V1 error format. Values: 1, 2.
  • access_token: OAuth access token.
  • alt: Data format for response. Default is json. Values: json, media, proto.
  • callback: JSONP callback.
  • fields: Selector for partial response.
  • key: API key.
  • oauth_token: OAuth 2.0 token.
  • prettyPrint: Returns response with indentations and line breaks (default true).
  • quotaUser: String for quota purposes.
  • uploadType: Legacy upload protocol.
  • upload_protocol: Upload protocol.

Documentation generated from provided JSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment