Skip to main content

Github API

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

MethodHTTP requestDescription
importGithubGistsPOST /github/gists/import/github/gists/import [POST]

importGithubGists​

Seeds importGithubGists()

This will attempt to get all the gist availble and return them to the user as a DiscoveredAssets. if automatic is true we will automatically create the asset. v1. will just get all the users' gists. implemented. v2. can get specific a public gist.

Example​

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

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

const body: Pieces.ImportGithubGistsRequest = {
// boolean | For most cases set to true. If this is set to true we will handle the behavior automically or else we will not proactively handle specific behavior but we will let the developer decide the behavior. (optional)
automatic: true,
// SeededGithubGistsImport | (optional)
seededGithubGistsImport: ,
};

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

Parameters​

NameTypeDescriptionNotes
seededGithubGistsImportSeededGithubGistsImport
automatic[boolean]For most cases set to true. If this is set to true we will handle the behavior automically or else we will not proactively handle specific behavior but we will let the developer decide the behavior.(optional) defaults to true

Return type​

Seeds

HTTP request headers​

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

HTTP response details​

Status codeDescriptionResponse headers
200OK-
412Precondition Failed, This means the user was not authenticated with PiecesOS with github.-
500Internal Server Error-
511Network Authentication Required, Not logged into Pieces os required the user to authenticate. or if the user is not connected to their cloud.-