Skip to main content

Users API

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

MethodHTTP requestDescription
authenticateFromOauthTokenPOST /users/authenticate/from_token/users/authenticate/from_token [POST]
usersDisconnectUserPOST /users/{user}/disconnect/users/{user}/disconnect [POST]
usersSnapshotGET /users/users [GET]
usersSpecificUserSnapshotGET /users/{user}/users/{user} [GET] Scoped to Users

authenticateFromOauthToken​

UserProfile authenticateFromOauthToken()

Creates a User From a oAuth Token

Example​

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

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

const body: Pieces.AuthenticateFromOauthTokenRequest = {
// OAuthToken | (optional)
oAuthToken: ,
};

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

Parameters​

NameTypeDescriptionNotes
oAuthTokenOAuthToken

Return type​

UserProfile

HTTP request headers​

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

HTTP response details​

Status codeDescriptionResponse headers
200OK-

usersDisconnectUser​

Users usersDisconnectUser()

Locally Removing a user for the purpose of Signing Out

Example​

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

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

const body: Pieces.UsersDisconnectUserRequest = {
// string
user: user_example,
};

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

Parameters​

NameTypeDescriptionNotes
user[string]defaults to undefined

Return type​

Users

HTTP request headers​

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

HTTP response details​

Status codeDescriptionResponse headers
200OK-

usersSnapshot​

Users usersSnapshot()

this will return a snapshot of all of the users that are in the users database. TODO might want to make this internal.

Example​

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

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

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

Parameters​

This endpoint does not need any parameters.

Return type​

Users

HTTP request headers​

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

HTTP response details​

Status codeDescriptionResponse headers
200OK-

usersSpecificUserSnapshot​

UserProfile usersSpecificUserSnapshot()

This enables the client to get the current user. This endpoint will return a UserPRofile or will throw an error since you are sending user uid.

Example​

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

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

const body: Pieces.UsersSpecificUserSnapshotRequest = {
// string | The id (uuid) for a specific user.
user: 497f6eca-6276-4993-bfeb-53cbbbba6f08,
};

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

Parameters​

NameTypeDescriptionNotes
user[string]The id (uuid) for a specific user.defaults to undefined

Return type​

UserProfile

HTTP request headers​

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

HTTP response details​

Status codeDescriptionResponse headers
200OK-