Solutions

Vision Helpdesk Developer API

Vision Helpdesk API Example Usage

Sheena Sen May-29th, 2012 11:50 7 0
The below PHP code is to fetch Ticket Details of particular ticket id.

Considering you have Vision Helpdesk installed on http://visiononlinedemo.com/support/

<?php
// URL to API file
$url = "http://visiononlinedemo.com/support/api/index.php"; 

$username = "admin"; // Admin or Staff username goes here 
$password = "admin"; // Admin or Staff password goes here

// Use either username and password
$postfields["vis_txtusername"] = $username;
$postfields["vis_txtuserpass"] = md5($password); 

OR
// Use "access token"
$postfields["vis_txttoken"] = "T0RSbU56TmpZemxoTlRabU1XWTJOV1ZtT0RWa1ltUm1NR1F6WldJell6VT0=";

$postfields["vis_module"] = "ticket"; 
$postfields["vis_operation"] = "ticket_details"; 
$postfields["vis_ticket_id"] = 1;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_TIMEOUT, 100); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields); 
$data = curl_exec($ch); 
curl_close($ch); 
echo $data;
?>
In some applications you may not want to create a file for accessing each API – you may want to post all parameters using URL

Below is same API in URL format

If you want output in XML Format

http://visiononlinedemo.com/support/api/index.php?
&vis_txtusername=admin
&vis_txtuserpass=21232f297a57a5a743894a0e4a801fc3
&vis_module=ticket
&vis_operation=ticket_details
&vis_ticket_id=1
Or

http://visiononlinedemo.com/support/api/index.php?
&vis_txttoken=T0RSbU56TmpZemxoTlRabU1XWTJOV1ZtT0RWa1ltUm1NR1F6WldJell6VT0=
&vis_module=ticket
&vis_operation=ticket_details
&vis_ticket_id=1


If you want output in JSON Format

http://visiononlinedemo.com/support/api/index.php?
&vis_txtusername=admin
&vis_txtuserpass=21232f297a57a5a743894a0e4a801fc3
&vis_module=ticket
&vis_operation=ticket_details
&vis_ticket_id=1
&vis_encode=json
Or

http://visiononlinedemo.com/support/api/index.php?
&vis_txttoken=T0RSbU56TmpZemxoTlRabU1XWTJOV1ZtT0RWa1ltUm1NR1F6WldJell6VT0=
&vis_module=ticket
&vis_operation=ticket_details
&vis_ticket_id=1
&vis_encode=json

Vote

Was this article helpful?
7 out of 11 found this helpful