diff options
author | Miha Petkovsek <miha.petkovsek@gmail.com> | 2016-06-22 10:51:47 +0200 |
---|---|---|
committer | Miha Petkovsek <miha.petkovsek@gmail.com> | 2016-06-22 10:51:47 +0200 |
commit | 1503de4a313c30cacc912b9eb0a55c5422f8e849 (patch) | |
tree | 03c861abf887765e9b52976515881f2c0f306ce3 /php-client/example.php | |
parent | b05c2d3ec69e60a5f25cf309e30ff591c992228b (diff) | |
download | phpipam-api-clients-1503de4a313c30cacc912b9eb0a55c5422f8e849.tar.gz |
Working php API client with example
Diffstat (limited to 'php-client/example.php')
-rw-r--r-- | php-client/example.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/php-client/example.php b/php-client/example.php new file mode 100644 index 0000000..74ea511 --- /dev/null +++ b/php-client/example.php @@ -0,0 +1,25 @@ +<?php + +/** + * + * example usage of phpipam_api_client class + * + * + */ + +# include config file and api client class file +require("api-config.php"); +require("class.phpipam-api.php"); + +# init object with settings from +$API = new phpipam_api_client ($api_url, $api_app_id, $api_key, $api_username, $api_password, $result_format); +# debug - only to debug curl +$API->set_debug (false); +# execute - result is stored to $API->result, save it to own array if multiple calls needed after execute +$API->execute ("GET", "sections", array(5), array(), $token_file); +# ger result +$result = $API->get_result(); + +# print result +print_r($result); +?>
\ No newline at end of file |