invoxivr Posted March 11, 2010 Share Posted March 11, 2010 Hi - I am in process of wrapping up the phone ticket system and trying to optimize it further. Now, the customers can call in and say their name or company name and system will go ahead and verify them with their pin code. Next, it will allow them to open a ticket. For existing tickets, I am downloading all tickets and search for clientid. But is there a way to access only the tickets based on client-id or at least by date. Downloading all tickets is taking lot of time for big customers. I have looked everywhere in the API but no word on clientid. Thanks. 0 Quote Link to comment Share on other sites More sharing options...
m00 Posted March 12, 2010 Share Posted March 12, 2010 Hi - I am in process of wrapping up the phone ticket system and trying to optimize it further. Now, the customers can call in and say their name or company name and system will go ahead and verify them with their pin code. Next, it will allow them to open a ticket. For existing tickets, I am downloading all tickets and search for clientid. But is there a way to access only the tickets based on client-id or at least by date. Downloading all tickets is taking lot of time for big customers. I have looked everywhere in the API but no word on clientid. Thanks. I just wrote a simple API-script for this a few days ago. /includes/api/getticketsbyuserid.php <?php /* Available fields: - clientid */ $xml = null; $result = mysql_query("SELECT * FROM tbltickets WHERE userid='".$_POST['clientid']."' ORDER BY lastreply DESC"); $amount = mysql_num_rows($result); $xml .= "<whmcsapi>\n"; $xml .= " <action>gettickets</action>\n"; $xml .= " <result>success</result>\n"; $xml .= " <totalresults>".$amount."</totalresults>\n"; if($amount !== 0) { $xml .= " <tickets>\n"; while($row = mysql_fetch_array($result)) { $xml .= " <ticket>\n"; $xml .= " <id>".$row['id']."</id>\n"; $xml .= " <tid>".$row['tid']."</tid>\n"; $xml .= " <deptid>".$row['did']."</deptid>\n"; $xml .= " <userid>".$row['userid']."</userid>\n"; $xml .= " <name>".$row['name']."</name>\n"; $xml .= " <email>".$row['email']."</email>\n"; $xml .= " <cc>".$row['cc']."</cc>\n"; $xml .= " <c>".$row['c']."</c>\n"; $xml .= " <date>".$row['date']."</date>\n"; $xml .= " <subject><![CDATA[".$row['title']."]]></subject>\n"; $xml .= " <message><![CDATA[".$row['message']."]]></message>\n"; $xml .= " <status>".$row['status']."</status>\n"; $xml .= " <priority>".$row['urgency']."</priority>\n"; $xml .= " <admin>".$row['admin']."</admin>\n"; $xml .= " <attachment>".$row['attachment']."</attachment>\n"; $xml .= " <lastreply>".$row['lastreply']."</lastreply>\n"; $xml .= " <flag>".$row['flag']."</flag>\n"; $xml .= " <service>".$row['service']."</service>\n"; $xml .= " </ticket>\n"; } $xml .= " </tickets>\n"; } $xml .= "</whmcsapi>\n"; echo $xml; ?> The action name is getticketsbyuserid. 0 Quote Link to comment Share on other sites More sharing options...
invoxivr Posted March 15, 2010 Author Share Posted March 15, 2010 Thanks a ton. I will pay for your first two months of your self IVR service if interested. 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.