Skip to main content

ConversationMessages API

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

MethodHTTP requestDescription
messagesCreateSpecificMessagePOST /messages/create/messages/create [POST]
messagesDeleteSpecificMessagePOST /messages/{message}/delete/messages/{message}/delete [POST]
messagesSnapshotGET /messages/messages [GET]

messagesCreateSpecificMessage

ConversationMessage messagesCreateSpecificMessage()

This will create a Message on a specific conversation.

Example

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

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

const body: Pieces.MessagesCreateSpecificMessageRequest = {
// 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,
// SeededConversationMessage (optional)
seededConversationMessage: ,
};

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

Parameters

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

ConversationMessage

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-

messagesDeleteSpecificMessage

messagesDeleteSpecificMessage()

This will delete a specific message.

Example

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

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

const body: Pieces.MessagesDeleteSpecificMessageRequest = {
// string | This is the uuid of a message.
message: message_example,
};

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

Parameters

NameTypeDescriptionNotes
message[string]This is the uuid of a message.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-

messagesSnapshot

ConversationMessages messagesSnapshot()

This will get all the messages.

Example

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

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

const body: Pieces.MessagesSnapshotRequest = {
// 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.messagesSnapshot(body).then((data: ConversationMessages) => {
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

ConversationMessages

HTTP request headers

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

HTTP response details

Status codeDescriptionResponse headers
200OK-
500Internal Server Error-