Actions10
Overview
This node integrates with the Dragon Family API to manage daily todo tasks for members. Specifically, the "Update Daily Todo" operation allows users to modify an existing daily todo item by specifying its ID and date, along with optional updates such as title, reward amount (dragons), and active weekdays.
Common scenarios include:
- Updating task details for a member's daily todo list.
- Adjusting rewards or scheduling for recurring todos.
- Modifying titles or descriptions of daily tasks without recreating them.
Practical example:
A user wants to update the title and reward of a daily todo scheduled on 2024-06-15 with ID 8446164. They can use this node to patch those fields via the API, ensuring the todo reflects the latest requirements.
Properties
| Name | Meaning |
|---|---|
| Base URL | The base URL for the Dragon Family API (default: https://api.dragonfamily.com). |
| User Token | Your API access token sent as a Bearer token in the Authorization header. |
| Todo ID | The unique identifier of the todo item to update (e.g., 8446164). |
| Date | The date for which the todo is updated, formatted as YYYY-MM-DD. |
| Title | New title for the todo item. |
| Description | New description for the todo (currently always set to empty string in code). |
| Dragons | New reward amount (number of dragons) associated with the todo. |
| Image ID | New image ID for the todo (currently always set to null in code). |
| Week Days | Comma-separated list of weekdays (0=Monday, 6=Sunday) to update the todo's active days. Leave empty to keep unchanged. |
Output
The node outputs a JSON object representing the response from the Dragon Family API after updating the daily todo. This typically includes the updated todo details confirming the changes.
No binary data output is produced by this operation.
Example output structure (simplified):
{
"id": "8446164",
"date": "2024-06-15",
"title": "Updated Todo Title",
"description": "",
"default_max_dragons": 10,
"week_days": [0,1,2,3,4],
"image": null,
...
}
Dependencies
- Requires access to the Dragon Family API endpoint.
- Needs a valid API access token provided as a Bearer token in the Authorization header.
- The node uses HTTP PATCH requests to update the todo resource at the path
/scheduler/v3/todo/{date}/{todoId}/.
Troubleshooting
- Invalid or missing token: If the API token is incorrect or missing, the request will fail authorization. Ensure the token is valid and correctly entered.
- Incorrect Todo ID or Date: Providing an invalid todo ID or date format may result in a 404 Not Found or validation error. Verify the todo ID exists and the date is in
YYYY-MM-DDformat. - Empty or malformed weekDays: The weekDays property must be a comma-separated list of integers between 0 and 6. Invalid values will be ignored or cause errors.
- API endpoint unreachable: Network issues or incorrect Base URL configuration can cause connection failures. Confirm the Base URL is correct and accessible.
- Description and Image fields: These are currently hardcoded to empty and null respectively; attempts to update them via input properties will have no effect.
Links and References
- Dragon Family API Documentation (Assumed URL based on base URL)
- n8n HTTP Request Node Documentation - for understanding how HTTP requests are made within n8n nodes.