Map of Life API Documentation

Authentication Endpoints

Dataset Endpoints (user)

Species Endpoints

Authentication Endpoints

Login

Endpoint: https://auth.mol.org/api/login

Request fields:

Response: (Store and use the authtoken for authenticated requests. Refer to the Profile for example)

{
    "message": "Successfully logged in.",
    "authtoken": "abc123",
    "status": "OK",
    "success": "True"
}

Register

Endpoint: https://auth.mol.org/api/register

Request fields:

Response: (Store and use the authtoken for authenticated requests. Refer to the Profile for example)

{
    "message": "Successfully registered user.",
    "authtoken": "abc123",
    "status": "OK",
    "success": "True",
    "id": "1",
    "username": "Username",
    "email": "user@email.com",
    "firstname": "first name",
    "lastname": "last name"
}

Profile

Endpoint: https://auth.mol.org/api/me

Request header:

Response:

{
    "id": "1",
    "username": "Username",
    "email": "user@email.com",
    "firstname": "first name",
    "lastname": "last name",
    "fullname": "full name"
}

Forgot Password

Endpoint: https://auth.mol.org/reset

Flow:

It would be better, for now, if the app can load up the user-preferred browser and navigate to https://auth.mol.org/reset. This will automatically figure out the flow for the user to reset their password.

Dataset Endpoints

Add dataset

Endpoint: https://api.mol.org/1.x/acl/member/dataset/add

Request header:

Request fields:

Response:

{
    "dataset_id": "3841cef6-06de-4840-a3df-1680938856bd",
    "status": "OK",
    "success": "True"
}

Add dataset feature (species polygon)

Endpoint: https://api.mol.org/1.x/acl/member/dataset/addfeature

Request header:

Request fields:

Response:

{
    "dataset_id": "3841cef6-06de-4840-a3df-1680938856bd",
    "status": "Feature added"
}

Get dataset feature (species polygon)

Endpoint: https://api.mol.org/1.x/acl/member/dataset/feature

Request header:

Request fields:

Response:

{
    "dataset_id": "3841cef6-06de-4840-a3df-1680938856bd",
    "molid": "d2c71297-fad4-47ba-9190-69fadfbe05a2",
    "feature": {
        "dataFeatures": {},
        "attrFeatures": {},
        "geomFeatures": {}
    }
}

Finalize dataset

Endpoint: https://api.mol.org/1.x/acl/member/dataset/done

Request header:

Request fields:

Response:

{
    "dataset_id": "3841cef6-06de-4840-a3df-1680938856bd",
    "status": "Completed"
}

Get dataset records (list of features)

Endpoint: https://api.mol.org/1.x/acl/member/dataset/records

Request header:

Request fields:

Response:

{
  "total_count": 1,
  "records": [
    {
      "taxa": "birds",
      "uncertainty": null,
      "recid": "d94f7277-7ac7-4a3c-a361-e9dfbd264673",
      "common": "Regent Honeyeater",
      "scientificname": "Xanthomyza phrygia",
      "displaydate": "2019-10-22"
    }
  ]
}

Get Dataset Overview

Endpoint: https://api.mol.org/1.x/acl/member/dataset/overview

Request header:

Request fields:

Response:

[
  {
    "sites_list": null,
    "records_list": [
      {
        "recid": "321cf4ac-479b-48d8-8b8d-0befe25030da",
        "family": null,
        "taxa": "birds",
        "uncertainty": null,
        "tc_id": null,
        "scientificname": "Xanthomyza phrygia",
        "common": "Regent Honeyeater",
        "family_common": null,
        "displaydate": "2019-10-21"
      }
    ],
    "group_list": [
      {
        "taxa": "birds",
        "count": 1
      }
    ],
    "summary": {
      "status": "QUEUED",
      "extents": {
        "minx": 150.596062,
        "miny": -29.38352,
        "maxx": 154.682976,
        "maxy": -26.314496
      },
      "taxa": "birds",
      "mol_modeling": false,
      "release_date": "2019-10-21T00:00:00+00:00",
      "allow_download": false,
      "product_type": "range",
      "counts": {
        "taxa": 1,
        "records": 1,
        "species": 1,
        "sites": 1
      },
      "public": false,
      "dataset_title": "test 1111"
    },
    "species_list": [
      {
        "taxa": "birds",
        "tc_id": null,
        "scientificname": "Xanthomyza phrygia",
        "common": "Regent Honeyeater",
        "count": 1
      }
    ],
    "metadata": [
      {
        "section": "General",
        "children": [
          {
            "type": "text",
            "id": "license",
            "value": "CC-0",
            "label": "License"
          }
        ]
      }
    ]
  }
]

