aboutsummaryrefslogtreecommitdiff
path: root/php-client/example.php
diff options
context:
space:
mode:
Diffstat (limited to 'php-client/example.php')
-rw-r--r--php-client/example.php21
1 files changed, 14 insertions, 7 deletions
diff --git a/php-client/example.php b/php-client/example.php
index 9d3eb9e..483da00 100644
--- a/php-client/example.php
+++ b/php-client/example.php
@@ -16,15 +16,22 @@ $API = new phpipam_api_client ($api_url, $api_app_id, $api_key, $api_username, $
# debug - only to debug curl
$API->set_debug (true);
# execute - result is stored to $API->result, save it to own array if multiple calls needed after execute
-
-$API->execute ("POST", "addresses", array("first_free", "7"), array(), $token_file);
-
-
-// $API->execute ("DELETE", "subnets", array(7, "permissions"), array(), $token_file);
-// $API->execute ("POST", "vrf", array(), array("number"=>"114","name"=>"API"), $token_file);
-# ger result
+$API->execute ("GET", "addresses", array("first_free", "7"), array(), $token_file);
+# get result
$result = $API->get_result();
+/**
+ * Some examples
+ *
+ * Delete, POST examples
+ * $API->execute ("DELETE", "subnets", array(7, "permissions"), array(), $token_file);
+ * $API->execute ("POST", "vrf", array(), array("number"=>"114","name"=>"API"), $token_file);
+ *
+ * Get headers in array
+ * $response_headers = $API->response_headers ();
+ */
+
# print result
+print_r($response_headers);
print_r(json_decode($result, true));
?>