Skip to main content

Websites API

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

MethodHTTP requestDescription
websitesCreateNewWebsitePOST /websites/create/websites/create [POST]
websitesDeleteSpecificWebsitePOST /websites/{website}/delete/websites/{website}/delete [POST]
websitesExistsPOST /websites/exists/websites/exists [POST]
websitesSnapshotGET /websites/websites [GET]

websitesCreateNewWebsite

Website websitesCreateNewWebsite()

This will create a website and attach it to a specific asset.

Example

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

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

const body: Pieces.WebsitesCreateNewWebsiteRequest = {
// 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,
// SeededWebsite (optional)
seededWebsite: ,
};

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

Parameters

NameTypeDescriptionNotes
seededWebsiteSeededWebsite
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

Website

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

websitesDeleteSpecificWebsite

websitesDeleteSpecificWebsite()

This will delete a specific website!

Example

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

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

const body: Pieces.WebsitesDeleteSpecificWebsiteRequest = {
// string | website id
website: website_example,
};

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

Parameters

NameTypeDescriptionNotes
website[string]website iddefaults 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-

websitesExists

ExistingMetadata websitesExists()

This will check all of the websites in our database to see if this specific provided website actually exists, if not we will just return a null website in the output.

Example

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

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

const body: Pieces.WebsitesExistsRequest = {
// ExistentMetadata (optional)
existentMetadata: ,
};

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

Parameters

NameTypeDescriptionNotes
existentMetadataExistentMetadata

Return type

ExistingMetadata

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

websitesSnapshot

Websites websitesSnapshot()

This will get a snapshot of all your websites.

Example

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

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

const body: Pieces.WebsitesSnapshotRequest = {
// 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.websitesSnapshot(body).then((data: Websites) => {
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

Websites

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-