summaryrefslogtreecommitdiff
path: root/scripts/api-client.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fred@kanboard.net>2014-06-20 15:41:05 -0300
committerFrédéric Guillot <fred@kanboard.net>2014-06-20 15:41:05 -0300
commit7c5b900bd83b6b9bdb5656eb169381ff46f8106a (patch)
tree39481ff2ee73d7479369655ba86d343f302e1499 /scripts/api-client.php
parentefdc959c555872677e599d2ff12e1263d719f3f2 (diff)
First API implementation
Diffstat (limited to 'scripts/api-client.php')
-rwxr-xr-xscripts/api-client.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/api-client.php b/scripts/api-client.php
new file mode 100755
index 00000000..0fb45117
--- /dev/null
+++ b/scripts/api-client.php
@@ -0,0 +1,20 @@
+#!/usr/bin/env php
+<?php
+
+require 'vendor/JsonRPC/Client.php';
+
+if ($argc !== 3) {
+ die('Usage: '.$argv[0].' <url> <token>'.PHP_EOL);
+}
+
+$client = new JsonRPC\Client($argv[1], 5, true);
+$client->authentication('jsonrpc', $argv[2]);
+
+
+$client->createProject('Test API');
+
+
+$r = $client->getAllProjects();
+
+var_dump($r);
+