I'm a new user trying to set up an API integration with DirectAdmin, and I'm encountering some difficulties, despite following the official documentation.
My goal is to create an admin-level API connection that allows me to perform various management tasks, such as creating email accounts, FTP accounts, and other user-specific resources. Crucially, I need to be able to do this on behalf of other users (i.e., for users under my admin account).
I am specifically trying to achieve this using Login Keys (API keys) rather than my main DirectAdmin account password, as this is recommended for security. I followed the steps to create a login key in the DirectAdmin GUI and set its permissions.
When I attempt to make an API call (e.g., to CMD_API_SHOW_USERS), I repeatedly receive an "Unauthorized" or "Not logged in" error. I've double-checked the API key value, the username, and especially the "Allowed IP addresses" setting for the login key to ensure it matches the IP from which I'm making the API calls.
I assumed that setting up an admin API connection with login keys to manage users would be a relatively straightforward process, but I'm struggling to get it to work.
Could someone please clarify if what I'm trying to achieve (admin API access for user management using login keys, including acting on behalf of other users) is indeed possible and straightforward? If so, could you point me towards common pitfalls or provide specific guidance on how to properly configure the login key and structure the API calls for this purpose?
Any help or insights would be greatly appreciated.
Thank you in advance!
My goal is to create an admin-level API connection that allows me to perform various management tasks, such as creating email accounts, FTP accounts, and other user-specific resources. Crucially, I need to be able to do this on behalf of other users (i.e., for users under my admin account).
I am specifically trying to achieve this using Login Keys (API keys) rather than my main DirectAdmin account password, as this is recommended for security. I followed the steps to create a login key in the DirectAdmin GUI and set its permissions.
When I attempt to make an API call (e.g., to CMD_API_SHOW_USERS), I repeatedly receive an "Unauthorized" or "Not logged in" error. I've double-checked the API key value, the username, and especially the "Allowed IP addresses" setting for the login key to ensure it matches the IP from which I'm making the API calls.
I assumed that setting up an admin API connection with login keys to manage users would be a relatively straightforward process, but I'm struggling to get it to work.
Could someone please clarify if what I'm trying to achieve (admin API access for user management using login keys, including acting on behalf of other users) is indeed possible and straightforward? If so, could you point me towards common pitfalls or provide specific guidance on how to properly configure the login key and structure the API calls for this purpose?
Any help or insights would be greatly appreciated.
Thank you in advance!