Users API
All URIs are relative to http://localhost:1000
Method | HTTP request | Description |
---|---|---|
authenticateFromOauthToken | POST /users/authenticate/from_token | /users/authenticate/from_token [POST] |
usersDisconnectUser | POST /users/{user}/disconnect | /users/{user}/disconnect [POST] |
usersSnapshot | GET /users | /users [GET] |
usersSpecificUserSnapshot | GET /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​
Name | Type | Description | Notes |
---|---|---|---|
oAuthToken | OAuthToken |
Return type​
HTTP request headers​
- Content-Type: application/json
- Accept: application/json
HTTP response details​
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
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​
Name | Type | Description | Notes |
---|---|---|---|
user | [string] | defaults to undefined |
Return type​
HTTP request headers​
- Content-Type: Not defined
- Accept: application/json
HTTP response details​
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
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​
HTTP request headers​
- Content-Type: Not defined
- Accept: application/json
HTTP response details​
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
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​
Name | Type | Description | Notes |
---|---|---|---|
user | [string] | The id (uuid) for a specific user. | defaults to undefined |
Return type​
HTTP request headers​
- Content-Type: Not defined
- Accept: application/json
HTTP response details​
Status code | Description | Response headers |
---|---|---|
200 | OK | - |