Skip to content
Chris Sweet edited this page Mar 17, 2023 · 17 revisions

API calls for website functionality

Notes

  1. Ordering of data is important. Mostly need alphabetic but date latest first for cards?

View PAD cards

  1. Calls API to get list of project names/ids, api/v2/projects
  2. Calls API with user's choice of project to get all Card data for that project, api/v2/cards/project/<project id>.
  3. Puts information into tables with pagination, loads processed images.

Implementaion

Calling /api/v2/projects gets a list of projects and their info.

Calling /api/v2/projects/{id}/cards gets the list of cards associated with that project

Print cards

  1. Calls API to get list of project names/ids, api/v2/projects and the next card number (max card_id_end from cardinfo) api/v2/cardinfo/card_id_end/max (this is a hard one to define).
  2. Lets user select a project (optional) and collects card information like annotation and comment
  3. Generates artwork and stores card information into cardinfo, api/v2/cardinfo.

Create/Edit project

  1. Calls API to get list of project names/ids, api/v2/projects
  2. Gets all info for the selected project, api/v2/projects/<project id> (or maybe the projects endpoint just sends everything back?)
  3. Lets user select a project (or not for "create") and allows them to edit or enter fields, saves to api/v2/projects/<project id> if id known else api/v2/projects.

Implementation

Create project by POST request to /api/v2/projects/

Update project by PUT request to /api/v2/projects/{id}

Add new Card layout

  1. Calls API to get list of reagents, api/v2/reagents
  2. User enters info for a new Card layout, name, notes and selects from a list of 12 reagents for each lane.
  3. Saves new Card layout to api/v2/tests

Add new Lane

  1. User enters info for a new Lane, name, notes
  2. Saves new Lane to api/v2/reagents

Add new Sample

  1. User enters info for a new Sample, name
  2. Saves new Sample to api/v2/samples

Remove Card layout, Lane, Sample (substitute for * below)

  1. Calls API to get list of *, api/v2/*
  2. User selects the item to be removed to get id
  3. Removes * to api/v2/*/<id>