Update dataset metadata

Endpoint: POST https://api.mol.org/1.x/acl/member/dataset/update

Request header:

Request fields:

Json body

You must have the dataset_id in the json body.

{
  "dataset_id": "dataset id",
  "metadata_key1" : "metadata_value",
  "metadata_key2" : 100
} 

Response:

[]

Species Endpoints

Get list of available taxa

Endpoint: https://api.mol.org/1.x/species/availabletaxa

Response:

[
  {
    "description": null,
    "title": "Birds",
    "taxa": "birds",
    "tc_id": "bdac5ba6-6efd-4549-ad01-474c154434c2",
    "sortby": 5,
    "groupby_sortby": 1,
    "groupby": "Vertebrates",
    "icon": null
  },
  {
    "description": null,
    "title": "Mammals",
    "taxa": "mammals",
    "tc_id": "93c1ee00-bb6d-4c8c-81ce-b5ea2ec290e1",
    "sortby": 10,
    "groupby_sortby": 1,
    "groupby": "Vertebrates",
    "icon": null
  }, ...
]

Species group search

Endpoint: https://api.mol.org/1.x/species/groupsearch

Request fields:

Example: https://api.mol.org/1.x/species/groupsearch?query=fairywren

Response

[
  {
    "taxa": "birds",
    "tc_id": "027b80ef-d1d3-11e6-938d-5f1f794db59f",
    "vernacular": "White-Shouldered Fairywren",
    "scientificname": "Malurus alboscapulatus"
  }, 
  ...,
  {
    "taxa": "birds",
    "tc_id": "03c1a49b-d1d3-11e6-938d-abe7c8638281",
    "vernacular": "Lovely Fairywren",
    "scientificname": "Malurus amabilis"
  }
]

Get Species info

Endpoint: https://api.mol.org/1.x/species/info

Request fields:

Example: https://api.mol.org/1.x/species/info?scientificname=Malurus%20cyaneus

Response:

[
  {
    "info": [
      {
        "content": "The superb fairywren (Malurus cyaneus)....",
        "source": "Wikipedia",
        "lang": "en"
      }
    ],
    "redlist": "LC",
    "rangemap": "https://api.mol.org/map?name=Malurus%20cyaneus",
    "sequenceid": 650,
    "family": [
      {
        "lang": "en",
        "name": "Fairywrens And Allies"
      },
      {
        "lang": "la",
        "name": "Maluridae"
      }
    ],
    "taxa": "birds",
    "commonname": "Superb Fairywren",
    "redlist_citation_short": "IUCN (2016)",
    "tc_id": "027b80f2-d1d3-11e6-938d-83ef49ec82ed",
    "updated_at": "2017-09-29T05:25:03Z",
    "bounds": {
      "northEast": {
        "lat": -22.57058,
        "lng": 153.63924
      },
      "southWest": {
        "lat": -43.64806,
        "lng": 134.83942
      }
    },
    "redlist_link": "http://www.iucnredlist.org/details/22703736/0",
    "scientificname": "Malurus cyaneus",
    "redlist_citation_full": "BirdLife International 2016. Malurus cyaneus. The IUCN Red List of Threatened Species 2016: e.T22703736A93934554. http://dx.doi.org/10.2305/IUCN.UK.2016-3.RLTS.T22703736A93934554.en",
    "image": {
      "asset_id": "cecf58162fc9452aa26f6e9106372f7b",
      "url": "https://lh3.googleusercontent.com/GVpJwmEGP6Gyhylp5EBQMByvjcD6mNVn5X4aJTGAhXNksnOy4J8TjKoIpbjruz59yu85iB4bSXfu_K4XTjdZ4RM",
      "license": "http://creativecommons.org/licenses/by-sa/3.0/",
      "copyright": ""
    }
  }
]

Get Datasets for a species

Endpoint: https://api.mol.org/1.x/species/datasets

Request fields:

Example: https://api.mol.org/1.x/species/datasets?scientificname=Malurus%20cyaneus

Response:

[
  {
    "user_dataset": false,
    "product_type": "range",
    "type_title": "Expert range maps",
    "bounds": {
      "northEast": {
        "lat": -22.7643,
        "lng": 153.63924
      },
      "southWest": {
        "lat": -43.61572,
        "lng": 135.14565
      }
    },
    "no_rows": 1,
    "visible": true,
    "dataset_id": "704898e7-b945-4721-b201-9286bd00c0a9",
    "public": true,
    "dataset_title": "BirdLife International (2011)"
  }, 
  ...
]