Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
217 changes: 217 additions & 0 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ tags:
description: '"What''s new in Makerble" popups, written and scheduled by Makerble staff in Site Overview'
- name: Wishlist
description: The gift icon's Wishlist - your feature requests and feedback, and what Makerble is building next (Coming soon)
- name: Saved Filters
description: Saved Filters for Contacts, Events and Cases, and adding one to a project's toolbar as a shortcut
- name: Albums
description: Albums (Bundles; being renamed Portfolios on screen) group Projects so their results can be seen together
- name: Age Bands
Expand Down Expand Up @@ -1214,6 +1216,113 @@ paths:
$ref: '#/components/responses/NotFound'
"422":
$ref: '#/components/responses/UnprocessableEntityList'
/saved_filters:
get:
tags: [Saved Filters]
summary: List Saved Filters
description: |
The Saved Filters for Contacts, Events and Cases that you can see: your own, and the ones colleagues
have shared. These are the filters listed on a project's Workflow › Saved filters tab, ready to be
added to a project's toolbar as a shortcut. `project_ids` are the projects named in the filter's
criteria; a filter can be added only to one of those projects. `can_add_shortcut` is true when you
can add it to at least one of them.
operationId: listSavedFilters
security: [{tokenAuth: []}]
parameters:
- name: type
in: query
required: false
description: Only Saved Filters of this kind.
schema:
type: string
enum: [contacts, events, cases]
- $ref: '#/components/parameters/Page'
- $ref: '#/components/parameters/PerPage'
- $ref: '#/components/parameters/LastSyncDatetime'
responses:
"200":
description: Paginated Saved Filters, by name
content:
application/json:
schema:
$ref: '#/components/schemas/PaginatedSavedFilters'
"401":
$ref: '#/components/responses/Unauthorized'
"422":
$ref: '#/components/responses/UnprocessableEntity'
/saved_filters/{id}:
parameters:
- name: id
in: path
required: true
schema:
type: integer
get:
tags: [Saved Filters]
summary: Get a Saved Filter
description: |
One Saved Filter, with what you need to add it to a project's toolbar: `shortcut_views`, the views
of its app the shortcut can open (e.g. Contacts › Overview, or one of your Custom tables), and
`shortcut_projects`, the projects you can add it to. `shortcut_projects` is empty when
`can_add_shortcut` is false.
operationId: getSavedFilter
security: [{tokenAuth: []}]
responses:
"200":
description: The Saved Filter
content:
application/json:
schema:
$ref: '#/components/schemas/SavedFilterDetail'
"401":
$ref: '#/components/responses/Unauthorized'
"404":
$ref: '#/components/responses/NotFound'
/saved_filters/{id}/shortcuts:
parameters:
- name: id
in: path
required: true
schema:
type: integer
post:
tags: [Saved Filters]
summary: Add a Saved Filter to a project's toolbar
description: |
Adds the Saved Filter to a project's toolbar (its Workflow) as a shortcut, as the Saved Filter's
Add to workflow button does. Clicking the shortcut opens the chosen view with the filter applied.
The shortcut goes first on the toolbar; move it with Adjust toolbar.

