Skip to content

Mapping endpoints

tudorgroza edited this page Mar 5, 2021 · 14 revisions

TOC

RETRIEVE

  • Endpoint: GET /v1/projects/{projectId}/mappings?entityId=<entityId>
  • Response (Entity):
200 | OK

{
  "id": "60252fc2d5efd95ee8890ead",
  "name": "Achondroplasia",
  "mappingStatus": "AUTO_MAPPED | ...",
  "source": <SOURCE_OBJECT>,
  "mappingSuggestions": [
      <MAPPING_SUGGESTION_OBJECT>
  ],
  "mapping": <MAPPING_OBJECT>,
  "created": {
    "user": {
      "name": "Test User 1",
      "email": "[email protected]"
    },
    "timestamp": "2021-02-11T21:23:14.156+08:00"
  }
}

OR

404 | NOT FOUND
  • If projectId or entityId are inexistent or user doesn't have access to projectId

ASSIGN

  • Endpoint: POST /v1/projects/{projectId}/mappings
  • Payload (Short version of a MappingSuggestion):
{
  "entityId": "60252fc2d5efd95ee8890ead",
  "ontologyTerm": {
    "curie": "MONDO:0007037",
    "iri": "http://purl.obolibrary.org/obo/MONDO_0007037",
    "label": "Achondroplasia",
    "status": "NEEDS_IMPORT | ..."
  }
}
200 | OK

{
  "id": "60252fc2d5efd95ee8890ead",
  "name": "Achondroplasia",
  "mappingStatus": "AUTO_MAPPED | ...",
  "source": <SOURCE_OBJECT>,
  "mappingSuggestions": [
      <MAPPING_SUGGESTION_OBJECT>
  ],
  "mapping": <MAPPING_OBJECT>,
  "created": {
    "user": {
      "name": "Test User 1",
      "email": "[email protected]"
    },
    "timestamp": "2021-02-11T21:23:14.156+08:00"
  }
}

OR

404 | NOT FOUND
  • If projectId is inexistent or user doesn't have access to it