From 94207cf8ea41132fd7279ab08845677542eb3c9f Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Sat, 23 Jan 2016 10:52:55 -0500 Subject: Update doc and readme --- doc/api-examples.markdown | 56 ++++++++++------------------------------------- doc/faq.markdown | 34 ++++++++++++++-------------- 2 files changed, 28 insertions(+), 62 deletions(-) (limited to 'doc') diff --git a/doc/api-examples.markdown b/doc/api-examples.markdown index 9b1ed12a..14d5db98 100644 --- a/doc/api-examples.markdown +++ b/doc/api-examples.markdown @@ -34,62 +34,30 @@ Response from the server: Example with Python ------------------- -Here a basic example written in Python to create a task: +You can use the [official Python client for Kanboard](https://github.com/kanboard/kanboard-api-python): -```python -#!/usr/bin/env python - -import requests -import json - -def main(): - url = "http://demo.kanboard.net/jsonrpc.php" - api_key = "be4271664ca8169d32af49d8e1ec854edb0290bc3588a2e356275eab9505" - headers = {"content-type": "application/json"} - - payload = { - "method": "createTask", - "params": { - "title": "Python API test", - "project_id": 1 - }, - "jsonrpc": "2.0", - "id": 1, - } +```bash +pip install kanboard +``` - response = requests.post( - url, - data=json.dumps(payload), - headers=headers, - auth=("jsonrpc", api_key) - ) +Here an example to create a project and a task: - if response.status_code == 401: - print "Authentication failed" - else: - result = response.json() +```python +from kanboard import Kanboard - assert result["result"] == True - assert result["jsonrpc"] - assert result["id"] == 1 +kb = Kanboard("http://localhost/jsonrpc.php", "jsonrpc", "your_api_token") - print "Task created successfully!" +project_id = kb.create_project(name="My project") -if __name__ == "__main__": - main() +task_id = kb.create_task(project_id=project_id, title="My task title") ``` -Run this script from your terminal: - -```bash -python jsonrpc.py -Task created successfully! -``` +There are more examples on the [official website](https://github.com/kanboard/kanboard-api-python). Example with a PHP client ------------------------- -I wrote a simple [Json-RPC Client/Server library in PHP](https://github.com/fguillot/JsonRPC), here an example: +You can use this [Json-RPC Client/Server library for PHP](https://github.com/fguillot/JsonRPC), here an example: ```php - - How to install Kanboard on Yunohost? ------------------------------------ @@ -107,6 +93,18 @@ How to install Kanboard on Yunohost? There is a [package to install Kanboard on Yunohost easily](https://github.com/mbugeia/kanboard_ynh). +Where can I find a list of related projects? +-------------------------------------------- + +- [Kanboard API python client by @freekoder](https://github.com/freekoder/kanboard-py) +- [Kanboard Presenter by David Eberlein](https://github.com/davideberlein/kanboard-presenter) +- [CSV2Kanboard by @ashbike](https://github.com/ashbike/csv2kanboard) +- [Kanboard for Yunohost by @mbugeia](https://github.com/mbugeia/kanboard_ynh) +- [Trello import script by @matueranet](https://github.com/matueranet/kanboard-import-trello) +- [Chrome extension by Timo](https://chrome.google.com/webstore/detail/kanboard-quickmenu/akjbeplnnihghabpgcfmfhfmifjljneh?utm_source=chrome-ntp-icon), [Source code](https://github.com/BlueTeck/kanboard_chrome_extension) +- [Python client script by @dzudek](https://gist.github.com/fguillot/84c70d4928eb1e0cb374) + + Are there some tutorials about Kanboard in other languages? ----------------------------------------------------------- -- cgit v1.2.3