# API: Add note

# addAdminNote

Creates a new note.

# Required parameters

Parameter Description
item_id Item id
item_type Item type, possible values: account, admin, client, domain, draft, estimate, invoice, order, rackitem
note Note text

# Optional parameters

Parameter Description
flags Set to 2 to make note viewable by customer (if its assigned to account/domain)

# Request

GET /admin/api.php?api_id=API_ID&api_key=API_KEY&call=addAdminNote&item_id=ITEM_ID&item_type=ITEM_TYPE&note=NOTE

# PHP Samples

$url = 'http://url_to_hb.com/admin/api.php';
$post = [
  'call' => 'addAdminNote',
  'api_id' => $API_ID,
  'api_key' => $API_KEY,
  'item_id' => $ITEM_ID,
  'item_type' => $ITEM_TYPE,
  'note' => $NOTE,
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$data = curl_exec($ch);
curl_close($ch);

$return = json_decode($data, true);
print_r($return);
include 'class.hbwrapper.php';
HBWrapper::setAPI('http://url_to_hb.com/admin/api.php','API ID','API Key');
$params = [
  'item_id' => $ITEM_ID,
  'item_type' => $ITEM_TYPE,
  'note' => $NOTE,
];
$return = HBWrapper::singleton()->addAdminNote($params);
print_r($return);
/* Use this method to access HostBill api from HostBill modules */
$api = new ApiWrapper();
$params = [
  'item_id' => $ITEM_ID,
  'item_type' => $ITEM_TYPE,
  'note' => $NOTE,
];
$return = $api->addAdminNote($params);
print_r($return);

# Response

{
    "success": true,
    "note_id": "10",
    "call": "addAdminNote",
    "server_time": 1534506317
}
Last Updated: 10/7/2024, 2:36:43 PM