Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Latest commit

 

History

History
914 lines (686 loc) · 27.2 KB

AuthApi.md

File metadata and controls

914 lines (686 loc) · 27.2 KB

ElementsSDK.Api.AuthApi

All URIs are relative to https://elements.local

Method HTTP request Description
CheckAuthTicket POST /api/2/auth/ticket/check
CreateAuthTicket POST /api/2/auth/ticket
DeleteAccessToken DELETE /api/2/auth/access-tokens/{id}
GeneratePassword POST /api/2/auth/generate-password
GetAccessToken GET /api/2/auth/access-tokens/{id}
GetAllAccessTokens GET /api/2/auth/access-tokens
Login POST /api/2/auth/login
Logout POST /api/2/auth/logout
ResetPassword POST /api/2/auth/reset-password
SendAccessTokenEmailNotification POST /api/2/auth/access-tokens/{id}/email
StartImpersonation POST /api/2/auth/impersonation
StopImpersonation POST /api/2/auth/impersonation/stop

CheckAuthTicket

ElementsUserDetail CheckAuthTicket (Ticket ticket)

Required permissions * <class 'rest_framework.permissions.AllowAny'>

Example

using System.Collections.Generic;
using System.Diagnostics;
using ElementsSDK.Api;
using ElementsSDK.Client;
using ElementsSDK.Model;

namespace Example
{
    public class CheckAuthTicketExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://elements.local";
            // Configure API key authorization: Bearer
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new AuthApi(config);
            var ticket = new Ticket(); // Ticket | 

