Call Us: 992 9441 754

WHM API: Find cPanel User by Domain Made Easy

< All Topics

WHM API: Find cPanel User by Domain Made Easy

To find the cPanel user associated with a specific domain using the WHM API, you can use the whmapi1 command-line tool or make an API call to the accountsummary endpoint. This endpoint returns information about an account, including the associated user, based on a domain name.

Using whmapi1 Command-Line Tool

  1. Access Your Server:
    Connect to your server via SSH.
  1. Run the whmapi1 Command:
    Use the whmapi1 command to query the account information by domain.

Replace example.com with the domain name you are querying.

  1. Output:
    The output will include information about the account, including the username associated with the specified domain.

Using the WHM API Programmatically

You can also make an API call programmatically using cURL or any programming language that supports HTTP requests.

Using cURL

  1. Construct the cURL Request:
    Make sure you have your WHM root access hash or API token. Replace YOUR_API_TOKEN with your actual token and example.com with the domain name.
  1. Output:
    The response will be in JSON format and will include the username associated with the specified domain.

Using a Programming Language (Python Example)

Here’s an example of how you can use Python to make the API call:

  1. Install Required Library:
    Ensure you have the requests library installed.
  1. Python Script:

WHM API Documentation

Refer to the official WHM API documentation for more details and additional parameters you can use with the accountsummary endpoint: WHM API 1 – accountsummary

Summary

  • Using whmapi1 command: Quick and direct method via SSH.
  • Using cURL: Simple and effective for scripting.
  • Using Python: Flexible and can be integrated into larger applications.

By following these steps, you can easily find the cPanel user associated with a specific domain using the WHM API.

Categories

Recent Comments

No comments to show.