API Command Examples

From INAP Dropzone API
Jump to: navigation, search

Contents

Viewing a Support Ticket

For more information about the command and what data is required and returned when viewing a support ticket through the API please go to Support View.


$options = array(
  CURLOPT_URL            => 'http://USERNAME:PASSWORD'@dropzone.singlehop.com/support/view/123456',
  CURLOPT_RETURNTRANSFER => TRUE,
  CURLOPT_HEADER         => FALSE,
  CURLOPT_CONNECTTIMEOUT => 120,
  CURLOPT_TIMEOUT        => 120,
  CURLOPT_SSL_VERIFYHOST => FALSE,
  CURLOPT_SSL_VERIFYPEER => FALSE,
  CURLOPT_VERBOSE        => TRUE,
);
$ch = curl_init();
curl_setopt_array($ch, $options);
$return = curl_exec($ch);
echo json_decode($return);


Replying to a Support Ticket

For more information about the command and what data is required and returned when replying to a support ticket through the API please go to [[ Support_Reply]].


$options = array(
  CURLOPT_URL            => 'http://USERNAME:PASSWORD'@dropzone.singlehop.com/support/reply',
  CURLOPT_RETURNTRANSFER => TRUE,
  CURLOPT_HEADER         => FALSE,
  CURLOPT_CONNECTTIMEOUT => 120,
  CURLOPT_TIMEOUT        => 120,
  CURLOPT_POST           => TRUE,
  CURLOPT_POSTFIELDS     => 'ticketid=123456&subject=RE: Server Setup&message=This server setup is awesome.&contact=admin@test.com',
  CURLOPT_SSL_VERIFYHOST => FALSE,
  CURLOPT_SSL_VERIFYPEER => FALSE,
  CURLOPT_VERBOSE        => TRUE,
);
$ch = curl_init();
curl_setopt_array($ch, $options);
$return = curl_exec($ch);
echo json_decode($return);


Viewing an Invoice

For more information about the command and what data is required and returned when viewing an invoice through the API please go to Billing_View.

$options = array(
  CURLOPT_URL            => 'http://USERNAME:PASSWORD'@dropzone.singlehop.com/billing/view/123456',
  CURLOPT_RETURNTRANSFER => TRUE,
  CURLOPT_HEADER         => FALSE,
  CURLOPT_CONNECTTIMEOUT => 120,
  CURLOPT_TIMEOUT        => 120,
  CURLOPT_SSL_VERIFYHOST => FALSE,
  CURLOPT_SSL_VERIFYPEER => FALSE,
  CURLOPT_VERBOSE        => TRUE,
);
$ch = curl_init();
curl_setopt_array($ch, $options);
$return = curl_exec($ch);
echo json_decode($return);


Create a Virtual Machine

For more information about the command and what data is required and returned when creating a virtual machine through the API please go to Server Create VM.

$options = array(
  CURLOPT_URL            => 'http://USERNAME:PASSWORD'@dropzone.singlehop.com/server/createvm/123456',
  CURLOPT_RETURNTRANSFER => TRUE,
  CURLOPT_HEADER         => FALSE,
  CURLOPT_CONNECTTIMEOUT => 120,
  CURLOPT_TIMEOUT        => 120,
  CURLOPT_POST           => TRUE,
  CURLOPT_POSTFIELDS     => 'serverid=12345&hostname=vm1.server.com&osid=1&ips=30&storagetype=canopy&memory=524288&storage=10485760&cpu_allocation=pool&priority=100',
  CURLOPT_SSL_VERIFYHOST => FALSE,
  CURLOPT_SSL_VERIFYPEER => FALSE,
  CURLOPT_VERBOSE        => TRUE,
);
$ch = curl_init();
curl_setopt_array($ch, $options);
$return = curl_exec($ch);
echo json_decode($return);
Personal tools