UAPI accesses the cPanel interface's features. Use this API to access and modify cPanel account data and settings.
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/
https://{host}:{port}/execute/
Request
This function saves a file in a directory and encodes it in a character set.
Important:
When you disable the File Storage role, the system disables this function.
The new file's contents. If you do not use this parameter, the function creates a blank file.
The directory that contains the selected file.
Note:
This parameter defaults to the currently-authenticated user's /home directory.
Whether the function will return an error or save in the default character set if it cannot save in the specified character set.
1— Save in the default character set.0— Return an error.
The character set encoding of the content parameter's value.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Fileman/save_file_content
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Fileman/save_file_content
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Fileman/save_file_content?file=example.html&content=hi&dir=%2Fhome%2Fusername%2Fpublic_html&fallback=0&from_charset=UTF-8&to_charset=ASCII'{ "apiversion": 3, "func": "save_file_content", "module": "Fileman", "result": { "data": { … }, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }
Request
This function converts a buffer from one encoding language to another.
Important:
When you disable the File Storage role, the system disables this function.
Whether to discard any characters that do not transcode correctly.
1- Discard invalid characters.0- Transcode invalid characters in the default character set encoding.
Whether to transcode invalid characters to valid characters in the new character set encoding.
1- Transcode invalid characters in the new character set encoding.0- Return an error message.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Fileman/transcode
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Fileman/transcode
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
'https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Fileman/transcode?content=hi&discard_illegal=1&from_charset=UTF-8&to_charset=ASCII&transliterate=0'{ "apiversion": 3, "func": "transcode", "module": "Fileman", "result": { "data": { … }, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }
Request
This function uploads files.
Note:
For more information about how to use this function in your custom code, read our Use UAPI's Fileman::upload_files Function in Custom Code tutorial.
Important:
When you disable the File Storage role, the system disables this function.
You cannot call this function through WHM API 1's uapi_cpanel function.
- Mock server
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Fileman/upload_files
- A server running cPanel.
https://cpanel-server.tld:2083/execute/Fileman/upload_files
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X GET \
-u <username>:<password> \
https://api.docs.cpanel.net/_mock/specifications/cpanel.openapi/Fileman/upload_files{ "apiversion": 3, "func": "upload_files", "module": "Fileman", "result": { "data": { … }, "errors": null, "messages": null, "metadata": {}, "status": 1, "warnings": null } }