API - client_update for reseller?

Discussion in 'Developers' Forum' started by pyte, Jul 13, 2022.

  1. pyte

    pyte Well-Known Member HowtoForge Supporter

    Hi,
    i currently use a script to update my client data within ISPConfig via API client_update function. It works as expected. But i want to update the data of the reseller too which gives me the error:
    Which makes sense as i call the function with the following:
    Code:
    $GLOBALS['client']->client_update($GLOBALS['session_id'], $id['client_id'], $reseller_id, $id);
    • client_id -> 1
    • reseller_id -> 1
    • $id -> fields that get changed
    Is there a way to update the records of a reseller? How do i make this work?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Using client_update function is fine, you just pass a wrong value to it and that's why you get that error. A reseller can only be owned by the admin and not by another client or by another reseller or by itself. This means reseller_id must be 0 when you add or update a reseller with the client_update function
     
    pyte likes this.
  3. pyte

    pyte Well-Known Member HowtoForge Supporter

    Thats what i thought, but was afraid of messing something up. Thank you :)
     

Share This Page