My work

The open cards assigned to you, across every board.

GET /api/data/my-work

The cards assigned to the account the request acts as — with an API key, the account that issued it. Only work still expected of it: a card that is done, or archived, or sits in an archived area or on an archived board is left out, and so is one on a board the account is no longer on.

Earliest due first, then the cards with no date. At most 500.

The dashboard groups these into overdue, this week and later. That grouping is not in the response, because it depends on what "today" is where you are; work it out against your own clock.

What comes back

FieldTypeDescription
cardsarrayEach card's id, name and dueDate; boardId and boardName; areaId and areaName; its labels as id and name; and checklist, the done and total of the checklist in its description.
curl "https://boards.example.com/api/data/my-work" \
  -H "X-API-Key: $LOKALBOARDS_KEY"
const response = await fetch("https://boards.example.com/api/data/my-work", {
  headers: { "X-API-Key": apiKey },
});

if (!response.ok) throw new Error(await response.text());

const { cards } = await response.json();
const overdue = cards.filter(
  (card) => card.dueDate && new Date(card.dueDate) < new Date(),
);
<script setup>
const config = useRuntimeConfig();

const { data } = await useAsyncData("my-work", () =>
  $fetch("https://boards.example.com/api/data/my-work", {
    headers: { "X-API-Key": config.lokalBoardsKey },
  }),
);

const cards = computed(() => data.value?.cards ?? []);
</script>

<template>
  <ul>
    <li v-for="card in cards" :key="card.id">
      {{ card.name }} — {{ card.boardName }} · {{ card.areaName }}
    </li>
  </ul>
</template>
import { useEffect, useState } from "react";

export function MyWork({ apiKey }) {
  const [cards, setCards] = useState([]);

  useEffect(() => {
    fetch("https://boards.example.com/api/data/my-work", {
      headers: { "X-API-Key": apiKey },
    })
      .then((response) => response.json())
      .then((data) => setCards(data.cards));
  }, [apiKey]);

  return (
    <ul>
      {cards.map((card) => (
        <li key={card.id}>
          {card.name} — {card.boardName} · {card.areaName}
        </li>
      ))}
    </ul>
  );
}
<?php

$ch = curl_init('https://boards.example.com/api/data/my-work');

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'X-API-Key: ' . $apiKey,
]);

$cards = json_decode(curl_exec($ch), true)['cards'];
curl_close($ch);