Triggers: Difference between revisions

m
no edit summary
mNo edit summary
mNo edit summary
Line 361: Line 361:
//    created using the guid() global function.
//    created using the guid() global function.
var commands='[{"uuid":"' + guid() + '","temp_id":"' + guid() +
var commands='[{"uuid":"' + guid() + '","temp_id":"' + guid() +
     '","type":"item_add","args":{"content":"' + entry().field("Task") + '"}}]'
     '","type":"item_add","args":{"content":"' + entry().field("Task") + '"}}]';


// Execute the HTTP request. An attribute called '''token''' is used
// Execute the HTTP request. An attribute called '''token''' is used
Line 370: Line 370:
//    use the standard function encodeURIComponent() to filter them out.
//    use the standard function encodeURIComponent() to filter them out.
result = http().get("https://todoist.com/API/v7/sync?token=15281e8e4d499dаff817af0b14112eac3176f9dc&commands=" +
result = http().get("https://todoist.com/API/v7/sync?token=15281e8e4d499dаff817af0b14112eac3176f9dc&commands=" +
     encodeURIComponent(commands))
     encodeURIComponent(commands));


// Show the user a message indicating successful creation of the task.
// Show the user a message indicating successful creation of the task.
if (result.code == 200) message('Task has been successfully created")
if (result.code == 200) message('Task has been successfully created");
</source>
</source>