LogManager cPanel API call not working
I'm calling the LogManager::savesettings function through the WHM API.
I'm using http headers to authenticate which is working, but not with the correct results.
The url I'm using to make the call is
In the Raw Access Logs section of cpanel, this should turn the Archive logs settings on and remove archives setting off, but no matter how I set the variables in the URL it always turns both setting off. I know authentication works, because the call is made. I know it identifies the correct cpanel account, API module and API function because changes are made to the right cpanel account in the Raw Access logs settings. They are just the wrong settings based on the parameters I have in my the API URL. Is there something wrong with these parameters in my url? &archive=1&remarchive=0 I know they are supposed to be url encoded but as they contain no special characters, it should not matter.
example.com:2087/json-api/cpanel?api.version=1&cpanel_jsonapi_user=cpanel_username&cpanel_jsonapi_module=LogManager&cpanel_jsonapi_func=savesettings&cpanel_jsonapi_apiversion=1&archive=1&remarchive=0
In the Raw Access Logs section of cpanel, this should turn the Archive logs settings on and remove archives setting off, but no matter how I set the variables in the URL it always turns both setting off. I know authentication works, because the call is made. I know it identifies the correct cpanel account, API module and API function because changes are made to the right cpanel account in the Raw Access logs settings. They are just the wrong settings based on the parameters I have in my the API URL. Is there something wrong with these parameters in my url? &archive=1&remarchive=0 I know they are supposed to be url encoded but as they contain no special characters, it should not matter.
-
Hello, I'm able to utilize the command line option to successfully save the values. EX: cpapi1 --user=user123 LogManager savesettings 1 1
However, as you mentioned, it's not working properly when testing with the browser-based call. Could you open a support ticket using the link in my signature so we can take a closer look and involve one of our integration developers if necessary? Thank you.0 -
Thanks for the confirmation that the browser based call is not working and it's not an issue with my server or the URL I was using to make the call. I have submitted a support ticket and am anxiously awaiting for the cpanel bug to be fixed. 0 -
Just to followup. Support has advised me that although the cPanel documentation says you can make cPanel API 1 browser based calls through WHM as shown here Use WHM API to Call cPanel API and UAPI - Software Development Kit - cPanel Documentation, it is actually not supported, so the documentation is incorrect. This has been submitted as case CPANEL-10565, to request an equivalent call be added to the UAPI as no equivalent call currently exists for the cPanel API 2 or UAPI. 0
Please sign in to leave a comment.
Comments
3 comments