Assets API
All URIs are relative to http://localhost:1000
Method | HTTP request | Description |
---|---|---|
assetsCreateNewAsset | POST /assets/create | /assets/create [POST] Scoped to Asset |
assetsDeleteAsset | POST /assets/{asset}/delete | /assets/{asset}/delete [POST] Scoped to Asset |
assetsDraft | POST /assets/draft | /assets/draft [POST] |
assetsGetRecommendedAssets | GET /assets/recommended | Your GET endpoint |
assetsGetRelatedAssets | GET /assets/related | /assets/related [GET] |
assetsIdentifiersSnapshot | GET /assets/identifiers | /assets/identifiers [GET] |
assetsPseudoSnapshot | GET /assets/pseudo | /assets/pseudo [GET] |
assetsSearchAssets | GET /assets/search | /assets/search?query=string [GET] |
assetsSearchWithFilters | POST /assets/search | /assets/search [POST] |
assetsSnapshot | GET /assets | /assets [GET] Scoped to Assets |
assetsSpecificAssetFormatsSnapshot | GET /assets/{asset}/formats | /assets/{asset}/formats [GET] Scoped To Assets |
assetsSpecificAssetSnapshot | GET /assets/{asset} | /assets/{asset} [GET] Scoped to Assets |
assetsStreamIdentifiers | GET /assets/stream/identifiers | /assets/stream/identifiers [WS] |
getAssetsStreamTransferables | GET /assets/stream/transferables | /assets/stream/transferables [WS] |
streamAssets | GET /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 = Assets API()
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 Assets API#assetsCreateNewAsset")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Assets API#assetsCreateNewAsset")
e.printStackTrace()
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
transferables | kotlin.Boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement) | [optional] |
seed | Seed | [optional] |
Return type
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 = Assets API()
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 Assets API#assetsDeleteAsset")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Assets API#assetsDeleteAsset")
e.printStackTrace()
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
asset | java.util.UUID | The 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 = Assets API()
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 Assets API#assetsDraft")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Assets API#assetsDraft")
e.printStackTrace()
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
transferables | kotlin.Boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement) | [optional] |
seed | Seed | [optional] |
Return type
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 = Assets API()
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 Assets API#assetsGetRecommendedAssets")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Assets API#assetsGetRecommendedAssets")
e.printStackTrace()
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
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. | [optional] |
Return type
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 = Assets API()
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 Assets API#assetsGetRelatedAssets")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Assets API#assetsGetRelatedAssets")
e.printStackTrace()
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
assets | Assets | The body of the request is an object (Assets Model) with iterable internally. | [optional] |
Return type
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 = Assets API()
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 Assets API#assetsIdentifiersSnapshot")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Assets API#assetsIdentifiersSnapshot")
e.printStackTrace()
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
pseudo | kotlin.Boolean | This is helper boolean that will give you the ability to also include your pseudo assets, we will always default to false. | [optional] |
Return type
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 = Assets API()
try {
val result : PseudoAssets = apiInstance.assetsPseudoSnapshot()
println(result)
} catch (e: ClientException) {
println("4xx response calling Assets API#assetsPseudoSnapshot")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Assets API#assetsPseudoSnapshot")
e.printStackTrace()
}
Parameters
This endpoint does not need any parameter.
Return type
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 = Assets API()
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 Assets API#assetsSearchAssets")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Assets API#assetsSearchAssets")
e.printStackTrace()
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
query | kotlin.String | This is a string that you can use to search your assets. | [optional] |
transferables | kotlin.Boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement) | [optional] |
searchableTags | kotlin.String | This is a comma separated value of tags used for search. | [optional] |
pseudo | kotlin.Boolean | This is helper boolean that will give you the ability to also include your pseudo assets, we will always default to false. | [optional] |
Return type
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 = Assets API()
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 Assets API#assetsSearchWithFilters")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Assets API#assetsSearchWithFilters")
e.printStackTrace()
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
transferables | kotlin.Boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement) | [optional] |
pseudo | kotlin.Boolean | This is helper boolean that will give you the ability to also include your pseudo assets, we will always default to false. | [optional] |
assetsSearchWithFiltersInput | AssetsSearchWithFiltersInput | [optional] |
Return type
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 = Assets API()
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 Assets API#assetsSnapshot")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Assets API#assetsSnapshot")
e.printStackTrace()
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
transferables | kotlin.Boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement) | [optional] |
suggested | kotlin.Boolean | This will let us know if a developer, wants a snapshot related to suggested content or normal content | [optional] |
pseudo | kotlin.Boolean | This is helper boolean that will give you the ability to also include your pseudo assets, we will always default to false. | [optional] |
Return type
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 = Assets API()
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 Assets API#assetsSpecificAssetFormatsSnapshot")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Assets API#assetsSpecificAssetFormatsSnapshot")
e.printStackTrace()
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
asset | java.util.UUID | The id (uuid) of the asset that you are trying to access. | |
transferables | kotlin.Boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement) | [optional] |
Return type
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 = Assets API()
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 Assets API#assetsSpecificAssetSnapshot")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Assets API#assetsSpecificAssetSnapshot")
e.printStackTrace()
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
asset | java.util.UUID | The id (uuid) of the asset that you are trying to access. | |
transferables | kotlin.Boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement) | [optional] |
Return type
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 = Assets API()
try {
val result : StreamedIdentifiers = apiInstance.assetsStreamIdentifiers()
println(result)
} catch (e: ClientException) {
println("4xx response calling Assets API#assetsStreamIdentifiers")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Assets API#assetsStreamIdentifiers")
e.printStackTrace()
}
Parameters
This endpoint does not need any parameter.
Return type
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 = Assets API()
try {
val result : Assets = apiInstance.getAssetsStreamTransferables()
println(result)
} catch (e: ClientException) {
println("4xx response calling Assets API#getAssetsStreamTransferables")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Assets API#getAssetsStreamTransferables")
e.printStackTrace()
}
Parameters
This endpoint does not need any parameter.
Return type
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 = Assets API()
try {
val result : Assets = apiInstance.streamAssets()
println(result)
} catch (e: ClientException) {
println("4xx response calling Assets API#streamAssets")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling Assets API#streamAssets")
e.printStackTrace()
}
Parameters
This endpoint does not need any parameter.
Return type
Authorization
No authorization required
HTTP request headers
- Content-Type: Not defined
- Accept: application/json