mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-25 09:55:38 +00:00
98_todoist: API v9, please check, URL as var
git-svn-id: https://svn.fhem.de/fhem/trunk@26809 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
53db18b142
commit
07c19910fd
@ -17,7 +17,8 @@ eval "use Date::Parse;1" or $missingModule .= "Date::Parse ";
|
||||
|
||||
#######################
|
||||
# Global variables
|
||||
my $version = "1.3.12";
|
||||
my $version = "1.3.13";
|
||||
my $apiUrl = "https://api.todoist.com/sync/v9/";
|
||||
|
||||
my $srandUsed;
|
||||
|
||||
@ -326,7 +327,7 @@ sub todoist_ReorderTasks ($$) {
|
||||
my $method="POST";
|
||||
|
||||
$param = {
|
||||
url => "https://api.todoist.com/sync/v9/sync",
|
||||
url => $apiUrl."sync",
|
||||
data => $data,
|
||||
method => $method,
|
||||
wType => "reorder",
|
||||
@ -583,7 +584,7 @@ sub todoist_UpdateTask($$$) {
|
||||
Log3 $name,4, "todoist ($name): JSON sent to todoist API: ".Dumper($data);
|
||||
|
||||
$param = {
|
||||
url => "https://api.todoist.com/sync/v9/sync",
|
||||
url => $apiUrl."sync",
|
||||
data => $data,
|
||||
tTitle => $title,
|
||||
method => $method,
|
||||
@ -712,7 +713,7 @@ sub todoist_CreateTask($$) {
|
||||
|
||||
|
||||
$param = {
|
||||
url => "https://todoist.com/sync/v9/items/add",
|
||||
url => $apiUrl."items/add",
|
||||
data => $data,
|
||||
tTitle => $title,
|
||||
method => "POST",
|
||||
@ -879,10 +880,10 @@ sub todoist_GetTasks($;$) {
|
||||
};
|
||||
|
||||
# set url for API access
|
||||
my $url = "https://todoist.com/sync/v9/projects/get_data";
|
||||
my $url = $apiUrl."projects/get_data";
|
||||
## check if we get also the completed Tasks
|
||||
if ($completed == 1) {
|
||||
$url = "https://todoist.com/sync/v9/completed/get_all";
|
||||
$url = $apiUrl."completed/get_all";
|
||||
$data->{'limit'}=50;
|
||||
}
|
||||
|
||||
@ -1194,7 +1195,7 @@ sub todoist_GetUsers($) {
|
||||
Log3 $name,5, "$name: hash: ".Dumper($hash);
|
||||
|
||||
$param = {
|
||||
url => "https://todoist.com/sync/v9/sync",
|
||||
url => $apiUrl."sync",
|
||||
data => $data,
|
||||
timeout => 7,
|
||||
method => "POST",
|
||||
@ -1334,7 +1335,7 @@ sub todoist_GetProjects($) {
|
||||
Log3 $name,5, "$name: hash: ".Dumper($hash);
|
||||
|
||||
$param = {
|
||||
url => "https://todoist.com/sync/v9/sync",
|
||||
url => $apiUrl."sync",
|
||||
data => $data,
|
||||
timeout => 7,
|
||||
method => "POST",
|
||||
|
Loading…
x
Reference in New Issue
Block a user