All URIs are relative to http://localhost
Method | HTTP request | Description |
---|---|---|
CreateUser | POST /user | Register a new user |
GetMe | GET /user | Get authenticated user profile. |
GetRoles | GET /user/roles | Get the authenticated user roles |
UpdateUserProfile | PUT /user | Update the authenticated user |
CreatedContent CreateUser (UserCreate userCreate)
Register a new user
Create a new user.
using System.Collections.Generic;
using System.Diagnostics;
using PollinationSDK.Api;
using PollinationSDK.Client;
using PollinationSDK.Model;
namespace Example
{
public class CreateUserExample
{
public static void Main()
{
Configuration.Default.BasePath = "http://localhost";
// Configure HTTP bearer authorization: JWTAuth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new UserApi(Configuration.Default);
var userCreate = new UserCreate(); // UserCreate |
try
{
// Register a new user
CreatedContent result = apiInstance.CreateUser(userCreate);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.CreateUser: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
userCreate | UserCreate |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Success | - |
403 | Access forbidden | - |
500 | Server error | - |
400 | Invalid request | - |
202 | Accepted | - |
422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UserPrivate GetMe ()
Get authenticated user profile.
Get authenticated user profile
using System.Collections.Generic;
using System.Diagnostics;
using PollinationSDK.Api;
using PollinationSDK.Client;
using PollinationSDK.Model;
namespace Example
{
public class GetMeExample
{
public static void Main()
{
Configuration.Default.BasePath = "http://localhost";
// Configure API key authorization: APIKeyAuth
Configuration.Default.AddApiKey("x-pollination-token", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("x-pollination-token", "Bearer");
// Configure HTTP bearer authorization: JWTAuth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new UserApi(Configuration.Default);
try
{
// Get authenticated user profile.
UserPrivate result = apiInstance.GetMe();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.GetMe: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<string> GetRoles ()
Get the authenticated user roles
using System.Collections.Generic;
using System.Diagnostics;
using PollinationSDK.Api;
using PollinationSDK.Client;
using PollinationSDK.Model;
namespace Example
{
public class GetRolesExample
{
public static void Main()
{
Configuration.Default.BasePath = "http://localhost";
// Configure API key authorization: APIKeyAuth
Configuration.Default.AddApiKey("x-pollination-token", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("x-pollination-token", "Bearer");
// Configure HTTP bearer authorization: JWTAuth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new UserApi(Configuration.Default);
try
{
// Get the authenticated user roles
List<string> result = apiInstance.GetRoles();
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.GetRoles: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
This endpoint does not need any parameter.
List
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
UpdateAccepted UpdateUserProfile (UserUpdate userUpdate)
Update the authenticated user
Update the authenticated user profile
using System.Collections.Generic;
using System.Diagnostics;
using PollinationSDK.Api;
using PollinationSDK.Client;
using PollinationSDK.Model;
namespace Example
{
public class UpdateUserProfileExample
{
public static void Main()
{
Configuration.Default.BasePath = "http://localhost";
// Configure API key authorization: APIKeyAuth
Configuration.Default.AddApiKey("x-pollination-token", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.AddApiKeyPrefix("x-pollination-token", "Bearer");
// Configure HTTP bearer authorization: JWTAuth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new UserApi(Configuration.Default);
var userUpdate = new UserUpdate(); // UserUpdate |
try
{
// Update the authenticated user
UpdateAccepted result = apiInstance.UpdateUserProfile(userUpdate);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling UserApi.UpdateUserProfile: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
userUpdate | UserUpdate |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
202 | Accepted | - |
403 | Access forbidden | - |
500 | Server error | - |
400 | Invalid request | - |
404 | Not found | - |
422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]