Skip to main content

Connector API

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

MethodHTTP requestDescription
connectPOST /connect/connect [POST]
intentionPOST /{application}/intention/{application}/intention [POST]
onboardedPOST /{application}/onboarded/onboarded [POST]
reactPOST /{application}/reaction/{application}/reaction [POST]
suggestPOST /{application}/suggestion/{application}/suggestion [POST]
trackPOST /{application}/track/{application}/track [POST]

connect

Context connect(seededConnectorConnection)

/connect [POST]

Abstracts a bootup/connection for a specific context.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = ConnectorApi()
val seededConnectorConnection : SeededConnectorConnection = // SeededConnectorConnection |
try {
val result : Context = apiInstance.connect(seededConnectorConnection)
println(result)
} catch (e: ClientException) {
println("4xx response calling ConnectorApi#connect")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ConnectorApi#connect")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
seededConnectorConnectionSeededConnectorConnection[optional]

Return type

Context

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

intention

kotlin.String intention(application, seededConnectorAsset)

/{application}/intention [POST]

Allows you to send a SeededAsset for future comparison.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = ConnectorApi()
val application : kotlin.String = application_example // kotlin.String |
val seededConnectorAsset : SeededConnectorAsset = // SeededConnectorAsset |
try {
val result : kotlin.String = apiInstance.intention(application, seededConnectorAsset)
println(result)
} catch (e: ClientException) {
println("4xx response calling ConnectorApi#intention")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ConnectorApi#intention")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
applicationkotlin.String
seededConnectorAssetSeededConnectorAsset[optional]

Return type

kotlin.String

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

onboarded

kotlin.String onboarded(application, body)

/onboarded [POST]

A central endpoint to manage updates to the onboarding process.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = ConnectorApi()
val application : kotlin.String = application_example // kotlin.String | This is a uuid that represents an application
val body : kotlin.Boolean = true // kotlin.Boolean | Whether or not that application has been onboarded.
try {
val result : kotlin.String = apiInstance.onboarded(application, body)
println(result)
} catch (e: ClientException) {
println("4xx response calling ConnectorApi#onboarded")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ConnectorApi#onboarded")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
applicationkotlin.StringThis is a uuid that represents an application
bodykotlin.BooleanWhether or not that application has been onboarded.[optional]

Return type

kotlin.String

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

react

kotlin.String react(application, reaction)

/{application}/reaction [POST]

This will respond to the output generated by the /suggest endpoint.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = ConnectorApi()
val application : kotlin.String = application_example // kotlin.String |
val reaction : Reaction = // Reaction | ** This body will need to be modified.
try {
val result : kotlin.String = apiInstance.react(application, reaction)
println(result)
} catch (e: ClientException) {
println("4xx response calling ConnectorApi#react")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ConnectorApi#react")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
applicationkotlin.String
reactionReaction** This body will need to be modified.[optional]

Return type

kotlin.String

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

suggest

Suggestion suggest(application, seededConnectorCreation)

/{application}/suggestion [POST]

Invoked whenever a code snippet is copied from an integration. For instance, if a JetBrains user copies code, this endpoint can be called to assess whether to suggest reusing a piece (if reuse is true, the endpoint provides assets that the user may consider using), saving the code snippet, or taking no action. **Note: This endpoint could potentially accept a SeededFormat for the request body if required.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = ConnectorApi()
val application : kotlin.String = application_example // kotlin.String |
val seededConnectorCreation : SeededConnectorCreation = // SeededConnectorCreation | This is the Snippet that we will compare to all the saved assets to determine what we want to do with it!
try {
val result : Suggestion = apiInstance.suggest(application, seededConnectorCreation)
println(result)
} catch (e: ClientException) {
println("4xx response calling ConnectorApi#suggest")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ConnectorApi#suggest")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
applicationkotlin.String
seededConnectorCreationSeededConnectorCreationThis is the Snippet that we will compare to all the saved assets to determine what we want to do with it![optional]

Return type

Suggestion

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

track

kotlin.String track(application, seededConnectorTracking)

/{application}/track [POST]

Abstracts the process of packaging segments on a per-context basis.

Example

// Import classes:
import app.pieces.pieces-os-client.infrastructure.*
import app.pieces.pieces-os-client.models.*

val apiInstance = ConnectorApi()
val application : kotlin.String = application_example // kotlin.String | This is a uuid that represents an application
val seededConnectorTracking : SeededConnectorTracking = // SeededConnectorTracking | The body is able to take in several properties
try {
val result : kotlin.String = apiInstance.track(application, seededConnectorTracking)
println(result)
} catch (e: ClientException) {
println("4xx response calling ConnectorApi#track")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling ConnectorApi#track")
e.printStackTrace()
}

Parameters

NameTypeDescriptionNotes
applicationkotlin.StringThis is a uuid that represents an application
seededConnectorTrackingSeededConnectorTrackingThe body is able to take in several properties[optional]

Return type

kotlin.String

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined