API reference
Contents
API Authentication
API_TOKEN for your account and set it in the HTTP header for requests made to the API:
X-auth-token="YOUR-API-TOKEN"
YOUR-API-TOKEN is the value of your API TOKEN.
You are not logged in. You need to log in to view/manage your API TOKEN.
Resource collections & API endpoints
annotation
Annotation resource. Links label objects to point objects. Also stores comments, tag associations, review flags, probability estimates, linked observations, etc...
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/annotation Create new annotation object. Expects JSON. Fields shown in Preprocessors:
|
| GET |
/api/annotation Get list of annotation objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/annotation/<id> Get single annotation object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/annotation/<id> Delete single annotation object with pk field matching param Preprocessors:
|
| PATCH |
/api/annotation Batch update annotation objects. Set CAUTION: this endpoint can batch update many annotations in a single request! If used incorrectly, you can
loose your annotations and any annotations that have been shared with you for which you have been granted edit
access. Please use with caution.
TIP: Test your search query ( PATCH request data must be JSON with the following fields:
|
| PATCH |
/api/annotation/<int:id>
None
|
| DELETE |
/api/annotation/<int:annotation_id>/tag/<int:tag_id>
None
|
| PATCH |
/api/annotation/<int:id>/link/<int:link_id> Updates |
| GET |
/api/annotation/<int:id>/versions View all previous versions of this annotation, i.e.: a change log. |
| DELETE |
/api/annotation/<int:id>/link Unlink this annotation from the observation group. If it is a group parent, the first child will be set as the new parent. An observation group is used to link observations of the same object that has been annotated multiple times. |
| PATCH |
/api/annotation/<int:id>/link Set this annotation as the parent of the observation group. An observation group is used to link observations of the same object that has been annotated multiple times. |
| GET |
/api/annotation/export General annotation export endpoint. This can export annotations across multiple
annotation_sets. However, this endpoint is limited to a maximum of 200,000 annotations
in any single query. You can export more in separate queries using a combination of Export annotations matching query define in Querystring parameters are:
Where Metadata for the dataset is also returned in the response. Depending on the output
format, this could be as part of the response body in a Allowed fields include:
See annotation model columns, relations and attributes for more information on each of the included fields. TRANSLATING TO OTHER LABEL_SCHEMES The
Each label is matched by its The For example: To include the translation in the output, add the translation columns below to Additional allowed columns include:
These columns are ignored if no EXAMPLES |
| GET |
/api/annotation/tally/<group_by> Get a tally of annotations. The tally of annotations can be grouped by different properties. For ^ NOTE: the counts in the TRANSLATING TO OTHER LABEL_SCHEMES When using The
Each label is matched by its The For example: When translating, the output contains the additional columns: EXAMPLES |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| data | JSON() | {} | True | None | - | - | Text field containing JSON properties for this resource |
| label_id | Integer() | None | True | None | - | label.id | Foreign key |
| likelihood | Float() | 1.0 | True | None | - | - | (Optional) likelihood/probability of the label assignment |
| needs_review | Boolean() | False | True | None | - | - | Whether or not this annotation requires review |
| created_at | DateTime() | function | True | None | - | - | Creation time (UTC) |
| updated_at | TIMESTAMP() | function | True | None | - | - | Updated time (UTC) |
| user_id | Integer() | None | False | None | - | users.id | Foriegn key |
| point_id | Integer() | None | False | None | - | point.id | Foriegn key |
| annotation_set_id | Integer() | None | False | None | - | annotation_set.id | Foriegn key |
| comment | Text() | None | True | None | - | - | User comment |
| parent_id | Integer() | None | True | None | - | annotation.id |
|
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| label | label |
MANYTOONE | Related label object |
| user | users |
MANYTOONE | Related owner user object |
| point | point |
MANYTOONE | Related point object |
| annotation_set | annotation_set |
MANYTOONE | Related annotation_set object |
| parent | annotation |
MANYTOONE | Parent annotation in a linked set of observations |
| children | annotation |
ONETOMANY | Collection of linked child observations |
| annotation_tags | annotation_tags |
ONETOMANY | Collection of annotation_tags associations |
| versions | annotation_version |
ONETOMANY | None |
ASSOCIATION PROXIES FILTERABLE
| ATTRIBUTE | MODEL | COLLECTION | DESCRIPTION |
| tags | tag |
annotation_tags | Proxy attribute that presents the linked tag objects from the annotation_tags collection |
HYBRID ATTRIBUTES FILTERABLE
HYBRID METHODS may require input parameters.
| NAME | TYPE | ARGS | DESCRIPTION |
| is_child | property | - | BOOLEAN, whether or not this annotation has a linked parent annotation (queryable) |
| timestamp | property | - | The in-situ timestamp for when the annotated object was captured/sampled in the media frame.
Returns |
| timestamp_proximity | method | ts | Absolute difference in seconds of the in-situ timestamp and input |
| distance | method | lat, lon | FLOAT, distance (in meters) of closest linked pose relative to |
| xy_distance | method | x, y | FLOAT, euclidean distance to |
| matches_label | method | label_id, include_synonyms, include_descendants | BOOLEAN. True if this annotation's label matches the provided Usage via API (examples):
|
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| color | method | Implied color code for this annotation based on label assignment |
| current_user_can_edit | method | BOOLEAN, whether or not the current user has edit rights for this annotation as implied by the permissions of the parent annotation_set |
| observation_count | method | INT, denoting the number of linked observations of this object |
| pose | method | |
| pose_data | method | Properties for related pose item including any linked posedata fields |
| suggested_tags | method | |
| version_count | method | INT, denoting the number of changes in the version history of this object |
| linked_observations | property | List of annotation objects (as dicts) linked with the same |
| media | property | media object information for this annotation via |
| object_id | property | ID of observation group: ID of primary observation (parent annotation) if linked, otherwise own ID. |
| supplementary_label | property | Selected fiedls of supplementary labels for relates point. Returns |
| tag_names | property | Comma-delimited names of applied tags. Can also be used to set tags using comma-delimited tags when creating annotaions |
| translated_label_id | property | Returns |
annotation_set
Annotation Set resource: defines how the media objects contained in a media_collection should be annotated / analysed. Each media_collection can have multiple annotation_sets attached to it.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/annotation_set Create new annotation_set object. Expects JSON. Fields shown in Preprocessors:
|
| PATCH |
/api/annotation_set/<id> Update single annotation_set object with pk field matching param Preprocessors:
|
| GET |
/api/annotation_set Get list of annotation_set objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/annotation_set/<id> Get single annotation_set object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/annotation_set/<id> Delete single annotation_set object with pk field matching param Preprocessors:
|
| POST |
/api/annotation_set/<int:instance_id>/group/<int:group_id> Add object with id |
| DELETE |
/api/annotation_set/<int:instance_id>/group/<int:group_id> Remove resource with id |
| GET |
/api/annotation_set/<int:id>/export Export annotations from annotation_set matching Export annotations matching query define in Querystring parameters are:
Where Metadata for the dataset is also returned in the response. Depending on the output
format, this could be as part of the response body in a Allowed fields include:
See annotation model columns, relations and attributes for more information on each of the included fields. TRANSLATING TO OTHER LABEL_SCHEMES The
Each label is matched by its The For example: To include the translation in the output, add the translation columns below to Additional allowed columns include:
These columns are ignored if no EXAMPLES NB: the UI contains an "ADVANCED" option which can help build more complex export queries. |
| GET |
/api/annotation_set/<int:id>/annotations/validate Validate supplementary This endpoint accepts the The
Each label is matched by its The For example: |
| GET |
/api/annotation_set/<int:id>/media
None
|
| GET |
/api/annotation_set/<int:id>/annotations Returns list of annotation objects contained in the |
| GET |
/api/annotation_set/<int:id>/dashboards List the group_dashboards available for this annotation_set: those offered
for EXAMPLES |
| GET |
/api/annotation_set/<int:id>/summary Public summary of an annotation_set to help with dataset discovery. Returns non-sensitive
metadata (name, description, custodian, media_collection and label_scheme names, status flags and counts)
whether or not the current user has permission to view the annotation set, as well as EXAMPLES |
| GET |
/api/annotation_set/<int:id>/annotations/tally/<group_by> Get a tally of annotations for an The tally of annotations can be grouped by different properties. For ^ NOTE: the counts in the TRANSLATING TO OTHER LABEL_SCHEMES When using The
Each label is matched by its The For example: When translating, the output contains the additional columns: EXAMPLES |
| GET |
/api/annotation_set/<int:id>/labels/list/<list_type> Returns lists of the labels used in the |
| POST |
/api/annotation_set/<int:annotation_set_id>/media/<int:media_id> Add the media object with the ID |
| DELETE |
/api/annotation_set/<int:annotation_set_id>/media/<int:media_id> Remove the media object with the ID |
| POST |
/api/annotation_set/<int:id>/clone Clone the annotation_set matching Labels can also be translated to another label scheme with the The
Each label is matched by its The For example: |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| data | JSON() | {} | True | None | - | - | Text field containing JSON properties for this resource |
| name | String(length=80) | None | False | None | - | - | None |
| description | Text() | None | True | None | - | - | None |
| media_collection_id | Integer() | None | False | None | - | media_collection.id | None |
| label_scheme_id | Integer() | None | False | None | - | label_scheme.id | None |
| user_id | Integer() | None | False | None | - | users.id | Foreign key reference for ID of related owner users model |
| created_at | DateTime() | function | False | None | - | - | None |
| parent_id | Integer() | None | True | None | - | annotation_set.id | None |
| is_exemplar | Boolean() | False | True | None | - | - | None |
| is_full_bio_score | Boolean() | None | True | None | - | - | whether or not the intent was full biodiversity scoring, or just targeted scoring |
| is_real_science | Boolean() | None | True | None | - | - | whether or not this is for science, or was for education / training / testing |
| is_qaqc | Boolean() | False | True | None | - | - | whether or not the annotation set has been QA/QC'd |
| is_final | Boolean() | False | True | None | - | - | whether or not the annotator has completed annotating |
| type | String(length=80) | base | True | None | - | - | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| media_collection | media_collection |
MANYTOONE | None |
| label_scheme | label_scheme |
MANYTOONE | None |
| user | users |
MANYTOONE | Related owner users model |
| parent | annotation_set |
MANYTOONE | None |
| usergroups | groups |
MANYTOMANY | List of groups objects that contain this resource |
| points | point |
ONETOMANY | List of point objects |
| annotations | annotation |
ONETOMANY | List of related annotation objects |
| children | annotation_set |
ONETOMANY | None |
| files | annotation_set_file |
ONETOMANY | None |
HYBRID ATTRIBUTES FILTERABLE
HYBRID METHODS may require input parameters.
| NAME | TYPE | ARGS | DESCRIPTION |
| media_count | property | - | Number of media items in the media_collection |
| annotation_count | property | - | Total number of labeled annotations this |
| is_child | property | - | BOOLEAN, whether or not this annotation has a linked parent annotation |
| is_public | property | - | Whether or not this object is public (i.e. shared in a public group) |
| current_user_is_owner | property | - | Whether the current logged in user is the owner of this object |
| current_user_is_member | property | - | Whether the current logged in user is a member of a group that includes this object |
| current_user_is_edit_member | property | - | Whether the current logged in user is a member with edit permission of a group that includes this object |
| current_user_is_group_owner | property | - | Whether the current logged in user is the owner of a group that includes this object |
| current_user_can_view | property | - | Whether or not the current user has permission to view this object |
| current_user_can_edit | property | - | Whether the current logged in user has edit permission (owner or edit_member) |
| user_is_owner | method | user_id | Whether the specified user is the owner of this object |
| user_is_member | method | user_id | Whether the specified user is a member of a group that includes this object |
| user_is_edit_member | method | user_id | Whether the specified user is a member with edit permission of a group that includes this object |
| user_is_group_owner | method | user_id | Whether the specified user is the owner of a group that includes this object |
| user_can_view | method | user_id | Returns true is user is owner, dataset belongs to a public group, user owns a group or dataset belongs to an unrestricted group that user is a member of |
| user_can_edit | method | user_id | Whether the specified user has edit permission (owner or edit_member) |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| point_count | method | None |
| preserve_object_links | method | Preserve linking of annotations (observation groups) for cloning and import of annotations @return: |
| unannotated_point_count | method | None |
| usergroup_count | method | None |
annotation_set_file
Annotation Set File resource: a file associated with a annotation_set object. Can be used for batch importing / updating of annotation and point objects, as well as batch adding media objects to a media_collection.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/annotation_set_file Create new annotation_set_file object. Expects JSON. Fields shown in Preprocessors:
|
| PATCH |
/api/annotation_set_file/<id> Update single annotation_set_file object with pk field matching param Preprocessors:
|
| GET |
/api/annotation_set_file Get list of annotation_set_file objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/annotation_set_file/<id> Get single annotation_set_file object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/annotation_set_file/<id> Delete single annotation_set_file object with pk field matching param Preprocessors:
|
| GET |
/api/annotation_set_file/<int:fid>/data Annotation Set File resource.
Get the data for the file resource matching where IMPORTING ANNOTATIONS: use Example1: import a CSV with the columns Example2: import a CSV exported from another annotation set (columns |
| POST |
/api/annotation_set_file/data Upload a file for an annotation set (multipart form post with |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| last_save | JSON() | None | True | None | - | - | Sequence of file operations performed at last save |
| name | Text() | None | False | False | - | - | The name of the file (optional). Defaults to |
| file_url | Text() | None | True | False | - | - | The URL of the file to be loaded dynamically (if |
| description | Text() | None | True | None | - | - | The description of the file (optional) |
| _rawfiledata | LargeBinary() | None | True | None | - | - | The raw file storage for the file. This is not directly accessible through the API |
| iscompressed | Boolean() | False | True | None | - | - | Whether or not the file is compressed or not. If so, it will be automatically decompressed upon access. |
| user_id | Integer() | None | False | None | - | users.id | None |
| annotation_set_id | Integer() | None | False | None | - | annotation_set.id | None |
| created_at | DateTime() | function | False | None | - | - | None |
| updated_at | DateTime() | function | True | None | - | - | Updated time (UTC) |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| user | users |
MANYTOONE | None |
| annotation_set | annotation_set |
MANYTOONE | None |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| batch_save | method | Override to run special method after for preserving annotation linking |
| current_user_can_edit | method | BOOLEAN, whether the current user uploaded this file or has edit rights to the parent annotation_set |
| stored_size | method | Size (bytes) of the file data stored in the database, or null if the file is linked by |
| data | property | None |
annotation_tags
Tag Annotation Associate resource: links tag objects to annotation objects.
camera
Camera resource: a camera (a physical unit, or a model / configuration used across several platforms). Where, when and in which configuration it was used is defined by its camera_installations. Admins and custodians can create cameras; admins and the owner can edit them.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/camera Create new camera object. Expects JSON. Fields shown in Sets attributes on the constructed instance using the names and
values in Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships. Preprocessors:
|
| PATCH |
/api/camera/<id> Update single camera object with pk field matching param Preprocessors:
|
| GET |
/api/camera Get list of camera objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/camera/<id> Get single camera object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/camera/<id> Delete single camera object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| data | JSON() | {} | True | None | - | - | Text field containing JSON properties for this resource |
| key | String(length=80) | None | False | True | - | - | Unique, stable identifier, eg: |
| name | String(length=128) | None | False | None | - | - | Display name |
| description | Text() | None | True | None | - | - | None |
| user_id | Integer() | None | True | None | - | users.id | None |
| created_at | DateTime() | function | False | None | - | - | None |
| updated_at | DateTime() | function | True | None | - | - | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| user | users |
MANYTOONE | None |
| installations | camera_installation |
ONETOMANY | None |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| installation_count | method | Number of installations of this camera (on all platforms) |
| platform_ids | method | Ids of the platforms this camera is (or was) installed on |
| platforms | method | The platforms this camera is (or was) installed on: |
camera_installation
Camera installation resource: a camera installed on a platform for a period of time
([valid_from, valid_to)), in a configuration (default width / height of its media). Media of the platform
are assigned to it by camera assignment when their match_field (key, or a media.data attribute such as
data.camera) matches one of its patterns (PostgreSQL regular expressions). Changes are not applied to
existing media until camera assignment is applied (POST /api/platform/<id>/cameras/apply); preview them with
/api/platform/<id>/cameras/preview. Admins and custodians of a datasource of the platform can manage its
installations.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/camera_installation Create new camera_installation object. Expects JSON. Fields shown in Sets attributes on the constructed instance using the names and
values in Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships. Preprocessors:
|
| PATCH |
/api/camera_installation/<id> Update single camera_installation object with pk field matching param Preprocessors:
|
| GET |
/api/camera_installation Get list of camera_installation objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/camera_installation/<id> Get single camera_installation object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/camera_installation/<id> Delete single camera_installation object with pk field matching param Preprocessors:
|
| POST |
/api/camera_installation/<int:id>/assign Manually assign media to this installation ( |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| camera_id | Integer() | None | False | None | - | camera.id | None |
| platform_id | Integer() | None | False | None | - | platform.id | None |
| name | String(length=128) | None | True | None | - | - | Optional name of the installation, eg: its position ( |
| valid_from | DateTime() | None | True | None | - | - | Start of the installation (inclusive, UTC). NULL: since the start |
| valid_to | DateTime() | None | True | None | - | - | End of the installation (exclusive, UTC). NULL: still installed |
| match_field | String(length=64) | key | False | None | - | - | What |
| patterns | JSON() | None | True | None | - | - | List of PostgreSQL regular expressions. Empty: media are only assigned to this installation manually |
| priority | Integer() | 0 | False | None | - | - | Settles media matched by several installations (highest first, then the latest |
| width | Integer() | None | True | None | - | - | Default pixel width of its media (displayed orientation) |
| height | Integer() | None | True | None | - | - | Default pixel height of its media (displayed orientation) |
| description | Text() | None | True | None | - | - | None |
| user_id | Integer() | None | True | None | - | users.id | None |
| created_at | DateTime() | function | False | None | - | - | None |
| updated_at | DateTime() | function | True | None | - | - | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| camera | camera |
MANYTOONE | None |
| platform | platform |
MANYTOONE | None |
| user | users |
MANYTOONE | None |
| media | media |
ONETOMANY | None |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| period | method | When the camera was installed, for display: eg: |
| label | property | STRING, display name: the camera name and the installation |
campaign-deployment
A special resource for listing / querying campaigns in a different format.
ENDPOINTS
| METHOD | ENDPOINT |
| GET |
/api/campaign-deployment/<resource> Examples: |
| GET |
/api/campaign-deployment Examples: |
campaign
Campaign resource: a group of deployments. Eg: a specific expedition, cruise or data collection initiative
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/campaign Create new campaign object. Expects JSON. Fields shown in Preprocessors:
Postprocessors:
|
| PATCH |
/api/campaign/<id> Update single campaign object with pk field matching param Preprocessors:
Postprocessors:
|
| GET |
/api/campaign Get list of campaign objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/campaign/<id> Get single campaign object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/campaign/<id> Delete single campaign object with pk field matching param Preprocessors:
|
| GET |
/api/campaign/map Deployment resource Minimal Deployment Resource for map data - result is cached for fast loading. Cache is cleared when new deployments are saved. :param GET: json: q: restless search query. :returns GET: json: a json string containing the structure of stuff |
| PATCH |
/api/campaign/<int:id>/finalise Finalise the campaign computing cached |
| GET |
/api/campaign/<int:id>/delete_check Whether the current user can delete this campaign (and all its deployments), and what would be deleted.
Pass |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=80) | None | False | None | - | - | Name of this |
| key | String(length=80) | None | False | True | - | - | Key of this |
| path | Text() | None | True | None | - | - | None |
| color | String(length=10) | function | True | False | - | - | Hex colour code for this |
| description | Text() | None | True | None | - | - | Description for this |
| user_id | Integer() | None | False | None | - | users.id | ID of the [user][#users] who created this |
| created_at | DateTime() | function | False | None | - | - | Datetime of creation |
| media_path_pattern | Text() | None | True | None | - | - | None |
| thm_path_pattern | Text() | None | True | None | - | - | None |
| geom_start | Geometry(geometry_type='POINT', srid=4326, from_text='ST_GeomFromEWKT', name='geometry') | None | True | None | - | - | None |
| geom_end | Geometry(geometry_type='POINT', srid=4326, from_text='ST_GeomFromEWKT', name='geometry') | None | True | None | - | - | None |
| geom_centroid | Geometry(geometry_type='POINT', srid=4326, from_text='ST_GeomFromEWKT', name='geometry') | None | True | None | - | - | None |
| dep_min | Float() | None | True | False | - | - | None |
| dep_max | Float() | None | True | False | - | - | None |
| alt_min | Float() | None | True | False | - | - | None |
| alt_max | Float() | None | True | False | - | - | None |
| timestamp_start | DateTime() | function | True | None | - | - | None |
| timestamp_end | DateTime() | function | True | None | - | - | None |
| pose_count | Integer() | 0 | True | None | - | - | None |
| media_count | Integer() | 0 | True | None | - | - | None |
| deployment_count | Integer() | 0 | True | None | - | - | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| user | users |
MANYTOONE | None |
| deployments | deployment |
ONETOMANY | None |
| info | campaigninfo |
ONETOMANY | None |
| files | campaign_file |
ONETOMANY | None |
HYBRID ATTRIBUTES FILTERABLE
HYBRID METHODS may require input parameters.
| NAME | TYPE | ARGS | DESCRIPTION |
| geom | property | - | The centroid |
| timestamp | property | - | A |
| total_annotation_count | property | - | Fetch total annotation count from the materialized view. |
| public_annotation_count | property | - | Fetch public annotation count from the materialized view. |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| extent | method | Compute spatial extent of Campaign :return: list with format [[SW_LAT, SW_LON],[NE_LAT,NE_LON]] |
| file_count | method | None |
| platforms | method | None |
| stats | method | None |
| timestamp_range | method | None |
| latlon | property | None |
campaign_file
Campaign File resource: a file associated with a campaign object.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/campaign_file Create new campaign_file object. Expects JSON. Fields shown in Preprocessors:
|
| PATCH |
/api/campaign_file/<id> Update single campaign_file object with pk field matching param Preprocessors:
|
| GET |
/api/campaign_file Get list of campaign_file objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/campaign_file/<id> Get single campaign_file object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/campaign_file/<id> Delete single campaign_file object with pk field matching param Preprocessors:
|
| GET |
/api/campaign_file/<int:fid>/data Get the data for the file resource matching where |
| POST |
/api/campaign_file/data Save file data to database. Use this if it is not possible to dynamically link the file using the |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| last_save | JSON() | None | True | None | - | - | Sequence of file operations performed at last save |
| name | Text() | None | False | False | - | - | The name of the file (optional). Defaults to |
| file_url | Text() | None | True | False | - | - | The URL of the file to be loaded dynamically (if |
| description | Text() | None | True | None | - | - | The description of the file (optional) |
| _rawfiledata | LargeBinary() | None | True | None | - | - | The raw file storage for the file. This is not directly accessible through the API |
| iscompressed | Boolean() | False | True | None | - | - | Whether or not the file is compressed or not. If so, it will be automatically decompressed upon access. |
| user_id | Integer() | None | False | None | - | users.id | None |
| campaign_id | Integer() | None | False | None | - | campaign.id | None |
| created_at | DateTime() | function | True | None | - | - | None |
| updated_at | DateTime() | function | True | None | - | - | Updated time (UTC) |
RELATED MODELS FILTERABLE
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| data | property | None |
campaigninfo
Deprecated.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/campaigninfo Create new campaigninfo object. Expects JSON. Fields shown in Preprocessors:
|
| GET |
/api/campaigninfo Get list of campaigninfo objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/campaigninfo/<id> Get single campaigninfo object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/campaigninfo/<id> Delete single campaigninfo object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=80) | None | False | None | - | - | None |
| description | Text() | None | False | None | - | - | None |
| created_at | DateTime() | function | False | None | - | - | None |
| campaign_id | Integer() | None | False | None | - | campaign.id | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| campaign | campaign |
MANYTOONE | None |
datasource
Datasource resource: the parameters that define the structure and format of the data on the
Datasource Repository and which Datasource Plugin to use. Each platform must have at least one datasource.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/datasource Create new datasource object. Expects JSON. Fields shown in Preprocessors:
|
| PATCH |
/api/datasource/<id> Update single datasource object with pk field matching param Preprocessors:
|
| GET |
/api/datasource Get list of datasource objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/datasource/<id> Get single datasource object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/datasource/<id> Delete single datasource object with pk field matching param Preprocessors:
|
| GET |
/api/datasource/<int:id>/remote/campaigns List the campaigns in the datasource's repository, with their local status: |
| GET |
/api/datasource/<int:id>/remote/deployments List the deployments of a remote campaign ( |
| GET |
/api/datasource/<int:id>/remote/preview Dry run of the import of one deployment: resolved datafile, first |
| POST |
/api/datasource/<int:id>/sandbox ADMIN: test unsaved changes to the datasource definition. JSON body: any of the definition fields
( |
| POST |
/api/datasource/<int:id>/upload Upload a file for a sync into one of the datasource plugin's upload slots (eg: |
| POST |
/api/datasource/<int:id>/sync Queue a sync job. JSON body: |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=80) | None | False | True | - | - | None |
| campaign_search | Text() | None | True | None | - | - | None |
| datafile_pattern | Text() | None | True | None | - | - | None |
| datafile_search | Text() | None | True | None | - | - | None |
| deployment_search | Text() | None | True | None | - | - | None |
| media_pattern | Text() | None | True | None | - | - | None |
| mediadir_search | Text() | None | True | None | - | - | None |
| thumb_pattern | Text() | None | True | None | - | - | None |
| thumbdir_search | Text() | None | True | None | - | - | None |
| urlbase_browse | Text() | None | True | None | - | - | None |
| credential_key | Text() | None | True | None | - | - | None |
| datafile_operations | JSON() | None | True | None | - | - | None |
| params | JSON() | None | True | None | - | - | Datasource plugin specific settings |
| description | Text() | None | True | None | - | - | None |
| is_active | Boolean() | True | False | None | - | - | Inactive datasources can not be synced (existing data is kept) |
| datasource_type_id | Integer() | None | False | None | - | datasource_type.id | None |
| platform_id | Integer() | None | False | None | - | platform.id | None |
| user_id | Integer() | None | False | None | - | users.id | None |
| created_at | DateTime() | function | False | None | - | - | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| datasource_type | datasource_type |
MANYTOONE | None |
| platform | platform |
MANYTOONE | None |
| user | users |
MANYTOONE | None |
| deployments | deployment |
ONETOMANY | None |
| custodians | datasource_custodian |
ONETOMANY | None |
| sync_jobs | datasource_sync_job |
ONETOMANY | None |
| uploads | datasource_upload |
ONETOMANY | None |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| current_user_can_view | method | Whether the current user can view this datasource in the datasource manager (admins and custodians) |
| current_user_is_custodian | method | Whether the current user is a custodian of this datasource |
| plugin_info | method | Plugin of this datasource: availability, whether it is external (API push), upload slots, params schema |
datasource_custodian
Datasource custodian resource: users that manage the datasets of a datasource. Only admins can
add or remove custodians. Custodians can only change their own notify_on_sync.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/datasource_custodian Create new datasource_custodian object. Expects JSON. Fields shown in Sets attributes on the constructed instance using the names and
values in Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships. Preprocessors:
|
| PATCH |
/api/datasource_custodian/<id> Update single datasource_custodian object with pk field matching param Preprocessors:
|
| GET |
/api/datasource_custodian Get list of datasource_custodian objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/datasource_custodian/<id> Get single datasource_custodian object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/datasource_custodian/<id> Delete single datasource_custodian object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| datasource_id | Integer() | None | False | None | - | datasource.id | None |
| user_id | Integer() | None | False | None | - | users.id | None |
| added_by_id | Integer() | None | True | None | - | users.id | The admin that assigned this custodian |
| notify_on_sync | Boolean() | True | False | None | - | - | Whether this custodian receives sync report emails |
| created_at | DateTime() | function | False | None | - | - | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| datasource | datasource |
MANYTOONE | None |
| user | users |
MANYTOONE | None |
| added_by | users |
MANYTOONE | None |
datasource_sync_job
Datasource sync job resource: queued / running / completed syncs of a datasource (created with
POST /api/datasource/<id>/sync). Visible to admins and the datasource's custodians.
ENDPOINTS
| METHOD | ENDPOINT |
| GET |
/api/datasource_sync_job Get list of datasource_sync_job objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/datasource_sync_job/<id> Get single datasource_sync_job object with pk field matching param
Included fields: Preprocessors:
|
| GET |
/api/datasource_sync_job/<int:id>/status Job status in the |
| GET |
/api/datasource_sync_job/<int:id>/results Per deployment results of the job |
| POST |
/api/datasource_sync_job/<int:id>/cancel Cancel a queued (immediately) or running (between deployments) job. Custodians only |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| datasource_id | Integer() | None | False | None | - | datasource.id | None |
| user_id | Integer() | None | True | None | - | users.id | The user that requested the sync (NULL for scheduled / command line syncs) |
| scope | String(length=20) | datasource | False | None | - | - | None |
| campaign_keys | JSON() | None | True | None | - | - | Campaigns to sync (scope campaign/deployment) |
| deployment_keys | JSON() | None | True | None | - | - | Deployments to sync (scope deployment) |
| options | JSON() | None | True | None | - | - | Sync options, eg: {update_existing: true} |
| status | String(length=20) | queued | False | None | - | - | None |
| cancel_requested | Boolean() | False | False | None | - | - | None |
| progress | JSON() | None | True | None | - | - | eg: {total, processed, current} |
| results | JSON() | None | True | None | - | - | List of per deployment results {status, campaign, deployment, message} |
| message | Text() | None | True | None | - | - | Summary or error message |
| log | Text() | None | True | None | - | - | Captured plugin/importer log (truncated) |
| notify_emails | JSON() | None | True | None | - | - | Additional sync report recipients (registered users only) |
| created_at | DateTime() | function | False | None | - | - | None |
| started_at | DateTime() | None | True | None | - | - | None |
| completed_at | DateTime() | None | True | None | - | - | None |
| heartbeat_at | DateTime() | None | True | None | - | - | Last worker heartbeat while running |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| datasource | datasource |
MANYTOONE | None |
| user | users |
MANYTOONE | None |
| uploads | datasource_upload |
ONETOMANY | None |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| is_active | property | None |
datasource_type
Datasource Type resource: defines mapping to a datasource plugin (module, eg:
marinedb.datasources.plugins.httpdir:HTTPDir). Types without a module are external datasources (datasets are
pushed through the API). Admins can create and edit types; a module is test loaded when saved.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/datasource_type Create new datasource_type object. Expects JSON. Fields shown in Sets attributes on the constructed instance using the names and
values in Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships. Preprocessors:
|
| PATCH |
/api/datasource_type/<id> Update single datasource_type object with pk field matching param Preprocessors:
|
| GET |
/api/datasource_type Get list of datasource_type objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/datasource_type/<id> Get single datasource_type object with pk field matching param
Included fields: Preprocessors:
|
| GET |
/api/datasource_type/discover ADMIN: plugins that are installed (in-tree modules and entry points), without importing them |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=80) | None | False | True | - | - | None |
| created_at | DateTime() | function | False | None | - | - | None |
| module | Text() | None | True | None | - | - | Reference to the datasource plugin class, eg: |
| description | Text() | None | True | None | - | - | None |
| is_enabled | Boolean() | True | False | None | - | - | Datasources of a disabled type can not be synced |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| datasources | datasource |
ONETOMANY | None |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| plugin_status | method | Availability of this type's plugin ( |
datasource_upload
Datasource upload resource: files uploaded for syncs (POST /api/datasource/<id>/upload). Pending uploads
(not yet used by a sync) can be deleted by custodians. File content is not returned.
ENDPOINTS
| METHOD | ENDPOINT |
| GET |
/api/datasource_upload Get list of datasource_upload objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/datasource_upload/<id> Get single datasource_upload object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/datasource_upload/<id> Delete single datasource_upload object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| last_save | JSON() | None | True | None | - | - | Sequence of file operations performed at last save |
| name | Text() | None | False | False | - | - | The name of the file (optional). Defaults to |
| file_url | Text() | None | True | False | - | - | The URL of the file to be loaded dynamically (if |
| description | Text() | None | True | None | - | - | The description of the file (optional) |
| _rawfiledata | LargeBinary() | None | True | None | - | - | The raw file storage for the file. This is not directly accessible through the API |
| iscompressed | Boolean() | False | True | None | - | - | Whether or not the file is compressed or not. If so, it will be automatically decompressed upon access. |
| datasource_id | Integer() | None | False | None | - | datasource.id | None |
| job_id | Integer() | None | True | None | - | datasource_sync_job.id | None |
| user_id | Integer() | None | True | None | - | users.id | The user that uploaded the file |
| slot | String(length=80) | None | False | None | - | - | Upload slot of the datasource plugin, eg: survey_list, datafile |
| campaign_key | Text() | None | True | None | - | - | Campaign key (deployment scoped slots) |
| deployment_key | Text() | None | True | None | - | - | Deployment key (deployment scoped slots) |
| created_at | DateTime() | function | False | None | - | - | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| datasource | datasource |
MANYTOONE | None |
| job | datasource_sync_job |
MANYTOONE | None |
| user | users |
MANYTOONE | None |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| as_plugin_upload | method | The dict format expected by |
| data | property | None |
| is_pending | property | None |
deployment
Deployment resource: a dataset containing a group of media objects collected from an operation of the platform, eg: a survey, transect or mission
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/deployment Create new deployment object. Expects JSON. Fields shown in Preprocessors:
|
| PATCH |
/api/deployment/<id> Update single deployment object with pk field matching param Preprocessors:
|
| GET |
/api/deployment Get list of deployment objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/deployment/<id> Get single deployment object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/deployment/<id> Delete single deployment object with pk field matching param Preprocessors:
|
| GET |
/api/deployment/map Deployment resource Minimal Deployment Resource for map data - result is cached for fast loading. Cache is cleared when new deployments are saved. :param GET: json: q: restless search query. :returns GET: json: a json string containing the structure of stuff |
| GET |
/api/deployment/extent Deployment resource Fast approximate spatial extent of matching deployments, computed from the cached deployment geometries instead of aggregating poses. Deployments without cached geometries are ignored. :param GET: json: q: restless search query.
:param GET: geom: |
| GET |
/api/deployment/<int:id>/export Export media from deployment matching Export media matching query defined in Querystring parameters are:
Where Metadata for the dataset is also returned in the response. Depending on the output
format, this could be as part of the response body in a Allowed fields include:
See media model columns, relations and attributes for more information on each of the included fields. EXAMPLES |
| GET |
/api/deployment/export Export deployments matching a search query ( Querystring parameters are:
Where Metadata for the dataset is also returned in the response. Depending on the output
format, this could be as part of the response body in a Allowed columns include: EXAMPLES |
| PATCH |
/api/deployment/<int:id>/finalise Finalise the deployment setting |
| GET |
/api/deployment/<int:id>/delete_check Whether the current user can delete this deployment, and what would be deleted (labelled annotations,
annotation sets and their owners). Pass |
| GET |
/api/deployment/<int:id>/ecoregion Get ecoregion info from ESRI API Marine Ecoregions Of the World (MEOW) feature layer. Uses |
| POST |
/api/deployment/<int:id>/assign_cameras Assign the media of this deployment to the camera installations of its platform, by pattern (see
camera_installation). Manual assignments are kept, unless |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=80) | None | False | None | - | - | None |
| key | String(length=80) | None | False | None | - | - | None |
| path | Text() | None | True | None | - | - | None |
| campaign_id | Integer() | None | False | None | - | campaign.id | None |
| user_id | Integer() | None | False | None | - | users.id | None |
| description | Text() | None | True | None | - | - | None |
| created_at | DateTime() | function | False | None | - | - | None |
| platform_id | Integer() | None | False | None | - | platform.id | None |
| datasource_id | Integer() | None | False | None | - | datasource.id | None |
| is_valid | Boolean() | True | True | None | - | - | None |
| geom_line | Geometry(srid=4326, from_text='ST_GeomFromEWKT', name='geometry') | None | True | None | - | - | None |
| geom_start | Geometry(geometry_type='POINT', srid=4326, from_text='ST_GeomFromEWKT', name='geometry') | None | True | None | - | - | None |
| geom_end | Geometry(geometry_type='POINT', srid=4326, from_text='ST_GeomFromEWKT', name='geometry') | None | True | None | - | - | None |
| geom_centroid | Geometry(geometry_type='POINT', srid=4326, from_text='ST_GeomFromEWKT', name='geometry') | None | True | None | - | - | None |
| dep_min | Float() | None | True | False | - | - | None |
| dep_max | Float() | None | True | False | - | - | None |
| alt_min | Float() | None | True | False | - | - | None |
| alt_max | Float() | None | True | False | - | - | None |
| timestamp_start | DateTime() | function | True | None | - | - | None |
| timestamp_end | DateTime() | function | True | None | - | - | None |
| pose_count | Integer() | 0 | True | None | - | - | None |
| media_count | Integer() | 0 | True | None | - | - | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| campaign | campaign |
MANYTOONE | None |
| user | users |
MANYTOONE | None |
| platform | platform |
MANYTOONE | None |
| datasource | datasource |
MANYTOONE | None |
| media | media |
ONETOMANY | None |
| events | deployment_event |
ONETOMANY | None |
| files | deployment_file |
ONETOMANY | None |
HYBRID ATTRIBUTES FILTERABLE
HYBRID METHODS may require input parameters.
| NAME | TYPE | ARGS | DESCRIPTION |
| annotated_media_count | property | - | Number of media objects with one or more labeled annotations in this |
| geom | property | - | The centroid |
| timestamp | property | - | A |
| total_annotation_count | property | - | Fetch total annotation count from the materialized view. |
| public_annotation_count | property | - | Fetch public annotation count from the materialized view. |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| color | method | None |
| extent | method | Compute spatial extent of Campaign :return: list with format [[SW_LAT, SW_LON],[NE_LAT,NE_LON]] |
| layers | method | None |
| pose_stats | method | None |
| timestamp_range | method | None |
| current_user_can_edit | property | Whether the current user can edit this deployment (custodian of its datasource). NOTE: a property, as
|
| latlon | property | None |
| pose | property | None |
deployment_event
Deployment Event resource: a freeform text log that can be associated with a pose and/or a media object.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/deployment_event Create new deployment_event object. Expects JSON. Fields shown in Sets attributes on the constructed instance using the names and
values in Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships. Preprocessors:
|
| PATCH |
/api/deployment_event/<id> Update single deployment_event object with pk field matching param Preprocessors:
|
| GET |
/api/deployment_event Get list of deployment_event objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/deployment_event/<id> Get single deployment_event object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/deployment_event/<id> Delete single deployment_event object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| description | Text() | None | False | None | - | - | None |
| user_id | Integer() | None | False | None | - | users.id | None |
| created_at | DateTime() | function | False | None | - | - | None |
| timestamp | DateTime() | function | False | None | - | - | None |
| pose_id | Integer() | None | True | None | - | pose.id | None |
| media_id | Integer() | None | True | None | - | media.id | None |
| deployment_event_type_id | Integer() | None | False | None | - | deployment_event_type.id | None |
| deployment_id | Integer() | None | False | None | - | deployment.id | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| user | users |
MANYTOONE | None |
| pose | pose |
MANYTOONE | None |
| media | media |
MANYTOONE | None |
| deployment_event_type | deployment_event_type |
MANYTOONE | None |
| deployment | deployment |
MANYTOONE | None |
deployment_event_type
Deployment Event resource: timestamped freeform text observation with optional link to media and pose objects.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/deployment_event_type Create new deployment_event_type object. Expects JSON. Fields shown in Sets attributes on the constructed instance using the names and
values in Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships. Preprocessors:
|
| PATCH |
/api/deployment_event_type/<id> Update single deployment_event_type object with pk field matching param Preprocessors:
|
| GET |
/api/deployment_event_type Get list of deployment_event_type objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/deployment_event_type/<id> Get single deployment_event_type object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/deployment_event_type/<id> Delete single deployment_event_type object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| data | JSON() | {} | True | None | - | - | Text field containing JSON properties for this resource |
| name | String(length=80) | None | False | True | - | - | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| deployment_events | deployment_event |
ONETOMANY | None |
deployment_file
Deployment File resource: a file associated with a deployment object. Can be used for batch importing / updating of media, pose and pose_data objects.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/deployment_file Create new deployment_file object. Expects JSON. Fields shown in Preprocessors:
|
| PATCH |
/api/deployment_file/<id> Update single deployment_file object with pk field matching param Preprocessors:
|
| GET |
/api/deployment_file Get list of deployment_file objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/deployment_file/<id> Get single deployment_file object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/deployment_file/<id> Delete single deployment_file object with pk field matching param Preprocessors:
|
| GET |
/api/deployment_file/<int:fid>/data Deployment file resource.
Get the data for the file resource matching where Example1: convert CSV file into serialized, nested JSON expected for media resource and batch save rows to the related Example 2: similar to above, but perform an update rather than an insert. Can optinally create missing. This is slower. |
| POST |
/api/deployment_file/data Upload a file for a deployment (multipart form post with |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| last_save | JSON() | None | True | None | - | - | Sequence of file operations performed at last save |
| name | Text() | None | False | False | - | - | The name of the file (optional). Defaults to |
| file_url | Text() | None | True | False | - | - | The URL of the file to be loaded dynamically (if |
| description | Text() | None | True | None | - | - | The description of the file (optional) |
| _rawfiledata | LargeBinary() | None | True | None | - | - | The raw file storage for the file. This is not directly accessible through the API |
| iscompressed | Boolean() | False | True | None | - | - | Whether or not the file is compressed or not. If so, it will be automatically decompressed upon access. |
| user_id | Integer() | None | False | None | - | users.id | None |
| deployment_id | Integer() | None | False | None | - | deployment.id | None |
| created_at | DateTime() | function | False | None | - | - | None |
| updated_at | DateTime() | function | True | None | - | - | Updated time (UTC) |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| user | users |
MANYTOONE | None |
| deployment | deployment |
MANYTOONE | None |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| data | property | None |
group_dashboard
Group Dashboard resource. Enables sharing of dashboards through groups. A dashboard is an external web
tool (eg: a machine learning model server, a visualisation or a processing service) that a group offers. Its
resources are the API resources it works with, which also decide where it's offered:
- datasets (
annotation_set,media_collection): when a dataset of one of those types is shared with the dashboard's group, the dashboard is listed on the dataset's sharing panel (Connect to Dashboard(s)) and from the dataset'sdashboardsendpoint (eg:/api/annotation_set/<id>/dashboards), and opened aturl_base. - query resources (
deployment,media,pose,annotation): the dashboard is offered on the Explore page (/api/group_dashboard/explore) to approved members of its group, or to all signed-in users if it's featured (is_featured, set by admins). It's launched with a form POST toexplore_launch_url, and gets the user's Explore filters and a query for each of its query resources (see thelaunchendpoint).
Group custodians manage them on the group's Dashboards tab.
LAUNCHING AND THE TOKEN
When a signed-in user who can view the dataset and passes the dashboard's permission tests (the requires_*
fields: every one that is true must pass) launches it, the dashboard is opened at url_base with the
placeholder {token} replaced by a signed, time-stamped token. The token encodes:
{"v": 2, "resource": "annotation_set", "id": 1234, "dashboard_id": 7, "host": "squidle.org", "user_id": 56}
where v is the payload version, resource and id identify the dataset (resource is the entry point it was
launched from), dashboard_id is the id of this dashboard (useful if the same dashboard is offered by more than
one group), host is the SQUIDLE+ host that issued the token and user_id is the user who launched
it. The token is signed, not encrypted: anyone holding it can read the payload, but it can't be changed or
forged. It does not give access to the API. The dashboard reads the dataset with its own API token (usually a bot
account that is a member of the group, so it can see the datasets shared in it), and uses user_id to know who it
is working for.
Tokens also have context ({"page": "dataset"}, or {"page": "explore", "tab": ...} for Explore launches,
whose payload is described under the launch endpoint).
To check and decode a token, the dashboard calls GET /decode_token/<token>?max_age=<seconds> on the host that
issued it (no sign in needed), or POST /decode_token with {"token": ..., "max_age": ...} (JSON or form fields)
for long tokens such as Explore launches. It returns the payload as JSON (status 200), 410 if the token is older than
max_age (default and maximum: 24 hours) or the dashboard's token_max_age, or if the dashboard has been
deleted, or 400 if it is not valid. Dashboards should decode the token on every request that acts for the user.
requires_user_is_owner and requires_user_can_edit test the user's permissions on the dataset;
requires_user_is_member, requires_user_can_share_data and requires_user_can_add_member test their membership
and permissions in the dashboard's group. Listing a dataset's dashboards needs view permission on the dataset;
users who are not signed in can see the dashboards of public datasets but can't launch them.
CREATING A DASHBOARD
Only the custodian of the group (or an admin) can add, edit or delete its dashboards; the dashboard's creator
(user_id, set to the signed-in user) can also delete it, and only admins can change user_id.
current_user_can_manage says whether the current user can edit it. resources is a list of one or more of
annotation_set, media_collection, deployment, media, pose and annotation. (A single resource value is
still accepted when creating or editing, for backwards compatibility, but is deprecated.) url_base is required
for dataset resources: it must start with http:// or https:// and contain {token} once, with no other curly
braces. explore_launch_url is required for query resources: an http(s):// URL with no curly braces.
token_max_age (seconds, 60 to 86400, default 3600) is how long a launch token stays valid. Only admins can set
is_featured; when anyone else changes a featured dashboard's url_base or explore_launch_url, it stops being
featured.
EXAMPLES
# Create a dashboard for annotation sets and media collections shared with group 42, for members with edit
# permission on the dataset, with launch links valid for 15 minutes
POST /api/group_dashboard
{"name": "Run a classifier", "description": "Suggest labels for the points in your annotation set",
"group_id": 42, "resources": ["annotation_set", "media_collection"],
"url_base": "https://bot.example.org/{token}", "token_max_age": 900,
"requires_user_is_member": true, "requires_user_can_edit": true}
# List the dashboards of group 42
/api/group_dashboard?q={"filters":[{"name":"group_id","op":"eq","val":42}]}
# Dashboards available for annotation set 1234, with a launch URL (or the failed permission tests) for the
# current user
/api/annotation_set/1234/dashboards
# Launch URL of dashboard 7 for annotation set 1234 (eg: to test it)
/api/group_dashboard/7/launch?resource=annotation_set&id=1234
# Create a dashboard for the Explore page that works with media and annotations
POST /api/group_dashboard
{"name": "Classify the selection", "group_id": 42, "resources": ["media", "annotation"],
"explore_launch_url": "https://bot.example.org/explore"}
# Explore page dashboards for the current user
/api/group_dashboard/explore
# Decode a token received by a dashboard (accept tokens up to 1 hour old)
/decode_token/<token>?max_age=3600
See the user manual (/wiki/instructions_and_tutorials/dashboards) for more information, and the
SQBot model server for a working example of a dashboard.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/group_dashboard Create new group_dashboard object. Expects JSON. Fields shown in Sets attributes on the constructed instance using the names and
values in Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships. Preprocessors:
|
| PATCH |
/api/group_dashboard/<id> Update single group_dashboard object with pk field matching param Preprocessors:
|
| GET |
/api/group_dashboard Get list of group_dashboard objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/group_dashboard/<id> Get single group_dashboard object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/group_dashboard/<id> Delete single group_dashboard object with pk field matching param Preprocessors:
|
| GET |
/api/group_dashboard/<int:id>/launch Launch this group_dashboard. GET: for a dataset. Launch details for the current user and one dataset, given by the query parameters
POST: from the Explore page. Requires sign in, and the dashboard must work with at least one query resource
( EXAMPLES |
| POST |
/api/group_dashboard/<int:id>/launch Launch this group_dashboard. GET: for a dataset. Launch details for the current user and one dataset, given by the query parameters
POST: from the Explore page. Requires sign in, and the dashboard must work with at least one query resource
( EXAMPLES |
| GET |
/api/group_dashboard/explore Dashboards offered on the Explore page to the current user: those that work with a query resource
( EXAMPLES |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=128) | None | False | None | - | - | Name of Dashboard |
| resources | ARRAY(String(length=64)) | function | False | None | - | - | The API resources the Dashboard works with, which also decide where it's offered: datasets ( |
| created_at | DateTime() | function | True | None | - | - | Date this was created |
| url_base | String(length=256) | None | True | None | - | - | URL to launch the Dashboard for a dataset, with |
| explore_launch_url | String(length=256) | None | True | None | - | - | URL that receives Explore page launches (a form POST with a |
| is_featured | Boolean() | False | False | None | - | - | Checked by an admin and offered on the Explore page to all signed-in users (not just group members). Only admins can set it |
| description | Text() | None | True | None | - | - | Description for this dashboard |
| token_max_age | Integer() | 3600 | False | None | - | - | How long (seconds) a launch token stays valid: 60 to 86400 (24 hours). Default: 3600 |
| data | JSON() | None | True | None | - | - | Optional metadata for the Dashboard (not used by SQUIDLE+) |
| user_id | Integer() | None | False | None | - | users.id | Foreign key |
| group_id | Integer() | None | False | None | - | groups.id | Foreign key |
| requires_user_is_member | Boolean() | False | False | None | - | - | Whether User must be an approved member of the Group |
| requires_user_is_owner | Boolean() | False | False | None | - | - | Whether User must be the Dataset owner |
| requires_user_can_edit | Boolean() | False | False | None | - | - | Whether User needs Dataset edit permission |
| requires_user_can_share_data | Boolean() | False | False | None | - | - | Whether User can share data to Group |
| requires_user_can_add_member | Boolean() | False | False | None | - | - | Whether User can add members to Group |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| user | users |
MANYTOONE | Related owner user object |
| group | groups |
MANYTOONE | Related group object |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| current_user_can_manage | method | Whether the current user can edit or delete this dashboard: the group's custodian, or an admin |
| custodian_name | method | Name of the custodian of the dashboard's group |
| explore_authorized | method | Whether the current user can launch this dashboard from the Explore page ( |
| launch_host | method | Host that launching this dashboard goes to (eg: |
group_types
Group Type resource.
ENDPOINTS
| METHOD | ENDPOINT |
| GET |
/api/group_types Get list of group_types objects matching API query. See Making API search queries for instructions on making search queries Preprocessors:
|
| GET |
/api/group_types/<id> Get single group_types object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=128) | None | False | None | - | - | None |
groups
Group resource: user groups for managing shared resources and permissions.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/groups Create new groups object. Expects JSON. Fields shown in Preprocessors:
Postprocessors:
|
| PATCH |
/api/groups/<id> Update single groups object with pk field matching param Preprocessors:
|
| GET |
/api/groups Get list of groups objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/groups/<id> Get single groups object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/groups/<id> Delete single groups object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=128) | None | False | None | - | - | Name of Group |
| is_public | Boolean() | False | True | None | - | - | Whether or not contents are publicly viewable |
| is_restricted | Boolean() | True | True | None | - | - | Whether or not members can see other member's datasets |
| requires_approval | Boolean() | True | True | None | - | - | Whether or not custodian approval is required |
| requires_agreement | Boolean() | False | True | None | - | - | Whether or not members need to agree to Data Usage Agreement (DUA) |
| description | Text() | None | True | None | - | - | Extra information about the Group |
| dua_link | Text() | None | True | None | - | - | Data Usage Agreement (DUA) link. Must be an HTTP accessible, embeddable document |
| user_id | Integer() | None | True | None | - | users.id |
|
| group_type_id | Integer() | None | False | None | - | group_types.id |
|
| groupinfo | Text() | None | True | None | - | - | Shorter description / tagline of Group |
| created_at | DateTime() | function | False | None | - | - | Datetime of creation |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| user | users |
MANYTOONE | Related user for group custodian |
| group_type | group_types |
MANYTOONE | related group_type object |
| members | users |
MANYTOMANY | None |
| usergroups | usergroups |
ONETOMANY | None |
| dashboards | group_dashboard |
ONETOMANY | Dashboards for this Group |
| shared_label_schemes | label_scheme |
MANYTOMANY | None |
| shared_annotation_sets | annotation_set |
MANYTOMANY | None |
| shared_media_collections | media_collection |
MANYTOMANY | None |
HYBRID ATTRIBUTES FILTERABLE
HYBRID METHODS may require input parameters.
| NAME | TYPE | ARGS | DESCRIPTION |
| current_user_is_owner | property | - | :return: |
| current_user_is_pending_approval | property | - | :return: |
| current_user_is_member | property | - | :return: |
| current_user_is_edit_member | property | - | :return: |
| current_user_can_share_data | property | - | BOOL, whether current_user has permission to share |
| current_user_can_add_member | property | - | BOOL, whether current_user has permission to share |
| current_user_has_agreed | property | - | BOOL, whether current_user has permission to share |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| dashboard_count | method | the number of dashboards offered by this group |
| dataset_counts | method | the number of different datasets that are shared in this group |
| member_count | method | None |
| pending_member_count | method | None |
label
Label resource. This defines the list of labels contained in a label_scheme and the labels to be applied to annotation objects. Each label can also have suggested tag objects linked to it.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/label Create new label object. Expects JSON. Fields shown in Preprocessors:
|
| PATCH |
/api/label/<id> Update single label object with pk field matching param Preprocessors:
|
| GET |
/api/label Get list of label objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/label/<id> Get single label object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/label/<id> Delete single label object with pk field matching param Preprocessors:
|
| DELETE |
/api/label/<int:id>/tag/<int:tag_id>
None
|
| POST |
/api/label/<int:id>/tag/<int:tag_id>
None
|
| GET |
/api/label/<int:id>/exemplars Get list of exemplar images for the label_scheme with the ID matching |
| GET |
/api/label/<int:id>/exemplars/<int:annotation_set_id> Get list of exemplar images for the label_scheme with the ID matching |
| GET |
/api/label/<int:id>/translate Translate the label matching The
Each label is matched by its The For example: The response contains EXAMPLES |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| uuid | UUID(as_uuid=True) | None | True | True | - | - | A universally unique identifier for this object |
| name | String(length=160) | None | False | False | - | - | The name of this class label |
| color | String(length=10) | function | True | False | - | - | The colour of this class label (hex code, including #) |
| user_id | Integer() | None | False | None | - | users.id | The |
| label_scheme_id | Integer() | None | False | None | - | label_scheme.id | The |
| parent_id | Integer() | None | True | None | - | label.id |
|
| is_approved | Boolean() | False | True | None | - | - | Whether this class label has been approved by the custodian |
| created_at | DateTime() | function | True | None | - | - | Creation time (UTC) |
| updated_at | TIMESTAMP() | function | True | None | - | - | Updated time (UTC) |
| origin_code | String(length=80) | None | True | False | - | - | None |
| parent_origin_code | String(length=80) | None | True | False | - | - | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| user | users |
MANYTOONE | The user who owns or created this class label |
| label_scheme | label_scheme |
MANYTOONE | The annotation scheme containing this class label |
| parent | label |
MANYTOONE | The parent class label (linked observation) |
| vocab_elements | vocab_element |
MANYTOMANY | A list of |
| children | label |
ONETOMANY | None |
| label_tags | label_tags |
ONETOMANY | None |
| info | label_info |
ONETOMANY | None |
| label_vocab_element | label_vocab_element |
ONETOMANY | None |
| annotations | annotation |
ONETOMANY | List of related annotation objects |
ASSOCIATION PROXIES FILTERABLE
| ATTRIBUTE | MODEL | COLLECTION | DESCRIPTION |
| tags | tag |
label_tags | Proxy attribute that presents the linked tag objects from the label_tags collection |
HYBRID ATTRIBUTES FILTERABLE
HYBRID METHODS may require input parameters.
| NAME | TYPE | ARGS | DESCRIPTION |
| is_child | property | - | BOOLEAN, whether or not this class label has a parent class label |
| is_mapped | property | - | BOOLEAN, whether this label has one or more vocab_element mappings |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| annotation_count | method | Number of annotations that have been assigned with this label |
| descendant_count | method | Number of direct children labels nested under this label |
| exemplar_annotation_sets | method | None |
| label_scheme_custodian | method | None |
| current_user_can_edit | property | None |
| current_user_is_custodian | property | None |
| name_path | property | None |
| tag_names | property | Comma-delimited names of applied tags. Can also be used to set tags using comma-delimited tags when creating annotaions |
| translated | property | Special API property returns label object in target label scheme.
Requires the |
| vocab_registry | property | Dictionary representation of |
label_info
Label Info resource. Attaches name-value information to label objects.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/label_info Create new label_info object. Expects JSON. Fields shown in Preprocessors:
|
| PATCH |
/api/label_info/<id> Update single label_info object with pk field matching param Preprocessors:
|
| GET |
/api/label_info Get list of label_info objects matching API query. See Making API search queries for instructions on making search queries Preprocessors:
|
| GET |
/api/label_info/<id> Get single label_info object with pk field matching param Preprocessors:
|
| DELETE |
/api/label_info/<id> Delete single label_info object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=80) | None | False | False | - | - | None |
| value | Text() | None | True | None | - | - | None |
| label_id | Integer() | None | True | None | - | label.id | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| label | label |
MANYTOONE | None |
label_scheme
Label Scheme resource. This resource is for managing and define label schemes otherwise known as (annotation scheme, taxonomic hierarchy, category lists, label lists, classification scheme)
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/label_scheme Create new label_scheme object. Expects JSON. Fields shown in Preprocessors:
|
| PATCH |
/api/label_scheme/<id> Update single label_scheme object with pk field matching param Preprocessors:
|
| GET |
/api/label_scheme Get list of label_scheme objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/label_scheme/<id> Get single label_scheme object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/label_scheme/<id> Delete single label_scheme object with pk field matching param Preprocessors:
|
| POST |
/api/label_scheme/<int:instance_id>/group/<int:group_id> Add object with id |
| DELETE |
/api/label_scheme/<int:instance_id>/group/<int:group_id> Remove resource with id |
| PATCH |
/api/label_scheme/<int:label_scheme_id>/reset_label_parents |
| GET |
/api/label_scheme/<int:label_scheme_id>/export Export labels collection from label_scheme matching Querystring parameters are:
Where Metadata for the dataset is also returned in the response. Depending on the output
format, this could be as part of the response body in a Allowed fields include:
See label model columns, relations and attributes for more information on each of the included fields. TRANSLATING TO OTHER LABEL_SCHEMES The
Each label is matched by its The For example: NOTE: you also need to add the EXAMPLES |
| GET |
/api/label_scheme/<int:label_scheme_id>/labels
None
|
| GET |
/api/label_scheme/<int:label_scheme_id>/labels/<int:label_parent_id>
None
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=80) | None | False | False | - | - | None |
| description | Text() | None | True | None | - | - | None |
| user_id | Integer() | None | False | None | - | users.id | Foreign key reference for ID of related owner users model |
| is_hierarchy | Boolean() | False | True | None | - | - | None |
| created_at | DateTime() | function | True | None | - | - | Creation time (UTC) |
| updated_at | TIMESTAMP() | function | True | None | - | - | Updated time (UTC) |
| parent_label_scheme_id | Integer() | None | True | None | - | label_scheme.id | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| user | users |
MANYTOONE | Related owner users model |
| parent_label_scheme | label_scheme |
MANYTOONE | None |
| annotation_sets | annotation_set |
ONETOMANY | None |
| usergroups | groups |
MANYTOMANY | List of groups objects that contain this resource |
| label_scheme_files | label_scheme_file |
ONETOMANY | None |
| children | label_scheme |
ONETOMANY | None |
| labels | label |
ONETOMANY | None |
HYBRID ATTRIBUTES FILTERABLE
HYBRID METHODS may require input parameters.
| NAME | TYPE | ARGS | DESCRIPTION |
| is_child | property | - | BOOLEAN, whether or not this class label has a parent class label |
| is_public | property | - | Whether or not this object is public (i.e. shared in a public group) |
| current_user_is_owner | property | - | Whether the current logged in user is the owner of this object |
| current_user_is_member | property | - | Whether the current logged in user is a member of a group that includes this object |
| current_user_is_edit_member | property | - | Whether the current logged in user is a member with edit permission of a group that includes this object |
| current_user_is_group_owner | property | - | Whether the current logged in user is the owner of a group that includes this object |
| current_user_can_view | property | - | Whether or not the current user has permission to view this object |
| current_user_can_edit | property | - | Whether the current logged in user has edit permission (owner or edit_member) |
| user_is_owner | method | user_id | Whether the specified user is the owner of this object |
| user_is_member | method | user_id | Whether the specified user is a member of a group that includes this object |
| user_is_edit_member | method | user_id | Whether the specified user is a member with edit permission of a group that includes this object |
| user_is_group_owner | method | user_id | Whether the specified user is the owner of a group that includes this object |
| user_can_view | method | user_id | Returns true is user is owner, dataset belongs to a public group, user owns a group or dataset belongs to an unrestricted group that user is a member of |
| user_can_edit | method | user_id | Whether the specified user has edit permission (owner or edit_member) |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| annotation_set_count | method | None |
| exemplar_annotation_set_count | method | None |
| label_count | method | None |
| usergroup_count | method | None |
label_scheme_file
Label Scheme File resource. Files that can be used for batch update / creation of label objects attached to label_scheme objects.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/label_scheme_file Create new label_scheme_file object. Expects JSON. Fields shown in Preprocessors:
|
| PATCH |
/api/label_scheme_file/<id> Update single label_scheme_file object with pk field matching param Preprocessors:
|
| GET |
/api/label_scheme_file Get list of label_scheme_file objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/label_scheme_file/<id> Get single label_scheme_file object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/label_scheme_file/<id> Delete single label_scheme_file object with pk field matching param Preprocessors:
|
| GET |
/api/label_scheme_file/<int:fid>/data Get the data for the file resource matching where |
| POST |
/api/label_scheme_file/data Save file data to database. Use this if it is not possible to dynamically link the file using the |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| last_save | JSON() | None | True | None | - | - | Sequence of file operations performed at last save |
| name | Text() | None | False | False | - | - | The name of the file (optional). Defaults to |
| file_url | Text() | None | True | False | - | - | The URL of the file to be loaded dynamically (if |
| description | Text() | None | True | None | - | - | The description of the file (optional) |
| _rawfiledata | LargeBinary() | None | True | None | - | - | The raw file storage for the file. This is not directly accessible through the API |
| iscompressed | Boolean() | False | True | None | - | - | Whether or not the file is compressed or not. If so, it will be automatically decompressed upon access. |
| label_scheme_id | Integer() | None | False | None | - | label_scheme.id | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| label_scheme | label_scheme |
MANYTOONE | None |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| current_user_can_edit | method | BOOLEAN, whether the current user has edit rights to the parent label_scheme |
| stored_size | method | Size (bytes) of the file data stored in the database, or null if the file is linked by |
| data | property | None |
label_tags
Label tag associations. Links suggested tag objects to label objects. Provides convenience for quickly assigning tags to certain labels
maplayer
Map Layer resource: defines properties of additional map layers for integration into explore interface
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/maplayer Create new maplayer object. Expects JSON. Fields shown in Sets attributes on the constructed instance using the names and
values in Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships. Preprocessors:
|
| PATCH |
/api/maplayer/<id> Update single maplayer object with pk field matching param Preprocessors:
|
| GET |
/api/maplayer Get list of maplayer objects matching API query. See Making API search queries for instructions on making search queries Preprocessors:
|
| GET |
/api/maplayer/<id> Get single maplayer object with pk field matching param Preprocessors:
|
| DELETE |
/api/maplayer/<id> Delete single maplayer object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=255) | None | False | None | - | - | None |
| baseurl | String(length=255) | None | False | None | - | - | None |
| layertype | String(length=128) | None | False | None | - | - | None |
| properties | JSON(astext_type=Text()) | None | True | None | - | - | None |
| filters | JSON(astext_type=Text()) | None | True | None | - | - | None |
| is_active | Boolean() | False | True | None | - | - | None |
| disabled | Boolean() | False | True | None | - | - | None |
| maplayer_group_id | Integer() | None | False | None | - | maplayer_group.id | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| maplayer_group | maplayer_group |
MANYTOONE | None |
maplayer_group
Map Layer Group resource: defines properties of additional map layer groups for integration into explore interface
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/maplayer_group Create new maplayer_group object. Expects JSON. Fields shown in Sets attributes on the constructed instance using the names and
values in Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships. Preprocessors:
|
| PATCH |
/api/maplayer_group/<id> Update single maplayer_group object with pk field matching param Preprocessors:
|
| GET |
/api/maplayer_group Get list of maplayer_group objects matching API query. See Making API search queries for instructions on making search queries Preprocessors:
|
| GET |
/api/maplayer_group/<id> Get single maplayer_group object with pk field matching param Preprocessors:
|
| DELETE |
/api/maplayer_group/<id> Delete single maplayer_group object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=255) | None | False | None | - | - | None |
| pane | String(length=255) | None | True | None | - | - | None |
| zindex | Integer() | None | False | None | - | - | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| maplayers | maplayer |
ONETOMANY | None |
media
Media resource: a generic media object definition that can be used to link in media in a variety of formats, including images, videos, photo-mosaics and other media formats. Note that at the moment only images and video framegrabs have annotation support. Annotation viewers for video and mosaics coming soon.
ENDPOINTS
| METHOD | ENDPOINT |
| PATCH |
/api/media/<id> Update single media object with pk field matching param Preprocessors:
Postprocessors:
|
| GET |
/api/media Get list of media objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/media/<id> Get single media object with pk field matching param
Included fields: Preprocessors:
Postprocessors:
|
| DELETE |
/api/media/<id> Delete single media object with pk field matching param Preprocessors:
|
| GET |
/api/media/<int:media_id>/annotations/<int:annotation_set_id>
None
|
| POST |
/api/media/save Media UPLOAD resource. Used to upload Media to predefined location set out in server config file.
|
| POST |
/api/media In addition to the Here are some example payloads for creating media objects: |
| GET |
/api/media/<int:id>/poses The list of pose for the media item matching |
| GET |
/api/media/<int:id>/thumbnail Dynamically create and serve thumbnail. If user is logged in, then they can request different sizes. |
| GET |
/api/media/<int:id>/image Dynamically create and serve media image for different media types.
For video, supply |
| GET |
/api/media/<int:id>/download Download media object with associated metadata as a zip file |
| GET |
/api/media/export Export media. This endpoint is limited to a maximum of 200,000 media items
in any single query. You can export more in separate queries using a combination of Export media matching query defined in Querystring parameters are:
Where Metadata for the dataset is also returned in the response. Depending on the output
format, this could be as part of the response body in a Allowed fields include:
See media model columns, relations and attributes for more information on each of the included fields. EXAMPLES |
| GET |
/api/media/tally/<group_by> Get a tally of media. The tally of media can be grouped by different properties. ^ NOTE: the counts in the EXAMPLES |
| POST |
/api/media/<int:id>/dims Report the pixel dimensions of this media item, as observed by a client that loaded the image ( |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| data | JSON() | {} | True | None | - | - | Text field containing JSON properties for this resource |
| key | String(length=128) | None | False | None | - | - | None |
| path | Text() | None | True | None | - | - | None |
| path_thm | Text() | None | True | None | - | - | None |
| is_valid | Boolean() | True | True | None | - | - | None |
| deployment_id | Integer() | None | False | None | - | deployment.id | None |
| media_type_id | Integer() | None | False | None | - | media_type.id | None |
| camera_installation_id | Integer() | None | True | None | - | camera_installation.id | The camera_installation that captured this media item (set by camera assignment, see |
| camera_source | String(length=8) | None | True | None | - | - | How |
| width | Integer() | None | True | None | - | - | Pixel width of this media item (displayed orientation), if known. See |
| height | Integer() | None | True | None | - | - | Pixel height of this media item (displayed orientation), if known |
| dims_source | String(length=10) | None | True | None | - | - | Where |
| timestamp_start | DateTime() | function | True | None | - | - | None |
| created_at | DateTime() | function | True | None | - | - | None |
| parent_id | Integer() | None | True | None | - | media.id | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| deployment | deployment |
MANYTOONE | None |
| media_type | media_type |
MANYTOONE | None |
| camera_installation | camera_installation |
MANYTOONE | None |
| parent | media |
MANYTOONE | None |
| annotations | point |
ONETOMANY | List of point objects |
| poses | pose |
ONETOMANY | None |
| children | media |
ONETOMANY | None |
| media_collection_media | media_collection_media |
ONETOMANY | None |
| events | deployment_event |
ONETOMANY | None |
ASSOCIATION PROXIES FILTERABLE
| ATTRIBUTE | MODEL | COLLECTION | DESCRIPTION |
| media_collections | media_collection |
media_collection_media | Proxy attribute that presents the linked media_collection objects from the media_collection_media collection |
HYBRID ATTRIBUTES FILTERABLE
HYBRID METHODS may require input parameters.
| NAME | TYPE | ARGS | DESCRIPTION |
| geom | property | - | None |
| is_child | property | - | BOOLEAN, whether or not this has a parent |
| has_unlabeled_annotations | method | annotation_set_id | BOOL, whether or not the media object contains unlabeled annotations from the
annotation_set with the id |
| has_points | method | annotation_set_id | BOOL, whether or not the media object contains points from the
annotation_set with the id |
| has_annotations | method | annotation_set_id | BOOL, whether or not the media object contains any annotations from the
annotation_set with the id |
| distance | method | lat, lon | FLOAT, distance (in meters) of closest linked pose relative to |
| timestamp_proximity | method | ts | Absolute difference in seconds of the in-situ timestamp and input |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| current_user_can_edit | method | Whether or not the current user can edit this media item (custodian of the deployment's datasource) |
| event_log | method | None |
| camera | property | The camera that captured this media item (through its |
| color | property | None |
| dims | property | DICT, the resolved pixel dimensions of this media item: |
| event_count | property | BOOL, whether or not the media object contains any logged deployment_events |
| path_best | property | None |
| path_best_thm | property | None |
| pixel_height | property | INT, height of the media item in pixels (the |
| pixel_width | property | INT, width of the media item in pixels (the |
| pose | property | The first pose from related |
| timestamp_start_local | property | LOCAL datetime, converted using |
media_collection
Media Collection resource: a user-defined collection of media objects grouped for further analysis. Can be a subset of media objects from one or more deployments
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/media_collection Create new media_collection object. Expects JSON. Fields shown in Preprocessors:
|
| PATCH |
/api/media_collection/<id> Update single media_collection object with pk field matching param Preprocessors:
|
| GET |
/api/media_collection Get list of media_collection objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/media_collection/<id> Get single media_collection object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/media_collection/<id> Delete single media_collection object with pk field matching param Preprocessors:
|
| POST |
/api/media_collection/<int:instance_id>/group/<int:group_id> Add instance with ID of |
| DELETE |
/api/media_collection/<int:instance_id>/group/<int:group_id> Remove resource with id |
| GET |
/api/media_collection/<int:id>/export Export media collection from media_collection matching Querystring parameters are:
Where Metadata for the dataset is also returned in the response. Depending on the output
format, this could be as part of the response body in a Allowed columns include:
NB: the UI contains an "ADVANCED" option which can help build more complex export queries. |
| GET |
/api/media_collection/<int:id>/media/tally/<group_by> Get a tally of media for a The tally of media can be grouped by different properties. ^ NOTE: the counts in the EXAMPLES |
| GET |
/api/media_collection/<int:media_collection_id>/media Get list of media objects contained in the media_collection with an ID matching |
| POST |
/api/media_collection/<int:media_collection_id>/media Add media objects matching the search query defined in the json post parameter |
| GET |
/api/media_collection/<int:media_collection_id>/media/<int:media_id> Get the single media object with the ID |
| POST |
/api/media_collection/<int:media_collection_id>/media/<int:media_id> Add the media object with the ID |
| DELETE |
/api/media_collection/<int:media_collection_id>/media/<int:media_id> Remove the media object with the ID |
| GET |
/api/media_collection/<int:id>/dashboards List the group_dashboards available for this media_collection: those offered
for EXAMPLES |
| GET |
/api/media_collection/<int:id>/summary Public summary of a media_collection to help with dataset discovery. Returns non-sensitive
metadata (name, description, custodian, media / annotation_set / group counts) whether or not the current user
has permission to view the media_collection, as well as EXAMPLES |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| data | JSON() | {} | True | None | - | - | Text field containing JSON properties for this resource |
| name | String(length=80) | None | False | None | - | - | The name of the |
| description | Text() | None | True | None | - | - | A concise description of the |
| parent_collection_id | Integer() | None | True | None | - | media_collection.id | A reference to the ID of a parent |
| created_at | DateTime() | function | False | None | - | - | The creation date-time |
| user_id | Integer() | None | True | None | - | users.id | Foreign key reference for ID of related owner users model |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| parent | media_collection |
MANYTOONE | The parent |
| media | media |
MANYTOMANY | A list of |
| user | users |
MANYTOONE | Related owner users model |
| usergroups | groups |
MANYTOMANY | List of groups objects that contain this resource |
| annotation_sets | annotation_set |
ONETOMANY | None |
| children | media_collection |
ONETOMANY | A list of childen |
| media_collection_media | media_collection_media |
ONETOMANY | None |
HYBRID ATTRIBUTES FILTERABLE
HYBRID METHODS may require input parameters.
| NAME | TYPE | ARGS | DESCRIPTION |
| media_count | property | - | Number of Media objects in this Media Collection |
| annotation_set_count | property | - | Number of annotation_sets in this Media Collection |
| is_public | property | - | Whether or not this object is public (i.e. shared in a public group) |
| current_user_is_owner | property | - | Whether the current logged in user is the owner of this object |
| current_user_is_member | property | - | Whether the current logged in user is a member of a group that includes this object |
| current_user_is_edit_member | property | - | Whether the current logged in user is a member with edit permission of a group that includes this object |
| current_user_is_group_owner | property | - | Whether the current logged in user is the owner of a group that includes this object |
| current_user_can_view | property | - | Whether or not the current user has permission to view this object |
| current_user_can_edit | property | - | Whether the current logged in user has edit permission (owner or edit_member) |
| user_is_owner | method | user_id | Whether the specified user is the owner of this object |
| user_is_member | method | user_id | Whether the specified user is a member of a group that includes this object |
| user_is_edit_member | method | user_id | Whether the specified user is a member with edit permission of a group that includes this object |
| user_is_group_owner | method | user_id | Whether the specified user is the owner of a group that includes this object |
| user_can_view | method | user_id | Returns true is user is owner, dataset belongs to a public group, user owns a group or dataset belongs to an unrestricted group that user is a member of |
| user_can_edit | method | user_id | Whether the specified user has edit permission (owner or edit_member) |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| extent | method | Compute spatial extent of Media Collection :return: list with format [[SW_LAT, SW_LON],[NE_LAT,NE_LON]] |
| usergroup_count | method | None |
media_collection_media
Media Collection Media Associate resource: a model for associating a subset of media objects to a media_collection
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/media_collection_media Create new media_collection_media object. Expects JSON. Fields shown in Preprocessors:
|
| GET |
/api/media_collection_media Get list of media_collection_media objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/media_collection_media/<media_collection_id> Get single media_collection_media object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/media_collection_media/<media_collection_id> Delete single media_collection_media object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| media_id | Integer() | None | False | None | True | media.id | None |
| media_collection_id | Integer() | None | False | None | True | media_collection.id | None |
| created_at | DateTime() | function | False | None | - | - | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| media | media |
MANYTOONE | None |
| media_collection | media_collection |
MANYTOONE | None |
media_type
Media Type resource: a modifier denoting the type for a media resource. This is associated with
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/media_type Create new media_type object. Expects JSON. Fields shown in Preprocessors:
|
| GET |
/api/media_type Get list of media_type objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/media_type/<id> Get single media_type object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/media_type/<id> Delete single media_type object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=80) | None | False | None | - | - | The name of the media type |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| media | media |
ONETOMANY | None |
platform
Platform resource: the equipment/method used to collect the imagery data (eg: a specific AUV, ROV or camera platform)
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/platform Create new platform object. Expects JSON. Fields shown in Preprocessors:
|
| PATCH |
/api/platform/<id> Update single platform object with pk field matching param Preprocessors:
|
| GET |
/api/platform Get list of platform objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/platform/<id> Get single platform object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/platform/<id> Delete single platform object with pk field matching param Preprocessors:
|
| GET |
/api/platform/<int:id>/cameras/preview Preview camera assignment for the media of this platform (nothing is changed): media counts and sample keys
per camera_installation, the observed pixel dimensions of their media, and the media
that would be unassigned, outside every installation's dates, matched by several installations or cleared.
A POST JSON body can contain unsaved |
| POST |
/api/platform/<int:id>/cameras/preview Preview camera assignment for the media of this platform (nothing is changed): media counts and sample keys
per camera_installation, the observed pixel dimensions of their media, and the media
that would be unassigned, outside every installation's dates, matched by several installations or cleared.
A POST JSON body can contain unsaved |
| POST |
/api/platform/<int:id>/cameras/apply Apply camera assignment to the existing media of this platform: queues a sync job (scope |
| POST |
/api/platform/<int:id>/cameras/probe ADMIN: probe the pixel dimensions of media of this platform from their image headers (HTTP range requests of
the first bytes of |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| data | JSON() | {} | True | None | - | - | Text field containing JSON properties for this resource |
| name | String(length=80) | None | False | None | - | - | None |
| key | String(length=80) | None | False | True | - | - | None |
| description | Text() | None | True | None | - | - | None |
| reference | Text() | None | True | None | - | - | None |
| user_id | Integer() | None | True | None | - | users.id | None |
| created_at | DateTime() | function | False | None | - | - | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| user | users |
MANYTOONE | None |
| deployments | deployment |
ONETOMANY | None |
| datasources | datasource |
ONETOMANY | None |
| camera_installations | camera_installation |
ONETOMANY | None |
| layers | platform_maplayer |
ONETOMANY | None |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| current_user_is_owner | method | None |
platform_maplayer
Platform Map Layer resource: defines properties of additional map layers for each platform filtered by configurable parameters
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/platform_maplayer Create new platform_maplayer object. Expects JSON. Fields shown in Sets attributes on the constructed instance using the names and
values in Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships. Preprocessors:
|
| PATCH |
/api/platform_maplayer/<id> Update single platform_maplayer object with pk field matching param Preprocessors:
|
| GET |
/api/platform_maplayer Get list of platform_maplayer objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/platform_maplayer/<id> Get single platform_maplayer object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/platform_maplayer/<id> Delete single platform_maplayer object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=255) | None | False | None | - | - | None |
| baseurl | String(length=255) | None | False | None | - | - | None |
| layertype | String(length=128) | None | False | None | - | - | None |
| minzoom | Integer() | None | True | None | - | - | None |
| properties | JSON(astext_type=Text()) | None | True | None | - | - | None |
| platform_id | Integer() | None | True | None | - | platform.id | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| platform | platform |
MANYTOONE | None |
point
Annotation Point resource: an annotatable object on a media frame, captures x,y,t and can have multiple annotations associated with it. A point can also be associated with a bounding box, polygon, pixel map, etc... Each point can have one or more annotations.
ENDPOINTS
| METHOD | ENDPOINT |
| PATCH |
/api/point/<id> Update single point object with pk field matching param Preprocessors:
|
| GET |
/api/point Get list of point objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/point/<id> Get single point object with pk field matching param
Included fields: Preprocessors:
Postprocessors:
|
| DELETE |
/api/point/<id> Delete single point object with pk field matching param Preprocessors:
|
| POST |
/api/point Custom post endpoint |
| GET |
/api/point/<int:id>/thumbnail Dynamically create and serve thumbnail. If user is logged in, then they can request different sizes. |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| data | JSON() | {} | True | None | - | - | Text field containing JSON properties for this resource |
| x | Float(precision=53) | None | True | False | - | - | X location of point as a proportion across the frame width (0-1.0, measured from the left, positive right) or |
| y | Float(precision=53) | None | True | False | - | - | Y location of point as a proportion across the frame height (0-1.0, measured from the top, positive down) or |
| t | Float(precision=53) | None | True | False | - | - | Number of seconds of annotation relative to |
| media_id | Integer() | None | False | None | - | media.id | |
| annotation_set_id | Integer() | None | False | None | - | annotation_set.id | Foreign key |
| updated_at | TIMESTAMP() | function | True | None | - | - | Updated time (UTC) |
| is_targeted | BOOLEAN() | False | True | None | - | - | Flag denoting whether the Point was manually created to target a specific object |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| media | media |
MANYTOONE | Related media object |
| annotation_set | annotation_set |
MANYTOONE | Parent/origin annotation_set object |
| annotations | annotation |
ONETOMANY | List of annotation objects |
HYBRID ATTRIBUTES FILTERABLE
HYBRID METHODS may require input parameters.
| NAME | TYPE | ARGS | DESCRIPTION |
| timestamp | property | - | The in-situ timestamp for when the annotated object was captured/sampled in the media frame.
Returns |
| has_xy | property | - | BOOLEAN, whether or not the point has x-y coordinates. If |
| has_polygon | property | - | BOOLEAN, whether or not the point has a polygon defined |
| xy_distance | method | x, y | FLOAT, euclidean distance to |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| bbox | method | Returns bbox size in format [left, top, right, bottom] in relative coordinates, normalized to [0,1] |
| annotation_label | property | Returns list of dicts SETTER used to set a label based on lookup condition / parameters during batch annotation importing.
Parameters are passed by scalar value with query string properties or by setting value as dict.
The property value can be Examples where Coming soon: setting labels using semantic translation (or vocab elements) |
| pixels | property | Use to convert between native normalised Returns SETTER convert from pixel coordinates Examples where |
| polygon | property | List of lists containing coordinated of vertices for polygons. Coordinates are in proportions of the image (0-1.0). For point annotations, measurements are relative to point's xy location. For whole-frame annotations, they are absolute. When setting this property, it can be a list of lists or a JSON string which will automatically be converted to a list of lists. |
| pose | property | Get closest linked pose to timestamp |
| set_media | property | Returns SETTER used to link the media object to the point annotation during batch annotation importing.
If the matched media object is not already in the associated media_collection,
it is added. Matching is done on Examples |
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/pose Create new pose object. Expects JSON. Fields shown in Preprocessors:
|
| GET |
/api/pose Get list of pose objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/pose/<id> Get single pose object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/pose/<id> Delete single pose object with pk field matching param Preprocessors:
|
| GET |
/api/pose/stats Get stats for a pose. Accepts |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| lat | Float(precision=53) | None | True | False | - | - | None |
| lon | Float(precision=53) | None | True | False | - | - | None |
| alt | Float() | None | True | False | - | - | None |
| dep | Float() | None | True | False | - | - | None |
| timestamp | DateTime() | function | False | None | - | - | None |
| media_id | Integer() | None | False | None | - | media.id | None |
| geom | Geometry(geometry_type='POINT', srid=4326, from_text='ST_GeomFromEWKT', name='geometry') | None | True | None | - | - | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| media | media |
MANYTOONE | None |
| _data | posedata |
ONETOMANY | None |
| events | deployment_event |
ONETOMANY | None |
HYBRID ATTRIBUTES FILTERABLE
HYBRID METHODS may require input parameters.
| NAME | TYPE | ARGS | DESCRIPTION |
| distance | method | lat, lng | FLOAT, distance (in meters) to |
| proximity | method | lat, lon | None |
| timestamp_proximity | method | ts | Absolute difference in seconds of the in-situ timestamp and input |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| campaign | property | None |
| color | property | None |
| data | property | Properties for related pose item including any linked posedata fields |
| deployment | property | None |
| platform | property | None |
| timestamp_local | property | LOCAL datetime, converted using |
posedata
Pose Data resource: enables linking of name-value data to pose objects. This can be used to attach additional sensor information to each pose object (and by proxy to each media object)
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/posedata Create new posedata object. Expects JSON. Fields shown in Preprocessors:
|
| GET |
/api/posedata Get list of posedata objects matching API query. See Making API search queries for instructions on making search queries Preprocessors:
|
| GET |
/api/posedata/<id> Get single posedata object with pk field matching param Preprocessors:
|
| DELETE |
/api/posedata/<id> Delete single posedata object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=80) | None | False | None | - | - | None |
| value | Float() | None | True | False | - | - | None |
| pose_id | Integer() | None | False | None | - | pose.id | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| pose | pose |
MANYTOONE | None |
roles
Not implemented yet. Not in use.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/roles Create new roles object. Expects JSON. Fields shown in Preprocessors:
|
| PATCH |
/api/roles/<id> Update single roles object with pk field matching param Preprocessors:
|
| GET |
/api/roles Get list of roles objects matching API query. See Making API search queries for instructions on making search queries Preprocessors:
|
| GET |
/api/roles/<id> Get single roles object with pk field matching param Preprocessors:
|
| DELETE |
/api/roles/<id> Delete single roles object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=80) | None | False | True | - | - | None |
tag
Tag resource. Suggested tags can linked to class labels label and tags can be assigned to annotations annotation
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/tag Create new tag object. Expects JSON. Fields shown in Preprocessors:
|
| PATCH |
/api/tag/<id> Update single tag object with pk field matching param Preprocessors:
|
| GET |
/api/tag Get list of tag objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/tag/<id> Get single tag object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/tag/<id> Delete single tag object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=80) | None | False | None | - | - | None |
| user_id | Integer() | None | False | None | - | users.id | None |
| type_id | Integer() | None | True | None | - | tag_type.id | None |
| description | Text() | None | True | None | - | - | None |
| synonym_tag_id | Integer() | None | True | None | - | tag.id | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| user | users |
MANYTOONE | None |
| type | tag_type |
MANYTOONE | None |
| synonym_tag | tag |
MANYTOONE | None |
| synonyms | tag |
ONETOMANY | None |
| label_tags | label_tags |
ONETOMANY | None |
| annotation_tags | annotation_tags |
ONETOMANY | Collection of annotation_tags associations |
ASSOCIATION PROXIES FILTERABLE
| ATTRIBUTE | MODEL | COLLECTION | DESCRIPTION |
| labels | label |
label_tags | Proxy attribute that presents the linked label objects from the label_tags collection |
HYBRID ATTRIBUTES FILTERABLE
HYBRID METHODS may require input parameters.
| NAME | TYPE | ARGS | DESCRIPTION |
| is_synonym | property | - | None |
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/tag_type Create new tag_type object. Expects JSON. Fields shown in Preprocessors:
|
| PATCH |
/api/tag_type/<id> Update single tag_type object with pk field matching param Preprocessors:
|
| GET |
/api/tag_type Get list of tag_type objects matching API query. See Making API search queries for instructions on making search queries Preprocessors:
|
| GET |
/api/tag_type/<id> Get single tag_type object with pk field matching param Preprocessors:
|
| DELETE |
/api/tag_type/<id> Delete single tag_type object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=80) | None | False | True | - | - | None |
| description | Text() | None | True | None | - | - | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| tags | tag |
ONETOMANY | None |
usergroups
User / Group Association resource.
ENDPOINTS
| METHOD | ENDPOINT |
| GET |
/api/usergroups Get list of usergroups objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/usergroups/<group_id> Get single usergroups object with pk field matching param
Included fields: Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| user_id | Integer() | None | False | None | True | users.id | None |
| group_id | Integer() | None | False | None | True | groups.id | None |
| created_at | DateTime() | function | True | None | - | - | None |
| approved | Boolean() | False | True | None | - | - | None |
| can_edit | Boolean() | False | True | None | - | - | None |
| can_add_members | Boolean() | False | True | None | - | - | None |
| can_share_data | Boolean() | False | True | None | - | - | None |
| has_agreed | Boolean() | False | True | None | - | - | None |
| added_by_user_id | Integer() | None | True | None | - | users.id | None |
RELATED MODELS FILTERABLE
users
User resource: captures all user information which is linked to most objects and resources.
ENDPOINTS
| METHOD | ENDPOINT |
| GET |
/api/users Get list of users objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/users/<id> Get single users object with pk field matching param
Included fields: Preprocessors:
Postprocessors:
|
| DELETE |
/api/users/<id> Delete single users object with pk field matching param Preprocessors:
|
| GET |
/api/users/api_token Manage API token |
| PATCH |
/api/users/api_token Manage API token |
| DELETE |
/api/users/api_token Manage API token |
| POST |
/api/users/<int:user_id>/group/<int:group_id> Manage group membership |
| DELETE |
/api/users/<int:user_id>/group/<int:group_id> Manage group membership |
| PATCH |
/api/users/<int:user_id>/group/<int:group_id> Manage group membership |
| POST |
/api/users/login Log in. Requires form parameters |
| DELETE |
/api/users/login Log out the current session |
| GET |
/api/users/login Get information about current logged in user |
| POST |
/api/users Update user information |
| PATCH |
/api/users/<int:user_id> Update user information |
| POST |
/api/users/reset_password
None
|
| GET |
/api/users/reset_password
None
|
| POST |
/api/users/reset_password/<token>
None
|
| GET |
/api/users/reset_password/<token>
None
|
| POST |
/api/users/<int:user_id>/email Send an email to the user. Requires json post body containing |
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| username | String(length=80) | None | False | True | - | - | None |
| String(length=80) | None | False | True | - | - | None | |
| password | String(length=128) | None | False | None | - | - | None |
| created_at | DateTime() | function | False | None | - | - | None |
| last_login | DateTime() | now() | True | None | - | - | None |
| first_name | String(length=30) | None | False | None | - | - | None |
| last_name | String(length=30) | None | False | None | - | - | None |
| active | Boolean() | True | True | None | - | - | None |
| is_admin | Boolean() | False | True | None | - | - | None |
| info | Text() | None | True | None | - | - | None |
| role_id | Integer() | None | True | None | - | roles.id | None |
| api_token | String(length=80) | None | True | True | - | - | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| role | roles |
MANYTOONE | None |
| affiliations_usergroups | usergroups |
ONETOMANY | None |
| usergroups | usergroups |
ONETOMANY | None |
| datasource_custodianships | datasource_custodian |
ONETOMANY | None |
ASSOCIATION PROXIES FILTERABLE
| ATTRIBUTE | MODEL | COLLECTION | DESCRIPTION |
| affiliations | group |
affiliations_usergroups | Proxy attribute that presents the linked group objects from the affiliations_usergroups collection |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| affiliations_names | method | None |
| full_name | method | None |
| get_id | method | None |
| is_active | method | None |
| is_anonymous | method | None |
| is_authenticated | method | None |
vocab_element
Vocab Element resource: locally cached version of element from vocab_registry
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/vocab_element Create new vocab_element object. Expects JSON. Fields shown in Preprocessors:
|
| PATCH |
/api/vocab_element/<id> Update single vocab_element object with pk field matching param Preprocessors:
|
| GET |
/api/vocab_element Get list of vocab_element objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/vocab_element/<id> Get single vocab_element object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/vocab_element/<id> Delete single vocab_element object with pk field matching param Preprocessors:
|
| GET |
/api/vocab_element/<registry_key>/<element_key>
None
|
| POST |
/api/vocab_element/<registry_key>/<element_key>
None
|
| PATCH |
/api/vocab_element/<registry_key>/<element_key>
None
|
| POST |
/api/vocab_element/<registry_key>/<element_key>/label/<label_id>
None
|
| DELETE |
/api/vocab_element/<registry_key>/<element_key>/label/<label_id>
None
|
| GET |
/api/vocab_element/nested
None
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=128) | None | False | False | - | - | None |
| key | String(length=96) | None | False | None | - | - | None |
| lineage | JSON() | None | True | None | - | - | None |
| data | JSON() | None | True | None | - | - | None |
| mapped_registries | JSON() | None | True | None | - | - | None |
| description | Text() | None | True | None | - | - | None |
| parent_key | String(length=96) | None | True | None | - | - | None |
| vocab_registry_key | String(length=96) | None | False | None | - | vocab_registry.key | The |
| user_id | Integer() | None | False | None | - | users.id | The |
| created_at | DateTime() | function | True | None | - | - | None |
| updated_at | TIMESTAMP() | function | True | None | - | - | Updated time (UTC) |
| origin_updated_at | DateTime() | None | True | None | - | - | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| vocab_registry | vocab_registry |
MANYTOONE | The |
| user | users |
MANYTOONE | The user who owns or created and owns this record |
| labels | label |
MANYTOMANY | A list of |
| other_names | vocab_element_names |
ONETOMANY | None |
| label_vocab_element | label_vocab_element |
ONETOMANY | None |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| mapped_labels | method | None |
| reference_url | method | None |
| reference_url_parent | method | None |
vocab_element_names
VocabElement Names resource.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/vocab_element_names Create new vocab_element_names object. Expects JSON. Fields shown in Preprocessors:
|
| PATCH |
/api/vocab_element_names/<id> Update single vocab_element_names object with pk field matching param Preprocessors:
|
| GET |
/api/vocab_element_names Get list of vocab_element_names objects matching API query. See Making API search queries for instructions on making search queries Preprocessors:
|
| GET |
/api/vocab_element_names/<id> Get single vocab_element_names object with pk field matching param Preprocessors:
|
| DELETE |
/api/vocab_element_names/<id> Delete single vocab_element_names object with pk field matching param Preprocessors:
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| id | Integer() | None | False | None | True | - | Primary key |
| name | String(length=128) | None | False | False | - | - | None |
| vocab_element_id | Integer() | None | False | None | - | vocab_element.id | None |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| vocab_element | vocab_element |
MANYTOONE | None |
vocab_registry
Vacab Registry resource: defines a mapping to a vocab registry module and handles interactions with them.
ENDPOINTS
| METHOD | ENDPOINT |
| POST |
/api/vocab_registry Create new vocab_registry object. Expects JSON. Fields shown in Sets attributes on the constructed instance using the names and
values in Only keys that are present as attributes of the instance's class are allowed. These could be, for example, any mapped columns or relationships. Preprocessors:
|
| PATCH |
/api/vocab_registry/<key> Update single vocab_registry object with pk field matching param Preprocessors:
|
| GET |
/api/vocab_registry Get list of vocab_registry objects matching API query. See Making API search queries for instructions on making search queries
Included fields: Preprocessors:
|
| GET |
/api/vocab_registry/<key> Get single vocab_registry object with pk field matching param
Included fields: Preprocessors:
|
| DELETE |
/api/vocab_registry/<key> Delete single vocab_registry object with pk field matching param Preprocessors:
|
| GET |
/api/vocab_registry/<key>/match
None
|
| GET |
/api/vocab_registry/<key>/get_element
None
|
| GET |
/api/vocab_registry/<key>/get_all_elements
None
|
| GET |
/api/vocab_registry/<key>/get_children
None
|
MODEL COLUMNS FILTERABLE
| NAME | TYPE | DEFAULT | NULLABLE | UNIQUE | PRIM_KEY | FORGN_KEY | DESCRIPTION |
| key | String(length=96) | None | False | True | True | - | None |
| name | String(length=128) | None | False | True | - | - | None |
| module | String(length=96) | None | False | None | - | - | None |
| module_kwargs | JSON() | None | True | None | - | - | None |
| vocab_element_key_name | String(length=96) | None | True | None | - | - | None |
| description | Text() | None | True | None | - | - | None |
| user_id | Integer() | None | False | None | - | users.id | The |
| created_at | DateTime() | function | True | None | - | - | None |
| updated_at | TIMESTAMP() | function | True | None | - | - | Updated time (UTC) |
RELATED MODELS FILTERABLE
| FIELD | RELATION | DIRECTION | DESCRIPTION |
| user | users |
MANYTOONE | The user who owns or created and owns this record |
| vocab_elements | vocab_element |
ONETOMANY | None |
OTHER MODEL ATTRIBUTES FILTERABLE
| NAME | TYPE | DESCRIPTION |
| registry_urls | method | None |
| registry_plugin | property | None |
Making API queries
Pagination
/api/resource?results_per_page=...&page=...
Responses to most GET requests (with the exception of the export endpoints) are paginated by default, with at most ten objects per page. To request a specific page,
add a page=N query parameter to the request URL, where N is a positive integer (the first page is page one). If no
page query parameter is specified, the first page will be returned.
In order to specify the number of results per page, add the query parameter results_per_page=N where N is a
positive integer. If results_per_page is greater than the maximum number of results per page as configured by
the server, then the query parameter will be ignored.
In addition to the "objects" list, the response JSON object will have a "page" key with the current
page number, a "num_pages" key with total number of pages into which the set of matching instances is
divided, and a "num_results" key with total number of instances which match the requested search.
Query format:
/api/resource?q={"filters":[...],"limit":...,"offset":...,"order_by":[...],"group_by":[...],"single":...}
The query parameter q must be a JSON string. It can have the following mappings, all of which are optional:
-
filters -
A list of
<filterobjects>of one of the following forms:{"name": <fieldname>, "op": <operatorname>, "val": <argument>}Where
<operatorname>is one of the strings described below,<argument>is a value to be used as the second argument to the given operator and<fieldname>is the name of the field of the model to which to apply the operator, which can be either aMODEL COLUMN,RELATED MODEL,ASSOCIATION PROXYorHYBRID ATTRIBUTEfor a resource.The first
<fieldname>may specify a field on a related model, if it is a string of the form<relationname>__<fieldname>. Alternatively if the field name is the name of a relation and the operator is"has"or"any", the"val"argument can be a dictionary with the arguments representing another, nested filter to be applied as the argument for"has"or"any".To create a filter from comparing fields within a table:
Where the first{"name": <fieldname>, "op": <operatorname>, "field": <fieldname>}<fieldname>and<operatorname>are as above and the second<fieldname>is the field of the model that should be used as the second argument to the operator.Filter objects can also be defined on Hybrid Attributes of a model.
hybrid propertyfilter objects are defined in the same way as column fields, but to filter by ahybrid methodwith one or more input arguments (<arg1>,...,<argN>) or key word arguments ({<key1>:<val1>,...,<keyN>:<valN>}), the object can be defined as:{"name": {"method":<method_name>,"args":[<arg1>,...,<argN>],"kwargs":{<key1>:<val1>,...,<keyN>:<valN>}}, "op": <operatorname>, "val": <argument>}For
JSONtypeMODEL COLUMNS, you can define nested fields as follows:
Where the{"name": <fieldname>.<property1>.<property2>, "op": <operatorname>, "val": <argument>}<property*>are nested keys or properties in theJSONcolumn value.The
<operatorname>strings recognized by the API include:==,eq,equals,equals_to"equal to" operator, where valcan be numeric or string!=,neq,does_not_equal,not_equal_to"not equal to" operator, where valcan be numeric or string>,gt,<,lt"less/greater than" operator, where valis typically numeric>=,ge,gte,geq,<=,le,lte,leq"less/greater than or equal to" operator, where valis typically numericin,not_in"is in" operator, where valis typically a list of valuesis_null,is_not_null"is null" check, where there is no valparamlike,ilike:"like" (case sensitive) or "ilike" (case insensitive) comparison, where valis a string. Wildcards can be included as a%symbol (or%25url-encoded).hasfor nesting operators on a relation that is a single object (i.e.: MANYTOONE)anyfor nesting operators on a relation that is a list of objects (i.e.: ONETOMANY/MANYTOMANY)For geometry columns, there are also some spatial operators for
<operatorname>, which include:geo_atGeometry / Geography type <fieldname>is close to a nominatedlat/lon. Thevaltakes the form:{"lat":...,"lon":...,"dist":...}wheredistis optional and defaults to0.00005. For Geometry typesdistis in srid units (eg: degrees), for Geography types it is meters. Hint: assume Geometry types most of the time.geo_in_bboxGeo-typed <fieldname>is within a bounding box. Thevaltakes the form:[p1,p2], which is a list containing two elements being two diagonal points defining the bounding box, eg:[bottom-left, top-right].p1,p2are position objects of the form,{"lat":...,"lon":...}geo_in_polyGeo-typed <fieldname>is within a closed polygon. Thevaltakes the form:[p1,p2,...,pN,p1], which is a list containing points defining a polygon, wherep1,p2are position objects of the form,{"lat":latitude,"lon":longitude}andlatitudeandlongitudeare signed floating point numbers in decimal degrees.geo_in_poly_xySame as in geo_in_poly, but the list of pointsp1-pNare each a more compact 2-element list of the form[longitude, latitude]wherelatitudeandlongitudeare signed floating point numbers in decimal degrees.geo_in_poly_yxSame as in geo_in_poly_xy, butp1-pNare each of the form[latitude, longitude], as defined above.geo_in_mpoly_xyGeo-typed <fieldname>is within a multi-part polygon, without holes. Thevalis a list of polygons of the form:[poly1, poly2,...,polyN], where each polygonpoly1-polyNis of the form[p1,p2,...,pN,p1], the pointsp1-pNare each a 2-element list, as defined ingeo_in_poly_xy, above.geo_in_polyh_xyGeo-typed <fieldname>is within a polygon, with holes. Thevalis a list of polygons of the form:[outer_ring, hole1, hole2,...,holeN], whereouter_ringis the main polygon andhole1-holeNare polygons defining the holes. Each polygon,outer_ring, hole1-holeNare of the form[p1,p2,...,pN,p1], where the pointsp1-pNare each a 2-element list, as defined ingeo_in_poly_xy, above.geo_in_mpolyh_xyGeo-typed <fieldname>is within a multi-part polygon, each with holes. Thevalis a list of lists of polygons of the form:[polyh1,polyh2,...,polyhN], where each polygonpolyh1-polyhNis a list of polygons, each of the form[outer_ring, hole1, hole2,...,holeN]as defined ingeo_in_polyh_xy, above.Filters can also exclude results, for example:
{"not": <filterobject>}Filter objects can also be arbitrary Boolean formulas, for example:
{"or": [<filterobject>, {"and": [<filterobject>, ...]}, ...]}The returned list of matching instances will include only those instances that satisfy all of the given filters.
If a filter is poorly formatted (for example, op is set to
'=='but val is not set), the server responds with 400 Bad Request. limit- A positive integer which specifies the maximum number of objects to return.
offset- A positive integer which specifies the offset into the result set of the returned list of instances.
order_byA list of objects of the form:
{"field": <fieldname>, "direction": <directionname>}where
<fieldname>is a string corresponding to the name of a field of the requested model and<directionname>is either"asc"for ascending order or"desc"for descending order.<fieldname>may alternately specify a field on a related model, if it is a string of the form<relationname>__<fieldname>.Ordering can also be defined on Hybrid Attributes of a model.
hybrid propertyorder_by objects are defined in the same way as column fields, but to filter by ahybrid methodwith one or more input arguments (<arg1>,<arg2>,...<argN>), the object can be defined as:{"field": {"method":<method_name>,"args":[<arg1>,<arg2>,...<argN>]}, "direction": <directionname>}group_byA list of objects of the form:
{"field": <fieldname>}where
<fieldname>is a string corresponding to the name of a field of the requested model.<fieldname>may alternately specify a field on a related model, if it is a string of the form<relationname>__<fieldname>.single- A Boolean representing whether a single result is expected as a result of the
search. If this is
trueand either no results or multiple results meet the criteria of the search, the server responds with an error message.
Data transformation and batch operations
/api/resource?f={...}&save={...}
Some endpoints support data transformation and manipulation of the output using the data transformation API. This allows users to define a sequence of operations that can be used to transform the output of the response in order to (i) export data in a desired format or (ii) perform batch import operations.
f is a JSON object with a list of operations, run in order on the output of the previous
one. Each operation is {"method": ..., "module": ..., "kwargs": {...}}: with a module,
the operation is a helper of that module (eg: {"module": "pandas", "method": "json_normalize"});
without one, it is a method of the data itself, a pandas DataFrame (eg:
{"method": "rename", "kwargs": {"columns": {"a": "b"}}}). File read_* operations parse
the file content (never a path or URL). Only the operations listed below are allowed; anything else, including
writing files, is refused with a 400 error.
- Data (DataFrame) methods:
abs,add_prefix,add_suffix,assign,astype,bfill,clip,convert_dtypes,copy,count,cumsum,describe,diff,drop,drop_duplicates,dropna,explode,ffill,fillna,filter,head,infer_objects,interpolate,isna,max,mean,median,melt,min,nlargest,notna,nsmallest,nunique,pivot_table,rank,reindex,rename,rename_axis,replace,reset_index,round,set_index,shift,sort_index,sort_values,stack,sum,tail,to_dict,transpose,unstack,value_counts pandasmodule:column_operation,concat_columns,count_unstack,format_column,from_dict,get_columns,get_info,groupby_concat,groupby_count,json_normalize,move_column,pivot_table,read_csv,read_excel,read_fwf,read_json,read_tabledatamodule:flatten_dicts,unflatten_dictspandas.column_operationoperations (operation, withargs/kwargs):abs,astype,bfill,clip,cumsum,diff,dt.ceil,dt.floor,dt.normalize,dt.round,dt.strftime,dt.tz_convert,dt.tz_localize,ffill,fillna,infer_objects,interpolate,isna,notna,rank,replace,round,shift,str.capitalize,str.cat,str.center,str.contains,str.count,str.endswith,str.extract,str.find,str.fullmatch,str.get,str.join,str.len,str.ljust,str.lower,str.lstrip,str.match,str.pad,str.removeprefix,str.removesuffix,str.replace,str.rjust,str.rsplit,str.rstrip,str.slice,str.split,str.startswith,str.strip,str.title,str.upper,str.wrap,str.zfillpandas.format_columntakes plain{column}fields only.
Example: export an annotation set as a CSV file with one row per annotation and nested fields as columns:
/api/annotation_set/123/export?template=dataframe.csv&f={"operations":[{"module":"pandas","method":"json_normalize"}]}