Skip to content

Latest commit

 

History

History
921 lines (739 loc) · 28.6 KB

UsersApi.md

File metadata and controls

921 lines (739 loc) · 28.6 KB

Org.OpenAPITools.Api.UsersApi

All URIs are relative to https://smac-poc.mcs-group.com.my/

Method HTTP request Description
ApiUsersAssociatedSmacsGet GET /api/Users/associated-smacs Gets the SMACs associated with the user.
ApiUsersAuthenticatePost POST /api/Users/authenticate Performs user authentication.
ApiUsersForgotPasswordPost POST /api/Users/forgot-password Initiates password reset procedure.
ApiUsersRefreshTokenPost POST /api/Users/refresh-token Retrieves new access token.
ApiUsersRegisterPost POST /api/Users/register Register an account.
ApiUsersResendEmailConfirmationPost POST /api/Users/resend-email-confirmation Resend email confirmation.
ApiUsersRevokeTokenPost POST /api/Users/revoke-token Revokes a refresh token.
ApiUsersRolesPost POST /api/Users/roles Gets the authenticated user's roles.
ApiUsersUploadProfilePhotoPost POST /api/Users/upload-profile-photo Uploads current user profile photo.
ApiUsersUserProfilePost POST /api/Users/user-profile Gets the current user profile.

ApiUsersAssociatedSmacsGet

AssociatedSmacsResponse ApiUsersAssociatedSmacsGet ()

