Skip to main content

Anchors API

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

MethodHTTP requestDescription
anchorDisassociateAssetPOST /anchors/{anchor}/assets/delete/{asset}/anchors/{anchor}/assets/delete/{asset} [POST]
anchorsCreateNewAnchorPOST /anchors/create/anchors/create [POST]
anchorsDeleteSpecificAnchorPOST /anchors/{anchor}/delete/anchors/{anchor}/delete [POST]
anchorsSnapshotGET /anchors/anchors [GET]

anchorDisassociateAsset

anchorDisassociateAsset()

This will update both the asset and the anchor reference, that will remove a anchor from an asset(only the references). This will NOT remove the anchor. This will NOT remove the asset. This will only update the references so that they are disconnected from one another.

Example

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.AnchorsApi(configuration)

const body: Pieces.AnchorDisassociateAssetRequest = {
// string | This is the specific uuid of an anchor.
anchor: anchor_example,
// string | The id (uuid) of the asset that you are trying to access.
asset: 2254f2c8-5797-40e8-ac56-41166dc0e159,
};

apiInstance.anchorDisassociateAsset(body).then((data: void (empty response body)) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters

NameTypeDescriptionNotes
anchor[string]This is the specific uuid of an anchor.defaults to undefined
asset[string]The id (uuid) of the asset that you are trying to access.defaults to undefined

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined
  • Accept: text/plain

HTTP response details

Status codeDescriptionResponse headers
204No Content-
500Internal Server Error-

anchorsCreateNewAnchor

Anchor anchorsCreateNewAnchor()

This will create a anchor and attach it to a specific asset(s) This will also ensure the anchor is normalized.

Example

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.AnchorsApi(configuration)

const body: Pieces.AnchorsCreateNewAnchorRequest = {
// boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement) (optional)
transferables: true,
// SeededAnchor (optional)
seededAnchor: ,
};

apiInstance.anchorsCreateNewAnchor(body).then((data: Anchor) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters

NameTypeDescriptionNotes
seededAnchorSeededAnchor
transferables[boolean]This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)(optional) defaults to undefined

Return type

Anchor

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json, text/plain

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

anchorsDeleteSpecificAnchor

anchorsDeleteSpecificAnchor()

This will delete a specific anchor!

Example

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.AnchorsApi(configuration)

const body: Pieces.AnchorsDeleteSpecificAnchorRequest = {
// string | This is the specific uuid of an anchor.
anchor: anchor_example,
};

apiInstance.anchorsDeleteSpecificAnchor(body).then((data: void (empty response body)) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters

NameTypeDescriptionNotes
anchor[string]This is the specific uuid of an anchor.defaults to undefined

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined
  • Accept: text/plain

HTTP response details

Status codeDescriptionResponse headers
204No Content-
500Internal Server Error-

anchorsSnapshot

Anchors anchorsSnapshot()

This will get a snapshot of all your anchors.

Example

import * as Pieces from '@pieces.app/pieces-os-client'

const configuration = Pieces.Configuration()
const apiInstance = new Pieces.AnchorsApi(configuration)

const body: Pieces.AnchorsSnapshotRequest = {
// boolean | This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement) (optional)
transferables: true,
};

apiInstance.anchorsSnapshot(body).then((data: Anchors) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))

Parameters

NameTypeDescriptionNotes
transferables[boolean]This is a boolean that will decided if we are want to return the transferable data (default) or not(performance enhancement)(optional) defaults to undefined

Return type

Anchors

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/plain

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-