Jump to content

How to read and change server extra config options


Xan

Recommended Posts

Hi,

I have been spending quite a few hours trying to figure out how to read the current values of a server's extra config options (the ones you manage at /admin/configproductoptions.php).

I have been able to read the possible config options themselves through both the undocumented eloquent models aswell as through the GetProducts internal API.. but both methods only give me the possible options themselves and not the current value of the options for the server. This information does not seem to be part of the array returned by the GetProducts API call.

So tl;dr: How can I read the current value of the config options for a given server.. and what is the proper way to update these values.  For the latter I have found the following documentation: "https://developers.whmcs.com/api-reference/updateclientproduct/" but I am hoping for a better option then setting a base64 serialized array. But if this is the only way it'll have to do..

Thanks in advance for anyone that can give me any information :)

 

Link to comment
Share on other sites

I managed to read the current server product option settings by using the GetClientsProducts API endpoint. But I am still stuck trying to update one of the values:

I am trying something like:

$results = localApi('UpdateClientProduct', [
   'serviceid' => $service->id,
   'configoptions' => base64_encode(serialize([
        [$optionId => $value]
   ]))
]);

And although the API returns 'success' (which it always seems to do, no matter what information I post) the option does not get updated.
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated