<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
    <channel>
        <title>Web-Site-Scripts.com - XML-RPC API</title>
        <link>https://www.web-site-scripts.com/knowledge-base/category/84</link>
        <description><![CDATA[Root / KnowledgeBase Manager Pro / Integration & Customization / XML-RPC API]]></description>
        <language>en-us</language>
        <generator>KnowlageBase RSS Generator</generator>

         
                <item>
                        <title>Adding Active Response suggestions to a form on your website</title>
                                    <link>https://www.web-site-scripts.com/knowledge-base/article/AA-00703</link>
                                    <description><![CDATA[<p>
</p>
<p>This guide explains how to add Active Response feature to a form on your website. Active Response helps you to provide an always available self-service to your customers, allowing them to find the answers to their questions immediately instead of submitting them to your support or sales department and waiting for the answer. While user types text in the form with Active Response feature, he sees suggested articles from the knowledgebase below. Active response system analyzes user input and finds the most accurate answers to his question from the knowledge base.</p><p></p><ul><li><a href="#enable" target="">Enable API in KMP</a></li><li><a href="#upload" target="">Upload files to the server</a></li><li><a href="#url" target="">Adjust the URL and the token</a></li><li><a href="#ref" target="">Copy CSS and JavaScript references</a></li><li><a href="#fields" target="">Adjust the form fields</a></li></ul><p></p>
<p></p><h3><a name="enable" ></a>Enable API in KMP</h3><p></p>
<p>Go to Administration &gt; General Settings &gt; API Server page and tick the checkbox against "Enable API Server". Then click "Save".</p>
<p><img src="http://www.web-site-scripts.com/knowledge-base/admin/media_store/2/AA-00703/api-url.png" style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; " title="" alt="" border="0"><br></p>
<p>Notice the Server Link here, you'll need it later.</p>
<h3><a name="upload" ></a>Upload files to the server</h3>
<p>Download the&nbsp;<span style="background-color: rgb(255, 255, 255); text-align: left; ">active-response.zip file <a href="#below" target="">below on this page</a>. Unzip it and c</span>opy its contents to a directory on the website (this may any directory and it doesn't have to be on the same site as KMP). You'll be launching your API script from that directory.</p>
<h3><a name="url" ></a>Adjust the URL and the token</h3>
<p>Adjust the URL to KMP API server and the token in the config.php file:</p>
<p></p>
<div class="preformatted">
<div class="preformattedContent"><div class="preformattedContent">define('CLIENT_TOKEN', '<span style="background-color: rgb(255, 255, 0);">198fcc74ce556625d1b09a36cd8325b7</span>');</div><div class="preformattedContent">define('URL_TO_KMP_RPC_SERVER', '<span style="background-color: rgb(255, 255, 0);">http://www.yourwebsite.com/kb/api.php</span>');</div></div>
</div>
<p>To get a token, you need to create a Staff user (Users &amp; Groups &gt; Staff &gt; Add Staff User) and assign him to a group. Then re-open the user edit window. You can copy the token from it.</p>
<p><img src="http://www.web-site-scripts.com/knowledge-base/admin/media_store/2/AA-00703/token.png" style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; " title="" alt="" border="0"><br></p>
<p>Please note that the token is being used for authentication, so if you're using the token of a certain user account, it means that each article that the user can see may be shown to public via the form with Active Response. We would recommend to create a user with special access permissions, and use his token here to avoid exposure of restricted information. Alternatively you can enable the "Allow Anonymous Access" option at the API settings page (Administration &gt; General Settings &gt; API Server).</p>
<p>You can get the URL to the API server from the Administration &gt; General Settings &gt; API Server page.</p>
<h3><a name="ref" ></a>Copy CSS and JavaScript references</h3>
<p>Adjust the URLs as mentioned below and copy-paste this code to the &lt;head&gt;&lt;/head&gt; section of the page were you want to have the Active Response feature.</p>
<p></p>
<div class="preformatted">
<div class="preformattedContent"><div class="preformattedContent">&lt;link rel="stylesheet" type="text/css" href="css/styles.css" /&gt;</div><div class="preformattedContent">&lt;link rel="stylesheet" type="text/css" href="css/search.css" /&gt;</div><div class="preformattedContent">&lt;link rel="stylesheet" type="text/css" href="css/ask_question.css" /&gt;</div><div class="preformattedContent">&lt;script type="text/javascript"&gt;</div><div class="preformattedContent">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; base_url = '<span style="background-color: rgb(255, 255, 0);">http://www.web-site-scripts.com/knowledge-base/</span>';</div><div class="preformattedContent">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; emptyImageUrl = '<span style="background-color: rgb(255, 255, 0);">http://demo/active-response/</span>images/s.gif';</div><div class="preformattedContent">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; base_href = '<span style="background-color: rgb(255, 255, 0);">http://demo/active-response/</span>';</div><div class="preformattedContent">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; i18n = { 'lbl_article': 'Article', 'lbl_attachment_in': 'Attachment to', 'lbl_category': 'Category', 'lbl_do_these_answers_help': 'Do These Answers Help?', 'lbl_found_some_answers': 'We\'ve found some answers in our knowledge base that might be helpful to you:', 'lbl_cancel': 'Cancel', 'lbl_desc': 'Description', 'lbl_save': 'Save', 'lbl_term': 'Term', 'msg_error_yellow': 'Please complete the required fields below highlighted in red.', 'msg_exist_term': 'You already have this term.', 'msg_title_add_term': 'Add Term' };</div><div class="preformattedContent">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rtl='';</div><div class="preformattedContent">&lt;/script&gt;</div><div class="preformattedContent">&lt;script type="text/javascript" src="js/lite-build.js" &gt;&lt;/script&gt;</div><div class="preformattedContent">&lt;script type="text/javascript" src="jsa/gateway_ask_question.js" &gt;&lt;/script&gt;</div></div>
</div>
<p>where:</p>
<p></p>
<p><b>http://www.web-site-scripts.com/knowledge-base/</b> - needs to be replaced with the URL to your KMP main front-end page</p>
<p><b>http://demo/active-response/</b> - needs to be replaced with with the URL to the folder with the aforementioned API files.</p>
<h3><a name="fields" ></a>Adjust the form fields</h3>
<p>Edit the form which you're going to plug Active Response feature to, and add some IDs to it.</p>
<p>Wrap it with:</p>
<p></p>
<div class="preformatted">
<div class="preformattedContent">
<p>
&lt;div id="ask-question-case"&gt;</p>
<p>Here goes your form.</p>
<p>&lt;/div&gt;</p>
</div>
</div>
<p>Add id="askSubject" to the Subject field of the form (optional - only if you wish that field to be searchable):</p>
<p></p>
<p></p>
<div class="preformatted"><div class="preformattedContent">&lt;input type="text" name="subject" value="" <span style="background-color: rgb(255, 255, 0);">id="askSubject"</span>&gt;</div></div>
<p></p>
<p>Add id="ask-question" to the text area for user question:</p>
<p></p>
<div class="preformatted"><div class="preformattedContent">&lt;textarea <span style="background-color: rgb(255, 255, 0);">id="ask-question"</span> name="question" cols="" rows=""&gt;&lt;/textarea&gt;</div></div>
<p></p>
<p>Add image that will show loading animation to a desired place on the form page:</p>
<p></p>
<div class="preformatted"><div class="preformattedContent">&lt;img alt="" style="padding-left: 5px; display: none;" src="images/loadingme.gif" id="ask-loader"&gt;</div>
</div>
<p>Add this div to the place where you want to show articles suggested by Active Response:</p>
<p></p>
<p></p>
<div class="preformatted">
<div class="preformattedContent">
&lt;div <span style="background-color: rgb(255, 255, 0);">id="ask-proposes"</span>&gt;&lt;/div&gt;</div>
</div>
<p>That's it! Now you can open the form in your browser and try typing something that can be found in your knowledge base. You'll see the Active Response in action.</p>
<p></p>
<p>If you would need any help in configurung Active Reponse, feel free to contact us.</p>
<p><a name="below" ></a><br></p>
<p></p>
]]></description>
                                    <pubDate>Mon, 23 Jan 2012 13:42:05 +0000</pubDate>
                                    <guid>https://www.web-site-scripts.com/knowledge-base/article/AA-00703</guid>
                    </item>
                <item>
                        <title>XML-RPC API</title>
                                    <link>https://www.web-site-scripts.com/knowledge-base/article/AA-00508</link>
                                    <description><![CDATA[<p></p>
<ul><li><span style="line-height: 16px; "><a href="#intro" target="">Introduction</a></span></li><li><span style="line-height: 16px; "><a href="#requests" target="">Possible Requests</a></span></li><li><span style="line-height: 16px; "><a href="#get-started" target="">Getting Started</a></span></li><li><span style="line-height: 16px; "><a href="#submitting-request" target="">Submitting a Request</a></span></li><li><span style="line-height: 16px; "><a href="#usage-examples" target="">API Usage Examples</a></span></li></ul>
<p></p>
<p>
</p>
<p></p>
<p></p>
<p></p>
<h1><a name="intro" ></a>Introduction</h1>
<p>The KMP XML API is a remotely accessible service API to allow KMP users to run many of the KMP API functions using XML requests.</p>
<p>The KMP XML API makes it possible to programmatically use your system without needing to physically access it. As XML is a general purpose markup language you can use it to communicate between other applications to KMP application base.</p>
<p>For example you could set your system up to get search results for a custom search phrase or use the Active Response feature remotely, and many other functions.</p>
<h1><a name="requests" ></a>Possible Requests</h1>
<p>This section will describe the different functions that can be used by the KMP XML API.</p>
<p></p>
<ul><li><span style="line-height: 16px; ">Get full set of article properties by its code (including article title, body, assignment, creation date, attachments, related articles, and much more – all properties are available via one simple call).</span></li><li><span style="line-height: 16px; ">Get comments by article id.</span></li><li><span style="line-height: 16px; ">Get list of articles (all articles from the knowledge base, or from any category – including subcategories or not – by your choice).</span></li><li><span style="line-height: 16px; ">Get list of the most popular featured articles (this and all coming article lists can be pulled from the whole knowledge base, or from a category– including subcategories or not – by your choice).</span></li><li><span style="line-height: 16px; ">Get list of the most discussed articles.</span></li><li><span style="line-height: 16px; ">Get list of the most popular articles.</span></li><li><span style="line-height: 16px; ">Get list of the recently created articles.</span></li><li><span style="line-height: 16px; ">Get list of the recently updated articles.</span></li><li><span style="line-height: 16px; ">Get list of the top rated articles.</span></li><li><span style="line-height: 16px; ">Get list of categories (all categories from the knowledge base, or from a given category).</span></li><li><span style="line-height: 16px; ">Get tree of categories (the whole tree or specified branch).</span></li><li><span style="line-height: 16px; ">Get list of glossary terms.</span></li><li><span style="line-height: 16px; ">Search attachments and articles by content and comments (the same search function, that is available in Knowledgebase Manager Pro, can be accessed via API; you can specify search method, and use any search fields you wish, including custom fields).</span></li><li><span style="line-height: 16px; ">Get list of searched categories.</span></li><li><span style="line-height: 16px; ">Get suggested articles for search query (the Active Response feature that provides quick answers to user question while he is typing it into the Ask Question form – now available via API).</span></li><li><span style="line-height: 16px; ">Get search suggestions for search query, search by article, category, and attachment titles (smart search suggest – exactly the same that you can see when you start typing a phrase into the search field in Knowledgebase Manager Pro – now available via API).</span></li><li><span style="line-height: 16px; ">Search glossary terms.</span></li><li><span style="line-height: 16px; ">Create a category.</span></li><li><span style="line-height: 16px; ">Create an article.</span></li><li><span style="line-height: 16px;">Create a user.</span></li><li><span style="line-height: 16px;">Activate a user.</span></li><li><span style="line-height: 16px;">Deactivate a user.</span></li><li><span style="line-height: 16px;">Delete a user.</span></li><li><span style="line-height: 16px; ">Get an array of the available API methods.</span></li><li><span style="line-height: 16px; ">Get the description for a specified API method.</span></li><li><span style="line-height: 16px; ">Get input and output format for a given API method.</span></li><li><span style="line-height: 16px; ">Combine multiple RPC calls in one request (API method that lets you combine several requests and gain a lot in performance).</span></li></ul>
<p></p>
<p>You can find&nbsp;description&nbsp;of the request and response for each method by opening the api.php page of your KMP installation:</p>
<p>http://location.of.the.knowledgebase/api.php</p>
<h1><a name="get-started" ></a>Getting Started</h1>
<p>The API server is disabled by default. To enable it, go to Administration &gt; General Settings &gt; API Server and turn on "Enable API Server" option.</p>
<p><img src="http://www.web-site-scripts.com/knowledge-base/admin/media_store/2/AA-00508/api-server-settings.png" alt="" title="" width="685" height="201" border="0" hspace="0" vspace="0" align="" style="margin-right: 0px; margin-left: 0px; margin-bottom: 0px; margin-top: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; "><br></p>
<p>You many want to enable the "Allow Anonymous Access" option. If it is enabled, you do not need to specify a token in each API request. Though, you would need to use a user token if you need to get to some restricted data.</p>
<p>The "Save Logs" option enables logging of all API requests. They are stored in Administration &gt; Logs for the specified amount of time. Logs will help you to monitor and troubleshoot your API requests.</p>
<p></p>
<h1 style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 16px; margin-left: 0px; font-size: 24px; font-weight: bold; line-height: normal; color: rgb(54, 96, 146); "><a name="submitting-request" ></a>Submitting a Request</h1>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 17px; margin-left: 0px; font-size: 12px; line-height: 1.4em; ">All XML POST request should be sent to:</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 17px; margin-left: 0px; font-size: 12px; line-height: 1.4em; ">http://location.of.the.knowledgebase/api.php</p>
<h1><a name="usage-examples" ></a>API Usage Examples</h1>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 17px; margin-left: 0px; font-size: 12px; line-height: 1.4em; ">You can download API usage examples <a href="#below" target="">below on this page</a>. We are using a native XML RPC library that is located in the /examples/api/lib/ directory. It encodes your API requests to XML-RPC format and decodes responses from XML-RPC.</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 17px; margin-left: 0px; font-size: 12px; line-height: 1.4em; ">To try an example you need to:</p>
<p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 17px; margin-left: 0px; font-size: 12px; line-height: 1.4em; "></p>
<ol><li>Upload the /examples/api/ folder to a web server with PHP support. This could be a remote server in relation to the server where KMP installed.</li><li>Turn on the API server.&nbsp;To do that, go to Administration &gt; General Settings &gt; API Server and turn on "Enable API Server" option.</li><li>Copy your token to a sample script like shown on the screenshots.<br><br><img src="http://www.web-site-scripts.com/knowledge-base/admin/media_store/2/AA-00508/token.png" alt="" title="" width="564" height="502" border="0" hspace="0" vspace="0" align="" style="margin-right: 0px; margin-left: 0px; margin-bottom: 0px; margin-top: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; "><br><br><img src="http://www.web-site-scripts.com/knowledge-base/admin/media_store/2/AA-00508/token-in-config.png" alt="" title="" width="742" height="280" border="0" hspace="0" vspace="0" align="" style="margin-right: 0px; margin-left: 0px; margin-bottom: 0px; margin-top: 0px; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; "><br><br><div class="info">
<div class="infoHeader">Config</div>
<div class="infoContent">
<p>
Please note that sample scripts located in the /examples/api/ folder include the config.php from the same folder and so use the same configuration.</p>
<p>On the contrary, each script from the /examples/api/simple-examples/ folder use its own config. To change a token, you need to edit the script file itself.</p>
</div></div></li><li>You may want to edit the parameters script sends to the API server, for example you may want to specify an article ID in the get.article.php, or search phrase in the search.Articles.php. Otherwise you may get a zero response or an error if object that you're requesting for (e.g. article) doesn't exist.</li><li>Call the sample script via your browser.</li></ol><div><a name="below" ></a><br></div>
<p></p>
<p></p>
<p>
</p>
]]></description>
                                    <pubDate>Thu, 25 Mar 2010 17:10:01 +0000</pubDate>
                                    <guid>https://www.web-site-scripts.com/knowledge-base/article/AA-00508</guid>
                    </item>
                <item>
                        <title>Installation API</title>
                                    <link>https://www.web-site-scripts.com/knowledge-base/article/AA-00464</link>
                                    <description><![CDATA[<p>KMP features an XML RPC based installation API that can be used by ISP companies, web hosting companies, and anyone who needs to automate the installation process to perform remote installations of KMP.&nbsp;This guide explains how to perform installations via the 
remote XML API.</p>
<p>The remote installation API helps with fast deployment of new KMP packages. It assumes that all package files are already extracted from the package and uploaded to the remote server, and all necessary file/folder permissions are set.</p>
<h1>Contents</h1>
<p></p>
<ul><li><span style="line-height: 16px;"><a href="#creating" target="">Creating the Request</a><br></span></li><ul><li><span style="line-height: 16px;"><a href="#xml-ref" target="">XML Reference</a><br></span></li><li><span style="line-height: 16px;"><a href="#sample-xml" target="">Sample XML Request</a></span></li><li><span style="line-height: 16px;"><a href="#sample-php" target="">Sample PHP Request (Using CURL)</a><br></span></li></ul><li><span style="line-height: 16px;"><a href="#install-success" target="">A Successful Installation Response</a><br></span></li><li><span style="line-height: 16px;"><a href="#install-error" target="">An Erroneous Installation Response</a><br></span></li><li><span style="line-height: 16px;"><a href="#error-codes" target="">Error Codes</a><br></span></li><li><span style="line-height: 16px;"><a href="#shell" target="">Installation by Shell Script</a></span></li></ul><div>
<span style="line-height: 19px;"></span></div>
<p></p>
<p></p>
<h1><a  name="creating"></a>Creating the Request</h1>
<p>Before launching remote installation of KMP copy, make sure that:</p>
<p></p>
<ul><li><span style="line-height: 16px;">All files are uploaded on the remote server.</span></li><li><span style="line-height: 16px;">Correct permissions are set.</span></li><li><span style="line-height: 16px;">Package is not installed yet.</span></li></ul><div>
<p>To submit an XML based API request to install Knowledgebase Manager Pro, you must send the details outlined below as the HTTP POST body in a properly formatted XML feed.</p>
</div>
<p></p>
<p>
</p>
<h2><a  name="xml-ref"></a>XML Reference</h2>
<p></p>
<ul><li><span style="line-height: 16px;">xml version -&nbsp;XML declaration which specifies the version of XML being used</span></li><li><span style="line-height: 16px;">methodCall -&nbsp;The root node of the XML document. It outlines your request</span></li><ul><li><span style="line-height: 16px;">methodName - type of request. It must be "install.setup" for installation request.</span></li><li><span style="line-height: 16px;">params - This node contains all parameters that you send</span></li><ul><li><span style="line-height: 16px;">product_key -&nbsp;Product key for KMP. You can get it from your <a href="http://web-site-scripts.com/member-area/" target="_blank" rel="nofollow">member area</a>.</span></li><li><span style="line-height: 16px;">db_prefix - Prefix for database tables (optional)</span></li><li><span style="line-height: 16px;">db_host - Database server address</span></li><li><span style="line-height: 16px;">db_login - The username of the Database user</span></li><li><span style="line-height: 16px;">db_password -&nbsp;The Database password for the above user</span></li><li><span style="line-height: 16px;">db_name -&nbsp;The name of the MySQL database to install the KMP in to</span></li><li><span style="line-height: 16px;">acc_login -&nbsp;The username of the knowledgebase administrator</span></li><li><span style="line-height: 16px;">acc_password -&nbsp;The password to assign the KMP administrator account</span></li><li><span style="line-height: 16px;">acc_first_name -&nbsp;The first name of the knowledgebase administrator</span></li><li><span style="line-height: 16px;">acc_last_name -&nbsp;The last name of the knowledgebase administrator</span></li><li><span style="line-height: 16px;">acc_email -&nbsp;The email address of the knowledgebase administrator</span></li><li><span style="line-height: 16px;">smtp_host - SMTP (mail) server address</span></li><li><span style="line-height: 16px;">smtp_port - SMTP server port</span></li></ul></ul></ul>
<p></p>
<h2><a  name="sample-xml"></a>Sample XML Request</h2>
<p></p>
<div class="source">
<div class="sourceHeader" align="center">Sample XML Request<br></div>
<div class="sourceContent"><font face="'courier new'">&lt;?xml version="1.0"?&gt;<br>&lt;methodCall&gt;<br>&nbsp;&nbsp;&lt;methodName&gt;install.setup&lt;/methodName&gt;<br>&nbsp;&nbsp;&lt;params&gt;<br>&nbsp;&nbsp; &nbsp;&lt;param&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp;&lt;value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;struct&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;activation_code&lt;/name&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;string&gt;[License_Key]&lt;/string&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;db_prefix&lt;/name&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;string&gt;kmp_&lt;/string&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;db_host&lt;/name&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;string&gt;localhost&lt;/string&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;db_login&lt;/name&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;string&gt;root&lt;/string&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;db_password&lt;/name&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;string&gt;&lt;/string&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;db_name&lt;/name&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;string&gt;kb&lt;/string&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;acc_login&lt;/name&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;string&gt;admin&lt;/string&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;acc_password&lt;/name&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;string&gt;password&lt;/string&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;acc_first_name&lt;/name&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;string&gt;John&lt;/string&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;acc_last_name&lt;/name&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;string&gt;Doe&lt;/string&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;acc_email&lt;/name&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;string&gt;administrator@example.com&lt;/string&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;smtp_host&lt;/name&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;string&gt;mail&lt;/string&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;smtp_port&lt;/name&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;string&gt;25&lt;/string&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;/struct&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp;&lt;/value&gt;<br>&nbsp;&nbsp; &nbsp;&lt;/param&gt;<br>&nbsp;&nbsp;&lt;/params&gt;<br>&lt;/methodCall&gt;</font><p></p>
</div>
</div>
<p><br></p>
<h2><a  name="sample-php"></a>Sample PHP Request (Using CURL and IXR)</h2>
<p>The following sample code is written on PHP with usage of CURL functionality.</p><p>You can also find this sample in the KMP package: /examples/installation-api/rpc_install.php</p><p>Although it uses&nbsp;IXR as XML RPC library (include 'inc/xmlrpc.php') it is just a sample, and you may use any library suitable for you.</p>
<p></p>
<div class="source">
<div class="sourceHeader" align="center">Sample PHP Request<br></div>
<div class="sourceContent">
<p></p>
<p><font face="'courier new'">&lt;?php&nbsp;<br>error_reporting(E_ALL);<br>include 'inc/xmlrpc.php';<br><br>$client = new IXR_Client('http://localhost/kmp/admin/install/rpc.php');<br><br>$client-&gt;debug = true;<br><br>$params = array(<br>&nbsp;&nbsp; &nbsp;'product_key' =&gt; 'ABCD-EFGH-IJKL-MNOP',<br>&nbsp;&nbsp; &nbsp;'db_prefix' &nbsp; &nbsp; &nbsp; =&gt; 'kmp_',<br>&nbsp;&nbsp; &nbsp;'db_host' &nbsp; &nbsp; &nbsp; &nbsp; =&gt; 'localhost',<br>&nbsp;&nbsp; &nbsp;'db_login' &nbsp; &nbsp; &nbsp; &nbsp;=&gt; 'root',<br>&nbsp;&nbsp; &nbsp;'db_password' &nbsp; &nbsp; =&gt; '',<br>&nbsp;&nbsp; &nbsp;'db_name' &nbsp; &nbsp; &nbsp; &nbsp; =&gt; 'kmp',<br>&nbsp;&nbsp; &nbsp;'acc_login' &nbsp; &nbsp; &nbsp; =&gt; 'admin',<br>&nbsp;&nbsp; &nbsp;'acc_password' &nbsp; &nbsp;=&gt; '',<br>&nbsp;&nbsp; &nbsp;'acc_first_name' &nbsp;=&gt; 'John',<br>&nbsp;&nbsp; &nbsp;'acc_last_name' &nbsp; =&gt; 'Doe',<br>&nbsp;&nbsp; &nbsp;'acc_email' &nbsp; &nbsp; &nbsp; =&gt; 'john.doe@example.com',<br>&nbsp;&nbsp; &nbsp;'smtp_host' &nbsp; =&gt; 'mail',<br>&nbsp;&nbsp; &nbsp;'smtp_port' &nbsp; =&gt; '25'<br>);<br><br>if (!$client-&gt;query('install.setup', $params)) {<br>&nbsp;&nbsp; die('An error occurred - '.$client-&gt;getErrorCode().":".$client-&gt;getErrorMessage());<br>}<br><br>echo '&lt;pre&gt;';<br>print_r($client-&gt;getResponse());<br>echo '&lt;/pre&gt;';<br><br>?&gt;</font></p>
<p></p>
</div>
</div>
<p><br></p>
<p></p>
<h1><a  name="install-success"></a>A Successful Installation Response</h1>
<p>A successful installation response has the following format.</p>
<p></p>
<div class="source">
<div class="sourceHeader" align="center">Successful Installation Response<br></div>
<div class="sourceContent">
<p>
</p>
<pre class="code-java">&lt;?xml version=<span class="code-quote">"1.0"</span>?&gt;<br>&lt;methodResponse&gt;<br>&nbsp;&nbsp;&lt;params&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;param&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;value&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;string&gt;Installation completed successfully&lt;/string&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/value&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/param&gt;<br>&nbsp;&nbsp;&lt;/params&gt;<br>&lt;/methodResponse&gt;</pre>
<p></p>
</div>
</div>
<p><br></p>
<h1><a  name="install-error"></a>An Erroneous Installation Response</h1>
<p>If an error&nbsp;occurred&nbsp;during installation or server doesn't meet KMP requirements, you will get an erroneous installation message. It includes error code and error message with information why installation cannot proceed.</p>
<p></p>
<div class="source">
<div class="sourceHeader" align="center">Erroneous Installation Response<br></div>
<div class="sourceContent">
<p></p>
<pre class="code-java"><span style="white-space: normal;"><font face="'courier new'">&lt;?xml version="1.0"?&gt;<br>&lt;methodResponse&gt;<br>&nbsp;&nbsp;&lt;fault&gt;<br>&nbsp;&nbsp; &nbsp;&lt;value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp;&lt;struct&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;faultCode&lt;/name&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;value&gt;&lt;int&gt;-101&lt;/int&gt;&lt;/value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;/member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;name&gt;faultString&lt;/name&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;value&gt;&lt;string&gt;Not all parameters specified. Following parameters are required: acc_login, acc_password, acc_first_name, acc_last_name&lt;/string&gt;&lt;/value&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&lt;/member&gt;<br>&nbsp;&nbsp; &nbsp; &nbsp;&lt;/struct&gt;<br>&nbsp;&nbsp; &nbsp;&lt;/value&gt;<br>&nbsp;&nbsp;&lt;/fault&gt;<br>&lt;/methodResponse&gt;</font></span></pre>
<p></p>
</div>
</div>
<p><br></p>
<p></p>
<h1><a  name="error-codes"></a>Error Codes</h1>
<p>The table below outlines all possible error messages for faultCode attribute.</p><p><table style="border-collapse: collapse; border: 1px solid rgb(0, 0, 0);" bgcolor="" border="1" cellpadding="3" cellspacing="0" height="" width="100%"><tbody>
<tr align="center" bgcolor="#6690bc" valign="middle">
<th>
<font color="#ffffff">Error Code</font></th>
<th>
<span style="color: rgb(255, 255, 255);"><b>Message</b></span></th>
</tr>
<tr>
<td>
&nbsp;-101</td>
<td>
&nbsp;Not all parameters specified. Following parameters are required: [list of parameters]</td>
</tr>
<tr>
<td>
-201&nbsp;</td>
<td>
&nbsp;Your PHP version is not compatible. Current PHP version is [current version]. Required version: [required version]</td>
</tr>
<tr>
<td>
-202&nbsp;</td>
<td>
&nbsp;Some of the required modules are missing: [list of missing extensions]</td>
</tr>
<tr>
<td>
-203&nbsp;</td>
<td>
&nbsp;Some of the required custom checks has been failed: [list of custom checks]</td>
</tr>
<tr>
<td>
-301&nbsp;</td>
<td>
&nbsp;File system permissions are incorrect: [list of files with incorrect permissions]</td>
</tr>
<tr>
<td>
-401&nbsp;</td>
<td>
&nbsp;Can not connect to database server</td>
</tr>
<tr>
<td>
-402&nbsp;</td>
<td>
&nbsp;Can not select database</td>
</tr>
<tr>
<td>
-403&nbsp;</td>
<td>
Unknown error while database connection&nbsp;</td>
</tr>
<tr>
<td>
-410&nbsp;</td>
<td>
MySQL error when executing sql dump: [mysql error]&nbsp;</td>
</tr>
<tr>
<td>
-411&nbsp;</td>
<td>
&nbsp;MySQL error when executing sql dump for administrator's account: [mysql error]</td>
</tr>
<tr>
<td>
-501&nbsp;</td>
<td>
&nbsp;Error when setup configuration file</td>
</tr>
<tr>
<td>
-502&nbsp;</td>
<td>
&nbsp;Error when setup file [file name]</td>
</tr>
<tr>
<td>
-601&nbsp;</td>
<td>
&nbsp;Wrong license key</td>
</tr><tr><td>-701&nbsp;</td><td>&nbsp;Unable to run installation process because KMP has been already installed</td></tr>
</tbody>
</table><br></p>
<p></p>
<h1><a  name="shell"></a>Installation by Shell Script</h1>
<p>Installation shell script supports installation of KMP from&nbsp;UNIX&nbsp;shell. Before starting the script:</p><p></p><ul><li><span style="line-height: 16px;">Check that server meets the KMP <a href="http://www.web-site-scripts.com/knowledge-management/requirements.html" target="">requirements</a></span></li><li><span style="line-height: 16px;">Upload files from the KMP package on server</span></li><li><span style="line-height: 16px;">Setup <a href="ARTICLE_URL#388##AA-00427#" target="">correct permissions</a></span></li><li><span style="line-height: 16px;">Create an empty database for KMP</span></li><li><span style="line-height: 16px;">Specify correct installation details including database connection parameters, administrator account details, etc in the installation script</span></li></ul><div><p>Installation script performs the following actions:</p><ul><li><span style="line-height: 16px;">Installs KMP via XML API</span></li><li><span style="line-height: 16px;">Provides you with the URL to installed KMP</span></li></ul><p></p></div><p></p>
<p></p>
<div class="source">
<div class="sourceHeader" align="center">Parameters to Customize in the Installation Shell Script</div>
<div class="sourceContent">
<p></p>
<p><font face="'courier new'">KMP_KEY="ABCD-EFGH-IJKL-MNOP" # Product key for Knowledgebase Manager Pro (KMP). You can get it from your member area at http://web-site-scripts.com/member-area/<br><br>KMP_URL="http://localhost/kmp/" # URL of the destination directory<br><br>KMP_DB_HOST="localhost" # Name of database server (default value = localhost)<br><br>KMP_DB_PREFIX="" # Prefix for database tables (optional)<br><br>KMP_DB="kmp" # Database name<br><br>KMP_DB_USER="" # Database user<br><br>KMP_DB_PASS="" # Database user password<br><br>KMP_USER="admin" # Desired login for KMP administrator account<br><br>KMP_PASS="" # Desired password for KMP administrator account<br><br>KMP_ACC_FNAME="John" # KMP administrator first name&nbsp;<br><br>KMP_ACC_LNAME="Doe" # KMP administrator last name&nbsp;<br><br>KMP_EMAIL="john.doe@example.com" # KMP administrator email<br><br>KMP_SMTP_HOST="localhost" # SMTP server name (default value = localhost)<br><br>KMP_SMTP_PORT="25" # SMTP server port (default value = 25)<br><br>PHP_PATH="/usr/bin/php" # Command to run PHP executable (default value = /usr/bin/php)</font><br></p>
<p></p>
</div></div><br>
<p></p>
<p></p>]]></description>
                                    <pubDate>Fri, 22 Jan 2010 08:55:39 +0000</pubDate>
                                    <guid>https://www.web-site-scripts.com/knowledge-base/article/AA-00464</guid>
                    </item>
                
    </channel>
</rss>