Manage ftp accounts with UAPI
Hello!
I need some assistance with managing ftp accounts thru UAPI.
Some context:
I have a webshop running on a hosting platform. The hosting service provides cPanel to manage everything, so i want to use it to set up the ftp accounts. And I have an application running locally at a computer, written in javascript, (on nodejs). This application is used to manage everything for the webshop from uploading items to processing orders. Now in some cases I have to share some raw files with the customers, but just for a set time period. So the idea is that i want to create an ftp account (with the already existing login and password in the other systems) and then upload a zip file with the files I share with them, so they can download it. For managing the storage space at the hosting, after a few weeks I want to be able to delete the selected accounts and the files.(as they wont need them anymore) I want to do all this automatically when the command is given for the selected accounts from the local javascript application.
So I need some way to access the cPanel provided by my hosting service and create/delete ftp accounts thru API. I would very much would like to use http request with basic auth. So after reading the cPanel API documentations I think I need to use the UAPI somehow but i cant get it to work. From the auth methods listed i can only use basic auth. as I dont want to be redirected to cpanel login sites or create temporary tokens, I just want my script to login to the cpanel api and make a call whenever I need it based on a username/login data saved in my applications settings.
I tried out several ways but none of them seem to work.
I think the closes to the solution is the following:
the url markup: list_ftp function like:
npm-request
And I want the use the cPanel UAPI as its in active state and has all the functions I need.
Any help appreciated!
Thanks Sampite
Please sign in to leave a comment.
Comments
0 comments