Skip to main content

Assets API

All URIs are relative to http://localhost:1000

MethodHTTP requestDescription
assetsCreateNewAssetPOST /assets/create/assets/create [POST] Scoped to Asset
assetsDeleteAssetPOST /assets/{asset}/delete/assets/{asset}/delete [POST] Scoped to Asset
assetsDraftPOST /assets/draft/assets/draft [POST]
assetsGetRecommendedAssetsGET /assets/recommendedYour GET endpoint
assetsGetRelatedAssetsGET /assets/related/assets/related [GET]
assetsIdentifiersSnapshotGET /assets/identifiers/assets/identifiers [GET]
assetsPseudoSnapshotGET /assets/pseudo/assets/pseudo [GET]
assetsSearchAssetsGET /assets/search/assets/search?query=string [GET]
assetsSearchWithFiltersPOST /assets/search/assets/search [POST]
assetsSnapshotGET /assets/assets [GET] Scoped to Assets
assetsSpecificAssetFormatsSnapshotGET /assets/{asset}/formats/assets/{asset}/formats [GET] Scoped To Assets
assetsSpecificAssetSnapshotGET /assets/{asset}/assets/{asset} [GET] Scoped to Assets
assetsStreamIdentifiersGET /assets/stream/identifiers/assets/stream/identifiers [WS]
getAssetsStreamTransferablesGET /assets/stream/transferables/assets/stream/transferables [WS]
streamAssetsGET /assets/stream/assets/stream [WS]

assetsCreateNewAsset

Asset assetsCreateNewAsset(transferables, seed)

/assets/create [POST] Scoped to Asset

Accepts a seeded (a structure that comes before an asset, and will be used in creation) asset and uploads it to Pieces. The response will be the newly created Asset object.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = AssetsApi()
val transferables : kotlin.Boolean = true // kotlin.Boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)
val seed : Seed = // Seed |
try {
val result : Asset = apiInstance.assetsCreateNewAsset(transferables, seed)
println(result)
} catch (e: ClientException) {
println("4xx response calling AssetsApi#assetsCreateNewAsset")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AssetsApi#assetsCreateNewAsset")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
transferableskotlin.BooleanThis is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)[optional]
seedSeed[optional]

Return type

Asset

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

assetsDeleteAsset

kotlin.String assetsDeleteAsset(asset)

/assets/{asset}/delete [POST] Scoped to Asset

