johansatge / workflowy-php
An unofficial WorkFlowy API
Installs: 775
Dependents: 0
Suggesters: 0
Security: 0
Stars: 139
Watchers: 15
Forks: 16
Open Issues: 4
README
An unofficial WorkFlowy API written in PHP.
Disclaimer
The aim of the API is to keep things simple. Please keep in mind that it is an unofficial tool, and it may stop working at any time.
So, I strongly recommend you not to manipulate sensitive data with this API, and be sure to make regular backups of your lists.
Installation
By using Composer:
{ "require": { "johansatge/workflowy-php": "0.1" } }
If you do not use Composer, you can download the source files, install them anywhere on your project, and call the providden autoloader file:
<?php require_once '/your/project/root/path/workflowy-php/src/autoload.php';
Usage
Login API
Because of the unofficial status of the API, you have to login first, by using your regular credentials, before being able to perform requests on your data.
use WorkFlowyPHP\WorkFlowy; use WorkFlowyPHP\WorkFlowyException; try { $session_id = WorkFlowy::login('user@domain.org', 'password'); } catch (WorkFlowyException $e) { var_dump($e->getMessage()); }
The $session_id
variable will be used later, when performing requests.
You have to use your unencoded password in your code. So I strongly advise you to store it in a different file, or ask it once to the user, then store the session ID. (But keep in mind that the session does not last forever.) This is a huge limitation, but for now there is no workaround.
Lists API
Lists-related stuff is managed with the recursive WorkFlowySublist
class.
First, you will need to get the main (root) list.
use WorkFlowyPHP\WorkFlowyList; $list_request = new WorkFlowyList($session_id); $list = $list_request->getList();
Then, you will be able to perform the following operations on the resulting $list
, or its sublists.
Get the informations of a list
Edit the informations of a list
The methods below are used to edit data.
Keep in mind that they will send requests to the server, but not update the existing variables.
For instance, if you change the parent of a list and call the getSublists() method on its old parent, the list will still be present in the resulting array.
Account API
Changelog
License
This project is released under the MIT License.