Guide
Quick start
Make a personal API token, check it, and list tasks with cURL.
This takes about five minutes. You need a projqo account in an organisation where API access is on, and a terminal with curl.
1. Make a token
- In projqo, open the organisation the token is for, then Personal settings › API tokens. A token works in that one organisation.
- Choose Make a token.
- In Name, write what it's for, so you know it later, such as "Weekly report script".
- Under Scopes, tick what it needs. For this guide:
org:readandtasks:read. - In Expires after, pick 30, 90 (the default) or 365 days, and choose Make token.
- Under Copy your token now, choose Copy. The token starts with
pqt_and is shown only once.
2. Keep it in your terminal
export PROJQO_TOKEN="pqt_…"
export PROJQO_API="https://<your projqo address>/api/v1"3. Check who you are
curl "$PROJQO_API/me" \
-H "Authorization: Bearer $PROJQO_TOKEN"The answer describes the person the token belongs to. A 401 means the token is wrong, expired or revoked: check you copied all of it.
4. Find your organisation's id
curl "$PROJQO_API/orgs" \
-H "Authorization: Bearer $PROJQO_TOKEN"The answer lists the organisations this token may use; a personal token has exactly one. Keep its id:
export PROJQO_ORG="<the organisation's id>"5. List tasks
Ask for the tasks assigned to you that aren't done, the most recently changed first:
curl -G "$PROJQO_API/orgs/$PROJQO_ORG/tasks" \
-H "Authorization: Bearer $PROJQO_TOKEN" \
--data-urlencode 'q=assignee = currentUser() AND statusCategory != Done' \
--data-urlencode 'sort=-updated' \
--data-urlencode 'limit=20'The answer is a page of tasks:
{
"items": [
{
"id": "6f1c2a9e-3b7d-4e21-9a55-0c8d2f4b7e10",
"key": "WEB-12",
"summary": "Fix the sign-in redirect",
"status": { "id": "…", "name": "In progress", "category": "In progress" }
}
],
"next_cursor": "…"
}Each task carries more fields than shown here; the reference lists them all. When next_cursor isn't null, there are more: send it back as cursor to get the next page (see paging).
q takes the same query language as Advanced search in projqo. See the query language.
6. Clean up
When you've finished trying things out, revoke the token in Personal settings › API tokens. A revoked token stops working at once.
Next
- Authentication: tokens, expiry and revoking.
- Scopes: what each scope allows.
- Errors: what each code means and how to fix it.