Skip to main content

Activities API

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

MethodHTTP requestDescription
activitiesCreateNewActivityPOST /activities/create/activities/create [POST]
activitiesDeleteSpecificActivityPOST /activities/{activity}/delete/activities/{activity}/delete [POST]
activitiesSnapshotGET /activities/activities [GET]

activitiesCreateNewActivity​

Activity activitiesCreateNewActivity()

This will create a new Activity.

Example​

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

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

const body: Pieces.ActivitiesCreateNewActivityRequest = {
// 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,
// SeededActivity (optional)
seededActivity: ,
};

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

Parameters​

NameTypeDescriptionNotes
seededActivitySeededActivity
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​

Activity

HTTP request headers​

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

HTTP response details​

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

activitiesDeleteSpecificActivity​

activitiesDeleteSpecificActivity()

This will delete a specific activity. important note: if we delete an activity: that is going to be a generic or a specific/ we will also delete its counter part i.e the specific. and vise versa, this ensures that the references are always cleaned.

Example​

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

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

const body: Pieces.ActivitiesDeleteSpecificActivityRequest = {
// string | This is a specific activity uuid.
activity: activity_example,
};

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

Parameters​

NameTypeDescriptionNotes
activity[string]This is a specific activity uuid.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-

activitiesSnapshot​

Activities activitiesSnapshot()

This will get a snapshot of all of the activities

Example​

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

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

const body: Pieces.ActivitiesSnapshotRequest = {
// 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,
// boolean | This is helper boolean that will give you the ability to also include your pseudo assets, we will always default to false. (optional)
pseudo: true,
};

apiInstance.activitiesSnapshot(body).then((data: Activities) => {
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
pseudo[boolean]This is helper boolean that will give you the ability to also include your pseudo assets, we will always default to false.(optional) defaults to undefined

Return type​

Activities

HTTP request headers​

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

HTTP response details​

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-