api customer number

Discussion in 'General' started by nhybgtvfr, Apr 16, 2024.

  1. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    Hi..
    this is probably very simple for you php developers.. but i'm not one of those... i can usually just about (and very slowly) work out what most php code is generally trying to do...

    how do i get the current customer number count via the api?
    basically. if i want to add a new client via the api, i need to specify the customer_no, but i need to know what the current count is to set that..

    the code i'm trying to modify currently doesn't bother checking anything, and sets the customer_no as null (blank).
    a client created via the gui correctly applies the customer number template... so i want to achieve that same effect using the api.


    also, in the remoting_client/examples folder, there's only around 209 actual examples.. but running get_functions_list returns 312 api functions... how do i find out how to use any of the undocumented functions?
     

    Attached Files:

  2. pyte

    pyte Well-Known Member HowtoForge Supporter

    Use the source Luke :) I'm afraid but if there is no docs for the function you have to read the php code of the api itself, but most of the stuff works the same anyways.

    Regarding the customer_no question. As this field is optional and not required and your screenshot shows empty entries what are you trying to do? If you just want to set a number based on the count you can gather all customers via api, count them and then set the customer_no equal to counter +1
     
    ahrasis and Th0m like this.
  3. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    ok.. i did see when getting the function list there were api functions like config_value_get and config_value_replace...
    i was hoping that might give a way to directly query the customer_no template or counter..


    hmm.. thinking about it. if there were resellers... they'd have their own customer_no template and count for their own clients...
    i probably need to give this a bit more thought... :(
     
  4. pyte

    pyte Well-Known Member HowtoForge Supporter

    I have a setup with a few hunderts of customers. I just use the customer number that these customers already have in our CRM system for convenience. I don't know if you only manage these customers with ISPConfig or if you have some sort of CRM system too. Just some food for thought i guess
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    It's indeed not that good that the APi is unable to set the customer number automatically. But the only real solution is that we implement a function for this in the client add function of the API I guess.
     
    ahrasis likes this.

Share This Page