GoodMem
ReferenceClient SDKsJavaScript SDK

Users API

Users API documentation for JavaScript SDK

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

MethodHTTP requestDescription
getCurrentUserGET /v1/users/meGet current user profile
getUserGET /v1/users/{id}Get a user by ID
getUserByEmailGET /v1/users/email/{email}Get user by email address

getCurrentUser

UserResponse getCurrentUser()

Get current user profile

Retrieves the authenticated user's profile information including email, display name, and creation time. This endpoint does not require any parameters as it automatically returns the caller's information.

Example

import GoodMemClient from '@pairsystems/goodmem-client';

let apiInstance = new GoodMemClient.UsersApi();
apiInstance.getCurrentUser().then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

UserResponse

Authorization

No authorization required

HTTP request headers

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

getUser

UserResponse getUser(id)

Get a user by ID

Retrieves a specific user by their unique identifier. This endpoint only accepts user IDs - for email-based lookup, use GET /v1/users/email/{email}. For getting your own profile, use GET /v1/users/me.

Example

import GoodMemClient from '@pairsystems/goodmem-client';

let apiInstance = new GoodMemClient.UsersApi();
let id = "550e8400-e29b-41d4-a716-446655440000"; // String | The unique identifier of the user to retrieve
apiInstance.getUser(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
idStringThe unique identifier of the user to retrieve

Return type

UserResponse

Authorization

No authorization required

HTTP request headers

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

getUserByEmail

UserResponse getUserByEmail(email)

Get user by email address

Retrieves a user by their email address. The email must be URL-encoded if it contains special characters.

Example

import GoodMemClient from '@pairsystems/goodmem-client';

let apiInstance = new GoodMemClient.UsersApi();
let email = "[email protected]"; // String | The email address of the user to retrieve
apiInstance.getUserByEmail(email).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

NameTypeDescriptionNotes
emailStringThe email address of the user to retrieve

Return type

UserResponse

Authorization

No authorization required

HTTP request headers

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