Skip to content

MP Data Manager API Documentation

Ryan Hodges edited this page Oct 13, 2022 · 19 revisions

API Documentation

This document lays out all API endpoints offered by MP Data Manager.

Endpoints

/data_manager/api/

This endpoint is intended for future development to migrate historic API endpoints into Django's REST Framework.

As of the time of this writing, little work on this has been done, and so this endpoint serves little purpose, but to hint at all of the great features embedded into Django Rest Framework: Open the Endpoint

/data_manager/api/layers/

A simple ViewSet for Layers

[DEPRECATED] /data_manager/layer/[LAYER_ID]

Updates the details of a particular layer via POST.

Arguments (PATH)

Argument Format Example
layer_id string [A-Za-z0-9_-]+ 3971

Output

JSON Response:

Argument Type Example
status_code int 200
success boolean True
message string 'Edited Successfully'
layer JSON object {...}
themes array [ {...},{...},...]

Examples

TBH: This doesn't seem to be used anymore.

[DEPRECATED] data_manager/layer

Create a new layer via POST

Arguments

Argument Format Example
url string https://coast.noaa.gov/arcgis/rest/services/MarineCadastre/2015VesselTransitCounts_AllVessels/MapServer/
name string New Layer
layer_type string 'ArcREST'
themes array [0,4,27]

For 'layer_type' values, please review your local settings for "LAYER_TYPE_CHOICES"

Output

JSON Response:

Argument Type Example
status_code int 200
success boolean True
message string 'Saved Successfully'
layer JSON object {...}
themes array [ {...},{...},...]

/data_manager/get_json

Get JSON of all Layers, Themes, and current state via GET

Arguments

Argument Format Example
None N/A N/A

Output

JSON Response:

Argument Type Example
state JSON Object {}
layers Array of Objects [{...},{...},...]
themes Array of Objects [{...},{...},...]
success boolean true

Example: https://portal.midatlanticocean.org/data_manager/get_json

/data_manager/get_themes

Get JSON of all Themes via GET

Purpose: reduce delay compared to get_json by substantially reducing content size

Arguments

Argument Format Example
None N/A N/A

Output

JSON Response:

Argument Type Example
themes Array of Objects [{id:1, name: "administrative", display_name: "Administrative", is_visible: true},{...},...]

Example: https://portal.midatlanticocean.org/data_manager/get_themes

/data_manager/get_layer_search_data

Get JSON Object of all layers ordered by name to support typeahead search field via get.

Arguments

Argument Format Example
None N/A N/A

Output

JSON Response:

Argument Type Example
[layer_name] JSON Object {layer:{id:...,name:...,has_sublayers:...,sublayers:[...]},theme:{id:...,name:...,description:...}}

Example: https://portal.midatlanticocean.org/data_manager/get_layer_search_data

/data_manager/get_layers_for_theme/[THEME_ID]

Provided a Theme ID, retrieve a JSON representation of the Theme's layers via GET

Arguments

Argument Format Example
themeID string 1

Output

JSON Response:

Argument Type Example
layers Array of Objects [{id:...,name:...,type:...,has_sublayers:...,sublayers:[{...}....]},...]

Example: https://portal.midatlanticocean.org/data_manager/get_layers_for_theme/1

Clone this wiki locally