Connector API
All URIs are relative to http://localhost:1000
Method | HTTP request | Description |
---|---|---|
connect | POST /connect | /connect [POST] |
intention | POST /{application}/intention | /{application}/intention [POST] |
onboarded | POST /{application}/onboarded | /onboarded [POST] |
react | POST /{application}/reaction | /{application}/reaction [POST] |
suggest | POST /{application}/suggestion | /{application}/suggestion [POST] |
track | POST /{application}/track | /{application}/track [POST] |
connect
Context connect()
Abstracts a bootup/connection for a specific context.
Example
import * as Pieces from '@pieces.app/pieces-os-client'
const configuration = Pieces.Configuration()
const apiInstance = new Pieces.ConnectorApi(configuration)
const body: Pieces.ConnectRequest = {
// SeededConnectorConnection | (optional)
seededConnectorConnection: ,
};
apiInstance.connect(body).then((data: Context) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))
Parameters
Name | Type | Description | Notes |
---|---|---|---|
seededConnectorConnection | SeededConnectorConnection |
Return type
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad Request, Application Failed to connect, Please ensure this is a valid integration. This happens in the case a developer provides and incorrect {application} (applicationId) within the route that doest match a preregisterd integration. | - |
intention
string intention()
Allows you to send a SeededAsset for future comparison.
Example
import * as Pieces from '@pieces.app/pieces-os-client'
const configuration = Pieces.Configuration()
const apiInstance = new Pieces.ConnectorApi(configuration)
const body: Pieces.IntentionRequest = {
// string
application: application_example,
// SeededConnectorAsset (optional)
seededConnectorAsset: ,
};
apiInstance.intention(body).then((data: string) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))
Parameters
Name | Type | Description | Notes |
---|---|---|---|
seededConnectorAsset | SeededConnectorAsset | ||
application | [string] | defaults to undefined |
Return type
string
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
400 | Bad Request, Application Failed to connect, Please ensure this is a valid integration. This happens in the case a developer provides and incorrect {application} (applicationId) within the route that doest match a preregisterd integration. | - |
401 | Unauthorized, you will get this in the case that you are trying to ping Pieces_OS but havnt connected yet."/connect was not called for your application." | - |
500 | Internal Server Error: | - |
onboarded
string onboarded()
A central endpoint to manage updates to the onboarding process.
Example
import * as Pieces from '@pieces.app/pieces-os-client'
const configuration = Pieces.Configuration()
const apiInstance = new Pieces.ConnectorApi(configuration)
const body: Pieces.OnboardedRequest = {
// string | This is a uuid that represents an application
application: application_example,
// boolean | Whether or not that application has been onboarded. (optional)
body: true,
};
apiInstance.onboarded(body).then((data: string) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))
Parameters
Name | Type | Description | Notes |
---|---|---|---|
body | boolean | Whether or not that application has been onboarded. | |
application | [string] | This is a uuid that represents an application | defaults to undefined |
Return type
string
HTTP request headers
- Content-Type: application/json
- Accept: application/json
HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK, This will just return a string of "OK". | - |
400 | Bad Request, Application Failed to connect, Please ensure this is a valid integration. This happens in the case a developer provides and incorrect {application} (applicationId) within the route that doest match a preregisterd integration. | - |
401 | Unauthorized, you will get this in the case that you are trying to ping Pieces_OS but havnt connected yet."/connect was not called for your application." | - |
react
string react()
This will respond to the output generated by the /suggest endpoint.
Example
import * as Pieces from '@pieces.app/pieces-os-client'
const configuration = Pieces.Configuration()
const apiInstance = new Pieces.ConnectorApi(configuration)
const body: Pieces.ReactRequest = {
// string
application: application_example,
// Reaction | ** This body will need to be modified. (optional)
reaction: ,
};
apiInstance.react(body).then((data: string) => {
console.log('API called successfully. Returned data: ' + data)
}).catch((error: unknown) => console.error(error))
Parameters
Name | Type | Description | Notes |
---|---|---|---|
reaction | Reaction | ** This body will need to be modified. | |
application | [string] | defaults to undefined |
Return type
string