# Basic Authentication

This API endpoint allows users to manage basic authentication for a specified application on a server. It includes retrieving, creating, and disabling basic authentication.

# Get

# HTTP Request:

GET https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/basic-authentication

# Example Request

# cURL Request Example

curl --request GET \
  --url "https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/basic-authentication" \
  --header 'Authorization: Bearer <Your API Token>'

# Success Response

  • 200 (OK)
{
    "basicAuth": {
        "id": 1,
        "server_id": 27,
        "application_id": 54,
        "username": "test1234",
        "password": "test1234",
        "enabled": false,
        "created_at": "2024-10-07 15:08:54",
        "updated_at": "2024-10-07 15:20:51"
    }
}

# Error Responses

# Organization Not Found

  • 404 (Not Found)
{
    "message": "Organization not found!"
}

# Application Not found

  • 404 (Not Found)
{
    "message": "Application not found!"
}

# Server Not Found

  • 404 (Not Found)
{
    "message": "Server not found!"
}

# Server Error

  • 500 (Internal Server Error)
{
  "message": "Something went wrong!"
}

# Create

# HTTP Request:

POST https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/basic-authentication

# Request Body

Parameter Required Type Description
username Yes String The username for basic authentication.
password Yes String The password for basic authentication.

# Example Request

# cURL Request Example

curl --request POST \
  --url "https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/basic-authentication" \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer <Your API Token>' \
  --data '{
    "username": "your_username",
    "password": "your_password"
  }'

# Success Response

  • 200 (OK)
{
    "message": "Basic authentication created successfully!",
    "basicAuthentication": {
        "id": 1,
        "server_id": 27,
        "application_id": 54,
        "username": "test1234",
        "password": "test1234",
        "enabled": true,
        "created_at": "2024-10-07 15:08:54",
        "updated_at": "2024-10-08 15:50:59"
    }
}

# Error Responses

# Organization Not Found

  • 404 (Not Found)
{
    "message": "Organization not found!"
}

# Application Not found

  • 404 (Not Found)
{
    "message": "Application not found!"
}

# Server Not Found

  • 404 (Not Found)
{
    "message": "Server not found!"
}

# Server Error

  • 500 (Internal Server Error)
{
  "message": "Something went wrong!"
}

# Disable

# HTTP Request:

PATCH https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/basic-authentication/{basic_authentication}

# Example Request

# cURL Request Example

curl --request PATCH \
  --url "https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/basic-authentication/{basic_authentication}" \
  --header 'Authorization: Bearer <Your API Token>'

# Success Response

  • 200 (OK)
{
  "message": "Basic authentication disabled successfully!"
}

# Error Responses

# Organization Not Found

  • 404 (Not Found)
{
    "message": "Organization not found!"
}

# Application Not found

  • 404 (Not Found)
{
    "message": "Application not found!"
}

# Server Not Found

  • 404 (Not Found)
{
    "message": "Server not found!"
}

# Server Error

  • 500 (Internal Server Error)
{
  "message": "Something went wrong!"
}
Last Updated: 10/8/2024, 11:07:58 AM