forked from philprobinson84/Wunderlist2-PHP-Wrapper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.files.class.php
54 lines (45 loc) · 1.09 KB
/
api.files.class.php
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* Wrapper for Wunderlist2 API - Files (PRO accounts only)
* api.class.php
* Purpose: communicate with Wunderlist2 API
*
* @requires base.class.php
* @author Joshua de Gier
* @version 1.01 18/07/2013
*/
require_once('base.class.php');
class Wunderfiles extends Wunderbase
{
protected $authtoken = false;
protected $api_url = 'https://files.wunderlist.com';
protected $files = false;
/**
* construct the Wunderlist Files API and save the authentication token for later use
*
* @param string $token
*
* @throws Exception if any of the parameters are empty or authentication fails
* @return void
*/
public function __construct($token)
{
// Check for email
if( $token == "" )
{
throw new Exception( "Token parameter empty", 1001 );
}
$this->authtoken = $token;
}
/**
* get all the files of the currently logged in user
*
* @return array Returns an array with the files of the user
*/
public function filelist()
{
$return = $this->call('/files', 'get', array());
return $return;
}
}
?>