All URIs are relative to http://localhost
Method | HTTP request | Description |
---|---|---|
CreateToken | POST /tokens | Create a new API token |
DeleteToken | DELETE /tokens/{token_id} | Delete an API Token |
ListTokens | GET /tokens | List user API tokens |
RegenerateToken | PUT /tokens/{token_id} | Regenerate an API token |
APITokenPrivate CreateToken (APITokenCreate aPITokenCreate)
Create a new API token
Create a new API token
using System.Collections.Generic;
using System.Diagnostics;
using PollinationSDK.Api;
using PollinationSDK.Client;
using PollinationSDK.Model;
namespace Example
{
public class CreateTokenExample
{
public static void Main()
{
Configuration.Default.BasePath = "http://localhost";
// Configure HTTP bearer authorization: JWTAuth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new APITokensApi(Configuration.Default);
var aPITokenCreate = new APITokenCreate(); // APITokenCreate |
try
{
// Create a new API token
APITokenPrivate result = apiInstance.CreateToken(aPITokenCreate);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling APITokensApi.CreateToken: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
aPITokenCreate | APITokenCreate |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Successful Response | - |
422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
AnyType DeleteToken (string tokenId)
Delete an API Token
Delete a token
using System.Collections.Generic;
using System.Diagnostics;
using PollinationSDK.Api;
using PollinationSDK.Client;
using PollinationSDK.Model;
namespace Example
{
public class DeleteTokenExample
{
public static void Main()
{
Configuration.Default.BasePath = "http://localhost";
// Configure HTTP bearer authorization: JWTAuth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new APITokensApi(Configuration.Default);
var tokenId = tokenId_example; // string |
try
{
// Delete an API Token
AnyType result = apiInstance.DeleteToken(tokenId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling APITokensApi.DeleteToken: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
tokenId | string |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
202 | Successful Response | - |
422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
APITokenList ListTokens (int? page = null, int? perPage = null)
List user API tokens
List API tokens for the authenticated user
using System.Collections.Generic;
using System.Diagnostics;
using PollinationSDK.Api;
using PollinationSDK.Client;
using PollinationSDK.Model;
namespace Example
{
public class ListTokensExample
{
public static void Main()
{
Configuration.Default.BasePath = "http://localhost";
// Configure HTTP bearer authorization: JWTAuth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new APITokensApi(Configuration.Default);
var page = 56; // int? | Page number starting from 1 (optional) (default to 1)
var perPage = 56; // int? | Number of items per page (optional) (default to 25)
try
{
// List user API tokens
APITokenList result = apiInstance.ListTokens(page, perPage);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling APITokensApi.ListTokens: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
page | int? | Page number starting from 1 | [optional] [default to 1] |
perPage | int? | Number of items per page | [optional] [default to 25] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
APITokenPrivate RegenerateToken (string tokenId)
Regenerate an API token
Regenerate a token
using System.Collections.Generic;
using System.Diagnostics;
using PollinationSDK.Api;
using PollinationSDK.Client;
using PollinationSDK.Model;
namespace Example
{
public class RegenerateTokenExample
{
public static void Main()
{
Configuration.Default.BasePath = "http://localhost";
// Configure HTTP bearer authorization: JWTAuth
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";
var apiInstance = new APITokensApi(Configuration.Default);
var tokenId = tokenId_example; // string |
try
{
// Regenerate an API token
APITokenPrivate result = apiInstance.RegenerateToken(tokenId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling APITokensApi.RegenerateToken: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
tokenId | string |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Successful Response | - |
422 | Validation Error | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]