{"id":421,"date":"2012-02-22T06:53:41","date_gmt":"2012-02-22T11:53:41","guid":{"rendered":"http:\/\/blogs.wp.stage.cpanel.net\/?p=421"},"modified":"2012-02-22T06:53:41","modified_gmt":"2012-02-22T11:53:41","slug":"test-it-in-the-user-interface","status":"publish","type":"post","link":"https:\/\/devel.www.cpanel.net\/blog\/products\/test-it-in-the-user-interface\/","title":{"rendered":"Test it in the User Interface"},"content":{"rendered":"
After spending time in the Developer section of the cPanel Community Forums, we’ve found a commonly asked question: “Why won’t my script work with XYZ function using the XML\/JSON-API?”<\/p>\n
Rewinding a bit, the purpose of the XML\/JSON API is to allow usage of cPanel & WHM functions through applications or scripts. Naturally, the first question we often ask, when trying to figure out why a script isn’t working, is if the user is trying to do something that they couldn’t normally do through cPanel & WHM.<\/p>\n
For example, let’s say you’re trying to park a domain on top of an existing domain. Parking a domain is like adding an additional domain name for the same content in your hosting account. Given this option is allowed by your hosting provider, the first thing to do would be to attempt to add the parked domain through cPanel. Running through the process of parking the domain through cPanel will give you, the user, a good sense of what’s actually happening when parking a domain.<\/p>\n
After testing through the interface and finding out more about the function, the next step would be to consult our documentation at sdk.cPanel.net to find more about the module name and function. Following the parking a domain example, we find in the documentation<\/a> that the name of the module is “Park”, with function “park”. (On a side note, there are also other functions available within the Park module, including “unpark”, “listparkeddomains”, and “listaddondomains”.)<\/p>\n In this case, we’re only interested in using the “domain” parameter, since we’re wanting to park the new domain on the primary domain for the account. If the user wanted to park a domain onto a subdomain in the account, the user would also use the parameter, “topdomain”. This parameter would contain the name of the subdomain to attach the new parked domain to. Often, the error in the script has to do with incorrect parameters, or the order of parameters (for API1 functions) within the array.<\/p>\n So after testing the function through cPanel, then making sure you have the correct parameters passed in through the XML\/JSON-API, you should be well on your way to troubleshooting your script.<\/p>\n","protected":false},"excerpt":{"rendered":" After spending time in the Developer section of the cPanel Community Forums, we’ve found a commonly asked question: “Why won’t my script work with XYZ function using the XML\/JSON-API?” Rewinding a bit, the purpose of the XML\/JSON API is to allow usage of cPanel & WHM functions through applications or scripts. Naturally, the first question […]<\/p>\n","protected":false},"author":77,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[49],"tags":[],"class_list":["post-421","post","type-post","status-publish","format-standard","hentry","category-products"],"acf":[],"yoast_head":"\n