Here’s Scriptable app script you can call from Shortcuts. Update server url and API token.
Haven’t used it in a while, pardon if it does not work.
Script
`// Vikunja Task Creator Script for Scriptable
// This script performs a PUT request to create/update a task in Vikunja API.
// Title and description are parametric: passed via args.plainTexts[0] and args.plainTexts[1],
// or prompted if not provided.
// Check for passed arguments (e.g., from Shortcuts)
let title = args.plainTexts[0]
let description = args.plainTexts[1]
// title = “123333”
// description = “777777”
// Build the JSON payload
let payload = {
“max_right”: null,
“id”: 0,
“title”: title,
“description”: description,
“done”: false,
“done_at”: null,
“priority”: 0,
“labels”: ,
“assignees”: ,
“due_date”: null,
“start_date”: null,
“end_date”: null,
“repeat_after”: 0,
“repeat_from_current_date”: false,
“repeat_mode”: 0,
“reminders”: ,
“parent_task_id”: 0,
“hex_color”: “”,
“percent_done”: 0,
“related_tasks”: {},
“attachments”: ,
“cover_image_attachment_id”: null,
“identifier”: “”,
“index”: 0,
“is_favorite”: false,
“subscription”: null,
“position”: 0,
“reactions”: {},
“comments”: ,
“created_by”: {
“max_right”: null,
“id”: 0,
“email”: “”,
“username”: “”,
“name”: “”,
“exp”: 0,
“type”: 0,
“created”: null,
“updated”: null,
“settings”: {
“max_right”: null,
“name”: “”,
“email_reminders_enabled”: true,
“discoverable_by_name”: false,
“discoverable_by_email”: false,
“overdue_tasks_reminders_enabled”: true,
“week_start”: 0,
“timezone”: “”,
“language”: “en”,
“frontend_settings”: {
“play_sound_when_done”: true,
“quick_add_magic_mode”: “vikunja”,
“color_schema”: “auto”,
“default_view”: “first”
}
}
},
“created”: “1970-01-01T00:00:00.000Z”,
“updated”: “1970-01-01T00:00:00.000Z”,
“project_id”: 1,
“bucket_id”: 0,
“reminder_dates”: null
};
// Set up the request
let req = new Request(“https://vikunja.com/api/v1/projects/1/tasks”);
req.method = “PUT”;
req.headers = {
“User-Agent”: “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:134.0) Gecko/20100101 Firefox/134.0”,
“Accept”: “application/json, text/plain, /”,
“Accept-Language”: “en-US,en;q=0.5”,
“Accept-Encoding”: “gzip, deflate, br, zstd”,
“Content-Type”: “application/json”,
“Authorization”: “Bearer tk_bla-bla”,
“Origin”: “http://127.0.0.1:4173”,
“DNT”: “1”,
“Sec-GPC”: “1”,
“Connection”: “keep-alive”,
“Referer”: “http://127.0.0.1:4173/”,
“Sec-Fetch-Dest”: “empty”,
“Sec-Fetch-Mode”: “cors”,
“Sec-Fetch-Site”: “cross-site”,
“Priority”: “u=0”,
“Pragma”: “no-cache”,
“Cache-Control”: “no-cache”,
“TE”: “trailers”
};
req.body = JSON.stringify(payload);
// Perform the request and handle response
let response = req.loadJSON();
console.log(response); // Log response to console for debugging
Script.complete()`