Choose `project_id` from the filter's `shortcut_projects` and `view_key` from its `shortcut_views`
(GET /saved_filters/{id}). You need to be an Organisation Admin, or an Editor of the project.
Colleagues who can't see the Saved Filter don't see its shortcut.
operationId: createSavedFilterShortcut
security: [{tokenAuth: []}]
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SavedFilterShortcutInput'
example:
project_id: 42
view_key: contacts_overview
name: Young carers
responses:
"201":
description: The shortcut
content:
application/json:
schema:
$ref: '#/components/schemas/SavedFilterShortcut'
"401":
$ref: '#/components/responses/Unauthorized'
"403":
$ref: '#/components/responses/ForbiddenError'
"404":
$ref: '#/components/responses/NotFound'
"422":
$ref: '#/components/responses/UnprocessableEntity'
/tours:
get:
tags: [Welcome Tours]
Expand Down Expand Up @@ -17126,6 +17235,114 @@ components:
description: True once Makerble has seen it done. It stays done.
not_relevant:
type: boolean
SavedFilter:
type: object
properties:
id:
type: integer
name:
type: string
type:
type: string
enum: [contacts, events, cases]
description: What the filter filters
organisation_id:
type: integer
nullable: true
shared:
type: boolean
description: Whether the owner shared it with colleagues
project_ids:
type: array
items:
type: integer
description: The projects named in the filter's criteria. The filter can be added only to these projects' toolbars.
can_add_shortcut:
type: boolean
description: Whether you can add it to a project's toolbar
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
PaginatedSavedFilters:
type: object
properties:
page:
type: integer
page_size:
type: integer
page_count:
type: integer
total_count:
type: integer
data:
type: array
items:
$ref: '#/components/schemas/SavedFilter'
SavedFilterDetail:
allOf:
- $ref: '#/components/schemas/SavedFilter'
- type: object
properties:
shortcut_views:
type: array
description: The views a shortcut to this filter can open
items:
type: object
properties:
key:
type: string
example: contacts_overview
label:
type: string
example: Overview
group:
type: string
description: In-built views, or Custom tables
shortcut_projects:
type: array
description: The projects you can add this filter to
items:
type: object
properties:
id:
type: integer
name:
type: string
SavedFilterShortcutInput:
type: object
required: [project_id, view_key]
properties:
project_id:
type: integer
description: One of the Saved Filter's `shortcut_projects`
view_key:
type: string
description: One of the Saved Filter's `shortcut_views`
name:
type: string
description: The shortcut's label on the toolbar. Defaults to the Saved Filter's name.
SavedFilterShortcut:
type: object
properties:
id:
type: integer
name:
type: string
project_id:
type: integer
saved_filter_id:
type: integer
view_key:
type: string
created_at:
type: string
format: date-time
updated_at:
type: string
format: date-time
AnnouncementNameChange:
type: object
required: [old_name, new_name]
Expand Down
36 changes: 36 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,7 @@ function buildDocsPage() {
<div class="nav-section-label">Core resources</div>
<a href="#organisations" class="nav-link"><span class="nav-method method-GET">GET</span>Organisations</a>
<a href="#projects" class="nav-link"><span class="nav-method method-GET">GET</span>Projects</a>
<a href="#saved-filters" class="nav-link"><span class="nav-method method-POST">POST</span>Saved Filters</a>
<a href="#albums" class="nav-link"><span class="nav-method method-GET">GET</span>Albums (Portfolios)</a>
<a href="#signup-pages" class="nav-link"><span class="nav-method method-POST">POST</span>Signup Pages</a>
<a href="#users" class="nav-link"><span class="nav-method method-POST">POST</span>Users</a>
Expand Down Expand Up @@ -1344,6 +1345,41 @@ function buildDocsPage() {
</div>
</section>

<!-- Saved Filters -->
<section class="section" id="saved-filters">
<div class="section-eyebrow">Core resource</div>
<h2 class="section-title">Saved Filters</h2>
<div class="section-desc">
<p>A <strong>Saved Filter</strong> is a filter on Contacts, Events or Cases that someone saved, either for themselves or shared with colleagues. Any of them can be added to a Project's toolbar (its Workflow) as a <strong>shortcut</strong>: clicking it opens the chosen view, such as Contacts &rsaquo; Overview, Events &rsaquo; Calendar or one of your Custom tables, with the filter applied.</p>
<p>A Saved Filter can be added only to a Project named in its criteria (<code>project_ids</code>), by an Organisation Admin or an Editor of that Project. Colleagues who can't see the Saved Filter don't see its shortcut. To add one: list the filters, get one for its <code>shortcut_views</code> and <code>shortcut_projects</code>, then post a shortcut with one of each.</p>
</div>
<div class="endpoint-list">
${endpointCard("GET", "/saved_filters", "List Saved Filters", true, [
{ name: "type", type: "string", required: false, desc: "Only <code>contacts</code>, <code>events</code> or <code>cases</code> filters" },
{ name: "page", type: "integer", required: false, desc: "Page number" },
{ name: "per_page", type: "integer", required: false, desc: "Records per page (default 10, max 200)" },
{ name: "last_synced_datetime", type: "string", required: false, desc: "ISO 8601 incremental sync" }
], [
{ code: "200", cls: "response-2xx", desc: "Paginated Saved Filters you can see, your own and colleagues' shared ones, by name, each with <code>type</code>, <code>project_ids</code> and <code>can_add_shortcut</code>" },
{ code: "422", cls: "response-4xx", desc: "Unknown <code>type</code>" }
])}
${endpointCard("GET", "/saved_filters/{id}", "Get a Saved Filter", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "Saved Filter ID" }
], [
{ code: "200", cls: "response-2xx", desc: "The Saved Filter, with <code>shortcut_views</code> (each <code>key</code>, <code>label</code>, <code>group</code>) and <code>shortcut_projects</code> (each <code>id</code>, <code>name</code>; empty when <code>can_add_shortcut</code> is false)" },
{ code: "404", cls: "response-4xx", desc: "Not found, or not one you can see" }
])}
${endpointCard("POST", "/saved_filters/{id}/shortcuts", "Add a Saved Filter to a Project's toolbar", true, [
{ name: "id", in: "path", type: "integer", required: true, desc: "Saved Filter ID" }
], [
{ code: "201", cls: "response-2xx", desc: "The shortcut, first on the Project's toolbar" },
{ code: "403", cls: "response-4xx", desc: "You aren't an Organisation Admin or a Project Editor in the filter's Organisation" },
{ code: "404", cls: "response-4xx", desc: "Not found, or not one you can see" },
{ code: "422", cls: "response-4xx", desc: "A Project outside the filter's criteria, an unknown view, a name already used on that toolbar, or a filter whose criteria name no Project" }
], "Body: <code>project_id</code> (one of the filter's <code>shortcut_projects</code>), <code>view_key</code> (one of its <code>shortcut_views</code>), and optionally <code>name</code>, the shortcut's label, which defaults to the filter's name. Move the shortcut afterwards with Adjust toolbar.")}
</div>
</section>

<!-- Albums -->
<section class="section" id="albums">
<div class="section-eyebrow">Core resource</div>
Expand Down
Loading