Kian Posted January 11, 2014 Share Posted January 11, 2014 Hi I'm developing an API platform to give access to WHMCS API to Reseller so that for example i can let one of my client to register domains from his Wordpress using the credit balance he has on WHMCS. Of course he will be able to use only certain commands (not as "root-user") and that only have effects on his own services, domains and contacts. Ok now back on topic it seems that some API functions like getclients don't work in NVP mode. NVP returns empty errors even if everything works fine in XML and JSON. I can show you the evidence: Full details Link: https://dev.revhosting.org/api/generator/ Set "whmcs" as Connector, tick the checkbox "Login credentials (use default)", "XML" as Response Type, leave Debug "Yes" then select "ClientManagement" as Category and "GetClients" as Command. Now click Submit. As you can see it works. Now try to change Response Type to "JSON" and Submit again. It works (even if the response is a bit buggy now ). Finally select "NVP" and you get The following error occured: Quick check Link: https://dev.revhosting.org/api/alfa.php I made this page to let you verify quickly XML, JSON and NVP responses. NVP doesn't want to work because of The following error occured: What error!? 0 Quote Link to comment Share on other sites More sharing options...
Aniruddh Posted January 13, 2014 Share Posted January 13, 2014 (edited) From what I can see my own test, the NVP data returning from server is not valid. Hence, the PHP is just executing codes from the 'else' statement: if ($results["result"]=="success") { echo "Success!!"; } else { echo "The following error occured: ".$results["message"]; // Here $results["message"] is empty } Edited January 13, 2014 by Aniruddh 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted January 13, 2014 WHMCS CEO Share Posted January 13, 2014 Some API functions - those which have multi-level returns, are only available in the XML and JSON response formats. Take the GetClients API command for example - as noted in the docs @ http://docs.whmcs.com/API:Get_Clients - that API function only supports the JSON and XML response formats so NVP is not supported for it and will be the cause of the error you're seeing. The docs should always state if this is the case for a given function. matt 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted January 13, 2014 Author Share Posted January 13, 2014 Hi Matt I don't understand if it's valid for external API, internal API or both. Can you please clarify this for me? Can i localAPI("getclients",$values,$adminuser);? 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.