-
Notifications
You must be signed in to change notification settings - Fork 1
MP Data Manager API Documentation
This document lays out all API endpoints offered by MP Data Manager.
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
A simple ViewSet for Layers
- Arguements (query string): format ['json', 'api']
- Allow: GET, HEAD, OPTIONS
- Return: JSON
- Examples:
- HTML: Mid Atlantic Portal
- JSON: Mid Atlantic Portal
Updates the details of a particular layer via POST.
| Argument | Format | Example |
|---|---|---|
| layer_id | string [A-Za-z0-9_-]+
|
3971 |
JSON Response:
| Argument | Type | Example |
|---|---|---|
| status_code | int | 200 |
| success | boolean | True |
| message | string | 'Edited Successfully' |
| layer | JSON object | {...} |
| themes | array | [ {...},{...},...] |
TBH: This doesn't seem to be used anymore.
Create a new layer via POST
| 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"
JSON Response:
| Argument | Type | Example |
|---|---|---|
| status_code | int | 200 |
| success | boolean | True |
| message | string | 'Saved Successfully' |
| layer | JSON object | {...} |
| themes | array | [ {...},{...},...] |
Get JSON of all Layers, Themes, and current state via GET
| Argument | Format | Example |
|---|---|---|
| None | N/A | N/A |
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
Get JSON of all Themes via GET
Purpose: reduce delay compared to get_json by substantially reducing content size
| Argument | Format | Example |
|---|---|---|
| None | N/A | N/A |
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
Get JSON Object of all layers ordered by name to support typeahead search field via get.
| Argument | Format | Example |
|---|---|---|
| None | N/A | N/A |
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
Provided a Theme ID, retrieve a JSON representation of the Theme's layers via GET
| Argument | Format | Example |
|---|---|---|
| themeID | string | 1 |
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