Deletes a specific asset from the system by providing its unique identifier (UID). Upon successful deletion, it returns the UID of the deleted asset.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = AssetsApi()
val asset : java.util.UUID = 2254f2c8-5797-40e8-ac56-41166dc0e159 // java.util.UUID | The id (uuid) of the asset that you are trying to access.
try {
val result : kotlin.String = apiInstance.assetsDeleteAsset(asset)
println(result)
} catch (e: ClientException) {
println("4xx response calling AssetsApi#assetsDeleteAsset")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AssetsApi#assetsDeleteAsset")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
assetjava.util.UUIDThe id (uuid) of the asset that you are trying to access.

Return type

kotlin.String

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

assetsDraft

Seed assetsDraft(transferables, seed)

/assets/draft [POST]

Allows developers to input a Seed and receive a drafted asset with preprocessed information. No data is persisted; this is solely an input/output endpoint. For images, it returns the original Seed.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = AssetsApi()
val transferables : kotlin.Boolean = true // kotlin.Boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)
val seed : Seed = // Seed |
try {
val result : Seed = apiInstance.assetsDraft(transferables, seed)
println(result)
} catch (e: ClientException) {
println("4xx response calling AssetsApi#assetsDraft")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AssetsApi#assetsDraft")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
transferableskotlin.BooleanThis is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)[optional]
seedSeed[optional]

Return type

Seed

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

assetsGetRecommendedAssets

Assets assetsGetRecommendedAssets(seededAssetsRecommendation)

Your GET endpoint

Expects a SeededAssetsRecommendation Model in the request body, containing assets and interactions. Returns an Assets Model suitable for UI.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = AssetsApi()
val seededAssetsRecommendation : SeededAssetsRecommendation = // SeededAssetsRecommendation | The body of the request will be an SeededAssetsRecommendation Model with interaction meta data included at body.interactions.iterable and then the corrresponding index-paired body.assets.iterable with a fully populated assets array with fully sub-populated formats.
try {
val result : Assets = apiInstance.assetsGetRecommendedAssets(seededAssetsRecommendation)
println(result)
} catch (e: ClientException) {
println("4xx response calling AssetsApi#assetsGetRecommendedAssets")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AssetsApi#assetsGetRecommendedAssets")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
seededAssetsRecommendationSeededAssetsRecommendationThe body of the request will be an SeededAssetsRecommendation Model with interaction meta data included at body.interactions.iterable and then the corrresponding index-paired body.assets.iterable with a fully populated assets array with fully sub-populated formats.[optional]

Return type

Assets

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

assetsGetRelatedAssets

Assets assetsGetRelatedAssets(assets)

/assets/related [GET]

Retrieves one or more related assets when provided with one or more input assets.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = AssetsApi()
val assets : Assets = // Assets | The body of the request is an object (Assets Model) with iterable internally.
try {
val result : Assets = apiInstance.assetsGetRelatedAssets(assets)
println(result)
} catch (e: ClientException) {
println("4xx response calling AssetsApi#assetsGetRelatedAssets")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AssetsApi#assetsGetRelatedAssets")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
assetsAssetsThe body of the request is an object (Assets Model) with iterable internally.[optional]

Return type

Assets

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

assetsIdentifiersSnapshot

FlattenedAssets assetsIdentifiersSnapshot(pseudo)

/assets/identifiers [GET]

Retrieves all asset IDs associated with your account.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = AssetsApi()
val pseudo : kotlin.Boolean = true // kotlin.Boolean | This is helper boolean that will give you the ability to also include your pseudo assets, we will always default to false.
try {
val result : FlattenedAssets = apiInstance.assetsIdentifiersSnapshot(pseudo)
println(result)
} catch (e: ClientException) {
println("4xx response calling AssetsApi#assetsIdentifiersSnapshot")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AssetsApi#assetsIdentifiersSnapshot")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
pseudokotlin.BooleanThis is helper boolean that will give you the ability to also include your pseudo assets, we will always default to false.[optional]

Return type

FlattenedAssets

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

assetsPseudoSnapshot

PseudoAssets assetsPseudoSnapshot()

/assets/pseudo [GET]

Retrieves a snapshot exclusively containing pseudo Assets from your Pieces drive.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = AssetsApi()
try {
val result : PseudoAssets = apiInstance.assetsPseudoSnapshot()
println(result)
} catch (e: ClientException) {
println("4xx response calling AssetsApi#assetsPseudoSnapshot")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AssetsApi#assetsPseudoSnapshot")
e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

PseudoAssets

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

assetsSearchAssets

SearchedAssets assetsSearchAssets(query, transferables, searchableTags, pseudo)

/assets/search?query=string [GET]

Performs a search across your pieces and returns Assets (the results) based on your query. Presently, it only requires your query to be sent in the body. It is mandatory to include searchable_tags (comma-separated values of tags) or a query string. If a query is provided, a fuzzy search will be conducted. If searchable tags are provided, a tag-based search will be executed. If neither are included, a 500 error will be returned.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = AssetsApi()
val query : kotlin.String = query_example // kotlin.String | This is a string that you can use to search your assets.
val transferables : kotlin.Boolean = true // kotlin.Boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)
val searchableTags : kotlin.String = searchableTags_example // kotlin.String | This is a comma separated value of tags used for search.
val pseudo : kotlin.Boolean = true // kotlin.Boolean | This is helper boolean that will give you the ability to also include your pseudo assets, we will always default to false.
try {
val result : SearchedAssets = apiInstance.assetsSearchAssets(query, transferables, searchableTags, pseudo)
println(result)
} catch (e: ClientException) {
println("4xx response calling AssetsApi#assetsSearchAssets")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AssetsApi#assetsSearchAssets")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
querykotlin.StringThis is a string that you can use to search your assets.[optional]
transferableskotlin.BooleanThis is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)[optional]
searchableTagskotlin.StringThis is a comma separated value of tags used for search.[optional]
pseudokotlin.BooleanThis is helper boolean that will give you the ability to also include your pseudo assets, we will always default to false.[optional]

Return type

SearchedAssets

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

assetsSearchWithFilters

AssetsSearchWithFiltersOutput assetsSearchWithFilters(transferables, pseudo, assetsSearchWithFiltersInput)

/assets/search [POST]

Enables searching through your pieces and returns Assets (the results) based on your query. When sending a query in the request body, fuzzy search is applied. Additionally, the request body can include a search space, currently as a list of UUIDs (and potentially Seeds in the future). Optional filters can also be included in the request body, represented as an iterable of filters, all of which are combined using AND operations.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = AssetsApi()
val transferables : kotlin.Boolean = true // kotlin.Boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)
val pseudo : kotlin.Boolean = true // kotlin.Boolean | This is helper boolean that will give you the ability to also include your pseudo assets, we will always default to false.
val assetsSearchWithFiltersInput : AssetsSearchWithFiltersInput = // AssetsSearchWithFiltersInput |
try {
val result : AssetsSearchWithFiltersOutput = apiInstance.assetsSearchWithFilters(transferables, pseudo, assetsSearchWithFiltersInput)
println(result)
} catch (e: ClientException) {
println("4xx response calling AssetsApi#assetsSearchWithFilters")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AssetsApi#assetsSearchWithFilters")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
transferableskotlin.BooleanThis is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)[optional]
pseudokotlin.BooleanThis is helper boolean that will give you the ability to also include your pseudo assets, we will always default to false.[optional]
assetsSearchWithFiltersInputAssetsSearchWithFiltersInput[optional]

Return type

AssetsSearchWithFiltersOutput

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

assetsSnapshot

Assets assetsSnapshot(transferables, suggested, pseudo)

/assets [GET] Scoped to Assets

Get all of the users Assets.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = AssetsApi()
val transferables : kotlin.Boolean = true // kotlin.Boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)
val suggested : kotlin.Boolean = true // kotlin.Boolean | This will let us know if a developer, wants a snapshot related to suggested content or normal content
val pseudo : kotlin.Boolean = true // kotlin.Boolean | This is helper boolean that will give you the ability to also include your pseudo assets, we will always default to false.
try {
val result : Assets = apiInstance.assetsSnapshot(transferables, suggested, pseudo)
println(result)
} catch (e: ClientException) {
println("4xx response calling AssetsApi#assetsSnapshot")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AssetsApi#assetsSnapshot")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
transferableskotlin.BooleanThis is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)[optional]
suggestedkotlin.BooleanThis will let us know if a developer, wants a snapshot related to suggested content or normal content[optional]
pseudokotlin.BooleanThis is helper boolean that will give you the ability to also include your pseudo assets, we will always default to false.[optional]

Return type

Assets

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

assetsSpecificAssetFormatsSnapshot

Formats assetsSpecificAssetFormatsSnapshot(asset, transferables)

/assets/{asset}/formats [GET] Scoped To Assets

Retrieves the available formats for a specific asset identified by its ID

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = AssetsApi()
val asset : java.util.UUID = 2254f2c8-5797-40e8-ac56-41166dc0e159 // java.util.UUID | The id (uuid) of the asset that you are trying to access.
val transferables : kotlin.Boolean = true // kotlin.Boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)
try {
val result : Formats = apiInstance.assetsSpecificAssetFormatsSnapshot(asset, transferables)
println(result)
} catch (e: ClientException) {
println("4xx response calling AssetsApi#assetsSpecificAssetFormatsSnapshot")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AssetsApi#assetsSpecificAssetFormatsSnapshot")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
assetjava.util.UUIDThe id (uuid) of the asset that you are trying to access.
transferableskotlin.BooleanThis is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)[optional]

Return type

Formats

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

assetsSpecificAssetSnapshot

Asset assetsSpecificAssetSnapshot(asset, transferables)

/assets/{asset} [GET] Scoped to Assets

Allows clients to retrieve details of a specific asset by providing its UUID in the path.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = AssetsApi()
val asset : java.util.UUID = 2254f2c8-5797-40e8-ac56-41166dc0e159 // java.util.UUID | The id (uuid) of the asset that you are trying to access.
val transferables : kotlin.Boolean = true // kotlin.Boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)
try {
val result : Asset = apiInstance.assetsSpecificAssetSnapshot(asset, transferables)
println(result)
} catch (e: ClientException) {
println("4xx response calling AssetsApi#assetsSpecificAssetSnapshot")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AssetsApi#assetsSpecificAssetSnapshot")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
assetjava.util.UUIDThe id (uuid) of the asset that you are trying to access.
transferableskotlin.BooleanThis is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)[optional]

Return type

Asset

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

assetsStreamIdentifiers

StreamedIdentifiers assetsStreamIdentifiers()

/assets/stream/identifiers [WS]

Provides a WebSocket connection that emits changes to your asset's identifiers (UUIDs).

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = AssetsApi()
try {
val result : StreamedIdentifiers = apiInstance.assetsStreamIdentifiers()
println(result)
} catch (e: ClientException) {
println("4xx response calling AssetsApi#assetsStreamIdentifiers")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AssetsApi#assetsStreamIdentifiers")
e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

StreamedIdentifiers

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getAssetsStreamTransferables

Assets getAssetsStreamTransferables()

/assets/stream/transferables [WS]

Provides a WebSocket connection that emits changes to your assets, including their transferable.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = AssetsApi()
try {
val result : Assets = apiInstance.getAssetsStreamTransferables()
println(result)
} catch (e: ClientException) {
println("4xx response calling AssetsApi#getAssetsStreamTransferables")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AssetsApi#getAssetsStreamTransferables")
e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

Assets

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

streamAssets

Assets streamAssets()

/assets/stream [WS]

Provides a WebSocket connection that emits changes to your assets.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = AssetsApi()
try {
val result : Assets = apiInstance.streamAssets()
println(result)
} catch (e: ClientException) {
println("4xx response calling AssetsApi#streamAssets")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling AssetsApi#streamAssets")
e.printStackTrace()
}

Parameters

This endpoint does not need any parameter.

Return type

Assets

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json