GoodMem
ReferenceClient SDKs.NET SDK

Users API

Users API documentation for .NET 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

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;

namespace Example
{
    public class GetCurrentUserExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "[http://localhost";](http://localhost";)
            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new UsersApi(httpClient, config, httpClientHandler);

            try
            {
                // Get current user profile
                UserResponse result = apiInstance.GetCurrentUser();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling UsersApi.GetCurrentUser: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetCurrentUserWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Get current user profile
    `ApiResponse<UserResponse>` response = apiInstance.GetCurrentUserWithHttpInfo();
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling UsersApi.GetCurrentUserWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

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

HTTP response details

Status codeDescriptionResponse headers
200Successfully retrieved current user profile-
401Unauthorized - invalid or missing API key-

↑ Back to .NET SDK

GetUser

UserResponse GetUser (string 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

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;

namespace Example
{
    public class GetUserExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "[http://localhost";](http://localhost";)
            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new UsersApi(httpClient, config, httpClientHandler);
            var id = 550e8400-e29b-41d4-a716-446655440000;  // string | The unique identifier of the user to retrieve

            try
            {
                // Get a user by ID
                UserResponse result = apiInstance.GetUser(id);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling UsersApi.GetUser: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetUserWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Get a user by ID
    `ApiResponse<UserResponse>` response = apiInstance.GetUserWithHttpInfo(id);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling UsersApi.GetUserWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

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

HTTP response details

Status codeDescriptionResponse headers
200Successfully retrieved user-
400Invalid request - user ID in invalid format-
401Unauthorized - invalid or missing API key-
403Forbidden - insufficient permissions to view this user's information-
404Not found - user with the specified ID does not exist-

↑ Back to .NET SDK

GetUserByEmail

UserResponse GetUserByEmail (string 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

using System.Collections.Generic;
using System.Diagnostics;
using System.Net.Http;
using Pairsystems.Goodmem.Client.Api;
using Pairsystems.Goodmem.Client.Client;
using Pairsystems.Goodmem.Client.Model;

namespace Example
{
    public class GetUserByEmailExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "[http://localhost";](http://localhost";)
            // create instances of HttpClient, HttpClientHandler to be reused later with different Api classes
            HttpClient httpClient = new HttpClient();
            HttpClientHandler httpClientHandler = new HttpClientHandler();
            var apiInstance = new UsersApi(httpClient, config, httpClientHandler);
            var email = [email protected];  // string | The email address of the user to retrieve

            try
            {
                // Get user by email address
                UserResponse result = apiInstance.GetUserByEmail(email);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling UsersApi.GetUserByEmail: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the GetUserByEmailWithHttpInfo variant

This returns an ApiResponse object which contains the response data, status code and headers.

try
{
    // Get user by email address
    `ApiResponse<UserResponse>` response = apiInstance.GetUserByEmailWithHttpInfo(email);
    Debug.Write("Status Code: " + response.StatusCode);
    Debug.Write("Response Headers: " + response.Headers);
    Debug.Write("Response Body: " + response.Data);
}
catch (ApiException e)
{
    Debug.Print("Exception when calling UsersApi.GetUserByEmailWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

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

HTTP response details

Status codeDescriptionResponse headers
200Successfully retrieved user-
400Invalid request - email parameter is missing or empty-
401Unauthorized - invalid or missing API key-
403Forbidden - insufficient permissions to view this user's information-
404Not found - user with the specified email does not exist-

↑ Back to .NET SDK