Skip to content

Commit 1503de4

Browse files
committed
Working php API client with example
1 parent b05c2d3 commit 1503de4

File tree

4 files changed

+918
-1
lines changed

4 files changed

+918
-1
lines changed

php-client/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
api-config.php
2+
token.txt

php-client/api-config.dist.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
# set error reporting
4+
error_reporting(E_ALL ^ E_NOTICE ^ E_STRICT);
5+
6+
# api params
7+
$api_url = "http://127.0.0.1/api/"; // server url
8+
$api_app_id = "myapp"; // application id
9+
$api_key = false; // api key - only for encrypted methods, otherwise must be false
10+
11+
# set username / password for authentication, not needed for encrypted communications
12+
$api_username = "apiusername";
13+
$api_password = "apipassword";
14+
15+
# save token or not ?
16+
# false => dont save, check each time
17+
# filename => will save token to filename provided
18+
$token_file = "token.txt";
19+
20+
# set result format json/object/array/xml
21+
$result_format = "json";
22+
23+
?>

0 commit comments

Comments
 (0)