Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

LogManager cPanel API call not working

Discussion in 'cPanel Developers' started by Bogarto, Dec 21, 2016.

Tags:
  1. Bogarto

    Bogarto Registered

    Joined:
    Dec 21, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Merica
    cPanel Access Level:
    Root Administrator
    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
    Code:
    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.
     
    #1 Bogarto, Dec 21, 2016
    Last edited by a moderator: Dec 21, 2016
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,419
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm able to utilize the command line option to successfully save the values. EX:

    Code:
    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.
     
  3. Bogarto

    Bogarto Registered

    Joined:
    Dec 21, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Merica
    cPanel Access Level:
    Root Administrator
    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.
     
  4. Bogarto

    Bogarto Registered

    Joined:
    Dec 21, 2016
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Merica
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page