aboutsummaryrefslogtreecommitdiff
path: root/php-client/example.php
blob: 74ea511afd29d791cf4179d01f1cc3b3d6258134 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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);
?>