# The boards' and the checklists' API
Both on the application they are about: `H=http://localhost/my.oviepro` (no login on localhost). Every answer is `{"data": ...}`; an error is a 4xx with `data.error`.
## Boards (mmo.admin's `BoardController`)
| | |
|---|---|
| `GET $H/api/boards.json` | `{boards: [{name, title, version, updatedAt, tickets}]}` |
| `GET $H/api/boards/{board}.json` | `{board, version, updatedAt, data: {statuses, labels, categories, people, tickets}}`; each ticket says how many `comments` it has. An unknown board is empty, version 0. |
| `PUT $H/api/boards/{board}.json` `{version, data}` | the whole board; 409 with the board as it is when it was saved meanwhile |
| `GET $H/api/boards/{board}/prompts.json?agent=claude&status=todo&done=1` | the ```` ```claude ```` prompts of the tickets; `markdown` is the brief |
| `GET $H/api/boards/{board}/{ticket}/comments.json` | a ticket's discussion, oldest first |
| `POST $H/api/boards/{board}/{ticket}/comments.json` `{body, parent}` | add a comment (markdown) |
| `PUT .../comments/{comment}.json` `{body}`, `DELETE .../comments/{comment}.json` | change, delete one |
A ticket: `{id, title, description, status, category, labels, parent, start, end, assignee, constraint, startedAt, doneAt}`.
```bash
# a comment, whatever its quotes and newlines
jq -n --arg body "$BODY" '{body: $body}' | curl -s -X POST -H 'Content-Type: application/json' --data-binary @- "$H/api/boards/my.oviepro-deploy/12/comments.json"
```
```python
# move tickets: read, change, put back whole with its version
import json, urllib.request
API = 'http://localhost/my.oviepro/api/boards/my.oviepro-deploy'
def call(method, url, body=None):
req = urllib.request.Request(url, method=method, data=json.dumps(body).encode() if body is not None else None,
headers={'Content-Type': 'application/json', 'Accept': 'application/json'})
return json.load(urllib.request.urlopen(req))['data']
board = call('GET', API + '.json')
for t in board['data']['tickets']:
if t['id'] in FIXED: t['status'] = 'review'
call('PUT', API + '.json', {'version': board['version'], 'data': board['data']})
```
## Checklists (mmo.admin's `ChecklistController`)
| | |
|---|---|
| `GET $H/api/checklists.json` | `{default, checklists: [{name, title, description, board, version, updatedAt, release, progress, declared}]}` |
| `GET $H/api/checklists/{name}.json` | the checklist, its `progress`, and `tickets`: each ticket its items name, `{title, status, total, checked, verified}` |
| `PUT $H/api/checklists/{name}.json` `{version, title, description, board, boardUrl, members, recipe, items}` | create (version 0) or change; `items` keep their checks |
| `POST $H/api/checklists/{name}/build.json` | rebuild the items from the recipe; `build: {orphans, unmatched}` |
| `PUT $H/api/checklists/{name}/items/{item}.json` `{checked, member}` | check an item (`member` when the checklist has members) |
| `POST $H/api/checklists/{name}/reset.json` `{name}` | a new round (a release to check): every box unchecked, a line of `history` |
| `POST $H/api/checklists/{name}/tickets/{ticket}/done.json` | move a verified ticket to the board's done status, with a comment |
The page: `$H/admin/checklists?name={name}` (`&ticket=12` shows only that ticket's items).