            try
            {
                ElementsUserDetail result = apiInstance.CheckAuthTicket(ticket);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AuthApi.CheckAuthTicket: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
ticket Ticket

Return type

ElementsUserDetail

Authorization

Bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreateAuthTicket

Ticket CreateAuthTicket ()

Required permissions * Authenticated user

Example

using System.Collections.Generic;
using System.Diagnostics;
using ElementsSDK.Api;
using ElementsSDK.Client;
using ElementsSDK.Model;

namespace Example
{
    public class CreateAuthTicketExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://elements.local";
            // Configure API key authorization: Bearer
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new AuthApi(config);

            try
            {
                Ticket result = apiInstance.CreateAuthTicket();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AuthApi.CreateAuthTicket: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

Ticket

Authorization

Bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteAccessToken

void DeleteAccessToken (int id)

Required permissions * Authenticated user

Example

using System.Collections.Generic;
using System.Diagnostics;
using ElementsSDK.Api;
using ElementsSDK.Client;
using ElementsSDK.Model;

namespace Example
{
    public class DeleteAccessTokenExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://elements.local";
            // Configure API key authorization: Bearer
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new AuthApi(config);
            var id = 56;  // int | A unique integer value identifying this one time access token.

            try
            {
                apiInstance.DeleteAccessToken(id);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AuthApi.DeleteAccessToken: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
id int A unique integer value identifying this one time access token.

Return type

void (empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 No body -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GeneratePassword

GeneratePasswordEndpointResponse GeneratePassword ()

Required permissions * Authenticated user

Example

using System.Collections.Generic;
using System.Diagnostics;
using ElementsSDK.Api;
using ElementsSDK.Client;
using ElementsSDK.Model;

namespace Example
{
    public class GeneratePasswordExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://elements.local";
            // Configure API key authorization: Bearer
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new AuthApi(config);

            try
            {
                GeneratePasswordEndpointResponse result = apiInstance.GeneratePassword();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AuthApi.GeneratePassword: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

GeneratePasswordEndpointResponse

Authorization

Bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetAccessToken

OneTimeAccessToken GetAccessToken (int id)

Required permissions * Authenticated user

Example

using System.Collections.Generic;
using System.Diagnostics;
using ElementsSDK.Api;
using ElementsSDK.Client;
using ElementsSDK.Model;

namespace Example
{
    public class GetAccessTokenExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://elements.local";
            // Configure API key authorization: Bearer
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new AuthApi(config);
            var id = 56;  // int | A unique integer value identifying this one time access token.

            try
            {
                OneTimeAccessToken result = apiInstance.GetAccessToken(id);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AuthApi.GetAccessToken: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
id int A unique integer value identifying this one time access token.

Return type

OneTimeAccessToken

Authorization

Bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetAllAccessTokens

List<OneTimeAccessToken> GetAllAccessTokens (string sharedBundles = null, string sharedDirectories = null, string sharedBundlesAsset = null, string user = null, string createdBy = null, string ordering = null, int? limit = null, int? offset = null)

Required permissions * Authenticated user

Example

using System.Collections.Generic;
using System.Diagnostics;
using ElementsSDK.Api;
using ElementsSDK.Client;
using ElementsSDK.Model;

namespace Example
{
    public class GetAllAccessTokensExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://elements.local";
            // Configure API key authorization: Bearer
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new AuthApi(config);
            var sharedBundles = sharedBundles_example;  // string | Filter the returned list by `shared_bundles`. (optional) 
            var sharedDirectories = sharedDirectories_example;  // string | Filter the returned list by `shared_directories`. (optional) 
            var sharedBundlesAsset = sharedBundlesAsset_example;  // string | Filter the returned list by `shared_bundles__asset`. (optional) 
            var user = user_example;  // string | Filter the returned list by `user`. (optional) 
            var createdBy = createdBy_example;  // string | Filter the returned list by `created_by`. (optional) 
            var ordering = ordering_example;  // string | Which field to use when ordering the results. (optional) 
            var limit = 56;  // int? | Number of results to return per page. (optional) 
            var offset = 56;  // int? | The initial index from which to return the results. (optional) 

            try
            {
                List<OneTimeAccessToken> result = apiInstance.GetAllAccessTokens(sharedBundles, sharedDirectories, sharedBundlesAsset, user, createdBy, ordering, limit, offset);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AuthApi.GetAllAccessTokens: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
sharedBundles string Filter the returned list by `shared_bundles`. [optional]
sharedDirectories string Filter the returned list by `shared_directories`. [optional]
sharedBundlesAsset string Filter the returned list by `shared_bundles__asset`. [optional]
user string Filter the returned list by `user`. [optional]
createdBy string Filter the returned list by `created_by`. [optional]
ordering string Which field to use when ordering the results. [optional]
limit int? Number of results to return per page. [optional]
offset int? The initial index from which to return the results. [optional]

Return type

List<OneTimeAccessToken>

Authorization

Bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Login

AuthLoginEndpointResponse Login (AuthLoginEndpointRequest authLoginEndpointRequest)

Required permissions * <class 'rest_framework.permissions.AllowAny'>

Example

using System.Collections.Generic;
using System.Diagnostics;
using ElementsSDK.Api;
using ElementsSDK.Client;
using ElementsSDK.Model;

namespace Example
{
    public class LoginExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://elements.local";
            // Configure API key authorization: Bearer
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new AuthApi(config);
            var authLoginEndpointRequest = new AuthLoginEndpointRequest(); // AuthLoginEndpointRequest | 

            try
            {
                AuthLoginEndpointResponse result = apiInstance.Login(authLoginEndpointRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AuthApi.Login: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
authLoginEndpointRequest AuthLoginEndpointRequest

Return type

AuthLoginEndpointResponse

Authorization

Bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Logout

void Logout ()

Required permissions * <class 'rest_framework.permissions.AllowAny'>

Example

using System.Collections.Generic;
using System.Diagnostics;
using ElementsSDK.Api;
using ElementsSDK.Client;
using ElementsSDK.Model;

namespace Example
{
    public class LogoutExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://elements.local";
            // Configure API key authorization: Bearer
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new AuthApi(config);

            try
            {
                apiInstance.Logout();
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AuthApi.Logout: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 No body -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ResetPassword

void ResetPassword (PasswordResetEndpointRequest passwordResetEndpointRequest)

Required permissions * <class 'rest_framework.permissions.AllowAny'>

Example

using System.Collections.Generic;
using System.Diagnostics;
using ElementsSDK.Api;
using ElementsSDK.Client;
using ElementsSDK.Model;

namespace Example
{
    public class ResetPasswordExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://elements.local";
            // Configure API key authorization: Bearer
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new AuthApi(config);
            var passwordResetEndpointRequest = new PasswordResetEndpointRequest(); // PasswordResetEndpointRequest | 

            try
            {
                apiInstance.ResetPassword(passwordResetEndpointRequest);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AuthApi.ResetPassword: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
passwordResetEndpointRequest PasswordResetEndpointRequest

Return type

void (empty response body)

Authorization

Bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 No body -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SendAccessTokenEmailNotification

void SendAccessTokenEmailNotification (int id, SendLinkEmailRequest sendLinkEmailRequest)

Required permissions * Authenticated user

Example

using System.Collections.Generic;
using System.Diagnostics;
using ElementsSDK.Api;
using ElementsSDK.Client;
using ElementsSDK.Model;

namespace Example
{
    public class SendAccessTokenEmailNotificationExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://elements.local";
            // Configure API key authorization: Bearer
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new AuthApi(config);
            var id = 56;  // int | A unique integer value identifying this one time access token.
            var sendLinkEmailRequest = new SendLinkEmailRequest(); // SendLinkEmailRequest | 

            try
            {
                apiInstance.SendAccessTokenEmailNotification(id, sendLinkEmailRequest);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AuthApi.SendAccessTokenEmailNotification: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
id int A unique integer value identifying this one time access token.
sendLinkEmailRequest SendLinkEmailRequest

Return type

void (empty response body)

Authorization

Bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 No body -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

StartImpersonation

void StartImpersonation (ImpersonationEndpointRequest impersonationEndpointRequest)

Required permissions * User account permission: system:admin-access

Example

using System.Collections.Generic;
using System.Diagnostics;
using ElementsSDK.Api;
using ElementsSDK.Client;
using ElementsSDK.Model;

namespace Example
{
    public class StartImpersonationExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://elements.local";
            // Configure API key authorization: Bearer
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new AuthApi(config);
            var impersonationEndpointRequest = new ImpersonationEndpointRequest(); // ImpersonationEndpointRequest | 

            try
            {
                apiInstance.StartImpersonation(impersonationEndpointRequest);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AuthApi.StartImpersonation: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
impersonationEndpointRequest ImpersonationEndpointRequest

Return type

void (empty response body)

Authorization

Bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 No body -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

StopImpersonation

void StopImpersonation ()

Required permissions * Authenticated user

Example

using System.Collections.Generic;
using System.Diagnostics;
using ElementsSDK.Api;
using ElementsSDK.Client;
using ElementsSDK.Model;

namespace Example
{
    public class StopImpersonationExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://elements.local";
            // Configure API key authorization: Bearer
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new AuthApi(config);

            try
            {
                apiInstance.StopImpersonation();
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling AuthApi.StopImpersonation: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 No body -

[Back to top] [Back to API list] [Back to Model list] [Back to README]