Gets the SMACs associated with the user.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ApiUsersAssociatedSmacsGetExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://smac-poc.mcs-group.com.my/";
            // Configure Bearer token for authorization: bearer
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new UsersApi(config);

            try
            {
                // Gets the SMACs associated with the user.
                AssociatedSmacsResponse result = apiInstance.ApiUsersAssociatedSmacsGet();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling UsersApi.ApiUsersAssociatedSmacsGet: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ApiUsersAssociatedSmacsGetWithHttpInfo variant

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

try
{
    // Gets the SMACs associated with the user.
    ApiResponse<AssociatedSmacsResponse> response = apiInstance.ApiUsersAssociatedSmacsGetWithHttpInfo();
    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.ApiUsersAssociatedSmacsGetWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

This endpoint does not need any parameter.

Return type

AssociatedSmacsResponse

Authorization

bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
403 Forbidden -

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

ApiUsersAuthenticatePost

AuthenticateResponse ApiUsersAuthenticatePost (AuthenticateRequest authenticateRequest = null)

Performs user authentication.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ApiUsersAuthenticatePostExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://smac-poc.mcs-group.com.my/";
            var apiInstance = new UsersApi(config);
            var authenticateRequest = new AuthenticateRequest(); // AuthenticateRequest |  (optional) 

            try
            {
                // Performs user authentication.
                AuthenticateResponse result = apiInstance.ApiUsersAuthenticatePost(authenticateRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling UsersApi.ApiUsersAuthenticatePost: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ApiUsersAuthenticatePostWithHttpInfo variant

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

try
{
    // Performs user authentication.
    ApiResponse<AuthenticateResponse> response = apiInstance.ApiUsersAuthenticatePostWithHttpInfo(authenticateRequest);
    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.ApiUsersAuthenticatePostWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
authenticateRequest AuthenticateRequest [optional]

Return type

AuthenticateResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json-patch+json, application/json, text/json, application/*+json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Authenticated -
400 Incorrect credential provided -
401 Unauthorized -
403 Forbidden -

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

ApiUsersForgotPasswordPost

string ApiUsersForgotPasswordPost (EmailRequest emailRequest = null)

Initiates password reset procedure.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ApiUsersForgotPasswordPostExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://smac-poc.mcs-group.com.my/";
            var apiInstance = new UsersApi(config);
            var emailRequest = new EmailRequest(); // EmailRequest |  (optional) 

            try
            {
                // Initiates password reset procedure.
                string result = apiInstance.ApiUsersForgotPasswordPost(emailRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling UsersApi.ApiUsersForgotPasswordPost: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ApiUsersForgotPasswordPostWithHttpInfo variant

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

try
{
    // Initiates password reset procedure.
    ApiResponse<string> response = apiInstance.ApiUsersForgotPasswordPostWithHttpInfo(emailRequest);
    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.ApiUsersForgotPasswordPostWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
emailRequest EmailRequest [optional]

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json-patch+json, application/json, text/json, application/*+json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -

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

ApiUsersRefreshTokenPost

AuthenticateResponse ApiUsersRefreshTokenPost (RefreshTokenRequest refreshTokenRequest = null)

Retrieves new access token.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ApiUsersRefreshTokenPostExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://smac-poc.mcs-group.com.my/";
            var apiInstance = new UsersApi(config);
            var refreshTokenRequest = new RefreshTokenRequest(); // RefreshTokenRequest |  (optional) 

            try
            {
                // Retrieves new access token.
                AuthenticateResponse result = apiInstance.ApiUsersRefreshTokenPost(refreshTokenRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling UsersApi.ApiUsersRefreshTokenPost: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ApiUsersRefreshTokenPostWithHttpInfo variant

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

try
{
    // Retrieves new access token.
    ApiResponse<AuthenticateResponse> response = apiInstance.ApiUsersRefreshTokenPostWithHttpInfo(refreshTokenRequest);
    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.ApiUsersRefreshTokenPostWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
refreshTokenRequest RefreshTokenRequest [optional]

Return type

AuthenticateResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json-patch+json, application/json, text/json, application/*+json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
401 Refresh token expired -

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

ApiUsersRegisterPost

string ApiUsersRegisterPost (RegisterRequest registerRequest = null)

Register an account.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ApiUsersRegisterPostExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://smac-poc.mcs-group.com.my/";
            var apiInstance = new UsersApi(config);
            var registerRequest = new RegisterRequest(); // RegisterRequest |  (optional) 

            try
            {
                // Register an account.
                string result = apiInstance.ApiUsersRegisterPost(registerRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling UsersApi.ApiUsersRegisterPost: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ApiUsersRegisterPostWithHttpInfo variant

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

try
{
    // Register an account.
    ApiResponse<string> response = apiInstance.ApiUsersRegisterPostWithHttpInfo(registerRequest);
    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.ApiUsersRegisterPostWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
registerRequest RegisterRequest [optional]

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json-patch+json, application/json, text/json, application/*+json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -

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

ApiUsersResendEmailConfirmationPost

string ApiUsersResendEmailConfirmationPost (EmailRequest emailRequest = null)

Resend email confirmation.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ApiUsersResendEmailConfirmationPostExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://smac-poc.mcs-group.com.my/";
            var apiInstance = new UsersApi(config);
            var emailRequest = new EmailRequest(); // EmailRequest |  (optional) 

            try
            {
                // Resend email confirmation.
                string result = apiInstance.ApiUsersResendEmailConfirmationPost(emailRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling UsersApi.ApiUsersResendEmailConfirmationPost: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ApiUsersResendEmailConfirmationPostWithHttpInfo variant

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

try
{
    // Resend email confirmation.
    ApiResponse<string> response = apiInstance.ApiUsersResendEmailConfirmationPostWithHttpInfo(emailRequest);
    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.ApiUsersResendEmailConfirmationPostWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
emailRequest EmailRequest [optional]

Return type

string

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json-patch+json, application/json, text/json, application/*+json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -

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

ApiUsersRevokeTokenPost

string ApiUsersRevokeTokenPost (RevokeTokenRequest revokeTokenRequest = null)

Revokes a refresh token.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ApiUsersRevokeTokenPostExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://smac-poc.mcs-group.com.my/";
            // Configure Bearer token for authorization: bearer
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new UsersApi(config);
            var revokeTokenRequest = new RevokeTokenRequest(); // RevokeTokenRequest |  (optional) 

            try
            {
                // Revokes a refresh token.
                string result = apiInstance.ApiUsersRevokeTokenPost(revokeTokenRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling UsersApi.ApiUsersRevokeTokenPost: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ApiUsersRevokeTokenPostWithHttpInfo variant

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

try
{
    // Revokes a refresh token.
    ApiResponse<string> response = apiInstance.ApiUsersRevokeTokenPostWithHttpInfo(revokeTokenRequest);
    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.ApiUsersRevokeTokenPostWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
revokeTokenRequest RevokeTokenRequest [optional]

Return type

string

Authorization

bearer

HTTP request headers

  • Content-Type: application/json-patch+json, application/json, text/json, application/*+json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
404 Not Found -

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

ApiUsersRolesPost

List<string> ApiUsersRolesPost ()

Gets the authenticated user's roles.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ApiUsersRolesPostExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://smac-poc.mcs-group.com.my/";
            // Configure Bearer token for authorization: bearer
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new UsersApi(config);

            try
            {
                // Gets the authenticated user's roles.
                List<string> result = apiInstance.ApiUsersRolesPost();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling UsersApi.ApiUsersRolesPost: " + e.Message);
                Debug.Print("Status Code: " + e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Using the ApiUsersRolesPostWithHttpInfo variant

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

try
{
    // Gets the authenticated user's roles.
    ApiResponse<List<string>> response = apiInstance.ApiUsersRolesPostWithHttpInfo();
    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.ApiUsersRolesPostWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

This endpoint does not need any parameter.

Return type

List

Authorization

bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -

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

ApiUsersUploadProfilePhotoPost

UploadPhotoResponse ApiUsersUploadProfilePhotoPost (UploadPhotoRequest uploadPhotoRequest = null)

Uploads current user profile photo.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ApiUsersUploadProfilePhotoPostExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://smac-poc.mcs-group.com.my/";
            // Configure Bearer token for authorization: bearer
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new UsersApi(config);
            var uploadPhotoRequest = new UploadPhotoRequest(); // UploadPhotoRequest | The request parameters (optional) 

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

Using the ApiUsersUploadProfilePhotoPostWithHttpInfo variant

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

try
{
    // Uploads current user profile photo.
    ApiResponse<UploadPhotoResponse> response = apiInstance.ApiUsersUploadProfilePhotoPostWithHttpInfo(uploadPhotoRequest);
    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.ApiUsersUploadProfilePhotoPostWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

Name Type Description Notes
uploadPhotoRequest UploadPhotoRequest The request parameters [optional]

Return type

UploadPhotoResponse

Authorization

bearer

HTTP request headers

  • Content-Type: application/json-patch+json, application/json, text/json, application/*+json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
403 Forbidden -

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

ApiUsersUserProfilePost

UserProfileResponse ApiUsersUserProfilePost ()

Gets the current user profile.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class ApiUsersUserProfilePostExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://smac-poc.mcs-group.com.my/";
            // Configure Bearer token for authorization: bearer
            config.AccessToken = "YOUR_BEARER_TOKEN";

            var apiInstance = new UsersApi(config);

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

Using the ApiUsersUserProfilePostWithHttpInfo variant

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

try
{
    // Gets the current user profile.
    ApiResponse<UserProfileResponse> response = apiInstance.ApiUsersUserProfilePostWithHttpInfo();
    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.ApiUsersUserProfilePostWithHttpInfo: " + e.Message);
    Debug.Print("Status Code: " + e.ErrorCode);
    Debug.Print(e.StackTrace);
}

Parameters

This endpoint does not need any parameter.

Return type

UserProfileResponse

Authorization

bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
401 Unauthorized -

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