swilders Posted August 26, 2013 Share Posted August 26, 2013 Hello, I don't think the getquotes part of the API is working correctly. If I request quotes for a client that has multiple quotes in WHMCS then the WHMCSAPI:QUOTES:QUOTE:ITEMS section of the returned data appends an increment to the end of the array keys, and also skips a number in between. So, for example, on the first quote I will get: WHMCSAPI:QUOTES:QUOTE:ITEMS:ITEM WHMCSAPI:QUOTES:QUOTE:ITEMS:ITEM1 WHMCSAPI:QUOTES:QUOTE:ITEMS:ITEM2 WHMCSAPI:QUOTES:QUOTE:ITEMS:ITEM3 WHMCSAPI:QUOTES:QUOTE:ITEMS:ITEM4 and then the next quote is returned as: WHMCSAPI:QUOTES:QUOTE:ITEMS6:ITEM7 WHMCSAPI:QUOTES:QUOTE:ITEMS6:ITEM8 WHMCSAPI:QUOTES:QUOTE:ITEMS6:ITEM9 WHMCSAPI:QUOTES:QUOTE:ITEMS6:ITEM10 etc This make it very difficult for me to iterate through the returned items. I can get around the issue because the pattern is at least predictable if I count the items and add 1 between quotes, but that's hardly ideal - is this intentional or an error? 0 Quote Link to comment Share on other sites More sharing options...
swilders Posted August 26, 2013 Author Share Posted August 26, 2013 Furthermore, the WHMCSAPI:TOTALRESULTS returns 0 even when there are results. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted August 26, 2013 Share Posted August 26, 2013 Are you sure that it's so buggy? Have you already tried to unset(); elements in the end of the loop? Maybe it's you are overwriting them during the iteration. 0 Quote Link to comment Share on other sites More sharing options...
swilders Posted August 26, 2013 Author Share Posted August 26, 2013 Hello, I can assure you my code is sound, feel free to try for yourself using my steps to reproduce the issue. The example I have given is simply quoting a print_r of the returned array. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.