#4368: Quire Feedback
Status: Completed
Tag: Resolved

The API docs (https://quire.io/dev/api/#tag-task) mention using - as the project id or oid to retrieve the 'My Tasks' list for a user.

This does not appear to work, with calls to task/list/- returning an empty set of results. The same applies for the task/search endpoints.

curl 'https://quire.io/api/task/list/-' \
  -H 'authorization: Bearer ACCESS_TOKEN' \
  --compressed ;
# []

Calling these endpoints with a project id/oid does return the expected set of results.

Created by Karel Kroeze Mar 30, 2021, Edited Apr 9, 2021

Hi @Karel_Kroeze - After confirming again with our engineering team, they have stated that with calls to task/list/- will only return to Inbox (which are tasks that doesn't belong to any projects; personal tasks).

We are sorry we we haven't stated this clearly in our API doc. We will revise the doc as soon as possible!

Peggy, Apr 8, 2021

Hi @peggy, thanks for looking into it.

Unfortunately, I still have the same issues. The app in question can be found here; https://quire.io/oauth?client_id=:GjnNMLX5_ngOInXumGLu0S303kj&redirect_uri=https%3A%2F%2Fpomo-auth.karel-kroeze.nl%2Fquire%2Fcallback. (I'm building a Pomodoro timer with Quire integration, mostly as a toy project for now).

I've given the app these authorizations; image.png

The relevant bits of code for the API call are;

import axios from "axios";
import dayjs from "dayjs";

export class QuirePlugin {
    private apiBaseUrl = "https://quire.io/api/";

    get api() {
        return axios.create({
            baseURL: this.apiBaseUrl,
            headers: { Authorization: `Bearer ${this.getToken().access}` },
        });
    }

    getTasks = async () => {

       // logic for updating access token

        /**
         * TODO: keep track of https://quire.io/w/Quire_Feedback/4368/API_list_'My_Tasks'_returns_no_results?view=tree
         * * This SHOULD work, but doesn't.
         */
        const response = await this.api.get(`task/list/-`);
        console.log({ data: response.data });    // {data: Array(0)}

         /**
         * * so let's brute force it for now;
         * 1; get all projects
         * 2; get all tasks
         * 3; filter active today
         */
        const now = dayjs();
        const projects = await this.api
            .get<Project[]>(`project/list`)
            .then((response) => response.data)
            .then((projects) =>
                projects.filter(
                    (project) =>
                        (!project.archivedAt ||
                            now.isBefore(project.archivedAt)) &&
                        project.taskCount > 0
                )
            );

        const tasks: Task[] = [];

        for (const project of projects) {
            const projectTasks = await this.api
                .get<Task[]>(`task/search/${project.oid}`, {
                    params: { status: "active" },
                })
                .then((response) => response.data)
                .then((tasks) => {
                    tasks.forEach((task) => (task.project = project));
                    return tasks.filter((task) => {
                        if (!task.due) return false;
                        if (
                            now.isSame(task.due, "day") ||
                            now.isAfter(task.due)
                        )
                            return true;
                        if (task.start && now.isAfter(task.start)) return true;
                        return false;
                    });
                });
            tasks.push(...projectTasks);
        }

        console.log({ tasks }); // {tasks: Array(2)}
    }
}

You can see this in action on https://pomo.karel-kroeze.nl/ as well, by clicking the image.png (options) icon above the task list, and selecting "Load today's tasks from Quire". You'll have to do that twice, once for the auth grant, and then again for loading tasks. It's currently using both approaches, and logging to the console.

Note that this is a dev version of a personal toy project, so there are very likely to be other issues, but I do believe this is a Quire issue. Either in the API, or because the docs aren't clear on what the API is supposed to do/how it's supposed to be used.

Karel Kroeze, Apr 7, 2021

oh, on a related note, there are a number of things I'd like to request for the API that I don't think have been mentioned before, should I elaborate on them here, make a single new feedback task, or separate tasks for each request?

Some limitations I've run into include;

  • searching by start/due date,
  • getting parent information from tasks (e.g. containing project, parent task) without having to do a top-down traverse of the whole project tree (rate limits make that infeasible),

and the rather sorry state of the API docs as a whole, but I'll let that slide for now since I do love Quire.

Karel Kroeze, Apr 7, 2021

Hi @Karel_Kroeze - Our team have gave this issue some tests. Unfortunately, they weren't able to reproduce this on their end. Could you please let us know if you have authorized API to access All projects? Thank you for your help in advance.

Peggy, Apr 7, 2021

Hi @Karel_Kroeze - I will pass your feedback to our engineering team and keep you posted if I get an update. Thank you!

Peggy, Apr 1, 2021

Hi @Karel_Kroeze - Thanks for the prompt reply! I have passed the additional information to our team and they will look into it. Will keep you posted if I get update from them.

For the limitations that you think are missing for the API, please kindly separate them into different threads for us, so it would be better to keep track of them. Also, it would be extra helpful if you can search within the existing feedback and see if other users have already open similar ones before. Thanks so much for your help!

Peggy, Apr 7, 2021

You cought me while I was procrastinating, so I had some time ;).

As for the API requests, I'll do some homework and then post them separately if needed, thank you.

Karel Kroeze, Apr 7, 2021

Hi @Karel_Kroeze - Here are some information that I got from our engineering team:

  1. With calls to task/list/- will only return to Inbox (which are tasks that doesn't belong to any projects).
  2. Could you please let us know whether you have tasks that belongs to Inbox (tasks that are in My Tasks, but don't belong to any projects; tasks created by pressing the keyboard shortcut m)?

Peggy, Apr 7, 2021

Hi Peggy, I don't think I do, and that would explain my results. I can try to verify that tonight (in about 8 hours).

Note that the API docs do not mention these calls being limited to Inbox or non-assigned tasks, but just refer to 'My Tasks', which I assumed referred to all active tasks assigned to me across all projects, as it does in the web client.

Karel Kroeze, Apr 7, 2021