MDM

Existing User

Function: existing_user
Type: API Endpoint (GET)

Purpose:
This function retrieves existing user details, menu access, and table access for a given user based on the provided headers. It decodes the Customer_Key to identify the customer and database, fetches user-related information, and constructs a structured response.

URL:
GET /api/mdm/existing_user

Headers:

  • Aad-Id (str, required): A base64-encoded string representing the AAD ID of the user.
  • Customer-Key (str, required): A base64-encoded string containing information to identify the customer and database.
  • User-Code (str, required): A base64-encoded string representing the user code.
  • App-Code (str, required): A base64-encoded string representing the application code.

Response Model:
Returns an ExistingUser instance containing the user details, menu access, and table access information.

Response Example:

{
    "user": {
        "first_name": "<first_name>",
        "last_name": "<last_name>",
        "email": "<email>",
        "mobile": "<mobile>",
        "user_group_code": "<user_group_code>",
        "user_role": "<user_role>",
        "active": <active>
    },
    "menu_access": [
        {
            "parent": {
                "menu_code": "<menu_code>",
                "menu_name": "<menu_name>",
                "access": <access>
            },
            "children": [
                {
                    "menu_code": "<menu_code>",
                    "menu_name": "<menu_name>",
                    "access": <access>
                }
            ]
        }
    ],
    "table_access": [
        {
            "table_name": "<table_name>",
            "access": <access>,
            "upload_download_access": <upload_download_access>
        }
    ]
}

Error Handling:

  • Returns HTTP 400 if Customer_Key is invalid.
  • Returns HTTP 404 if the user is not found.
  • Returns HTTP 500 for any unexpected server errors.

Steps:

  1. Decode the Customer_Key header and validate its format.
  2. Extract and decode the userCode and appCode.
  3. Fetch user details, group details, menu access, and table access from the database.
  4. Construct and return the structured response.
  5. Log the API call with a unique log identifier for tracking.
get/api/mdm/existing_user

Headers

Customer-Keystring required
User-Codestring required
App-Codestring required

Response

Successful Response

Changes

No recorded changes to this endpoint across all 1 revision of this API.