Skip to content

Entity endpoints

tudorgroza edited this page Apr 6, 2021 · 7 revisions

TOC

RETRIEVE ALL

  • Endpoint: GET /v1/projects/{projectId}/entities?search=<search>&page=<PAGE>&size=<SIZE> (page and size are optional, with default values of 0 and 20, respectively)
  • The search parameter provides free-text search capabilities over the name field of the entities
  • Sorting: Add sort=<FIELD>,asc/desc param to the endpoint. List of accepted fields for sorting: context, priority and mappingStatus. asc / desc values are optional.
  • Response (Paginated list of Entity):
200 | OK

{
    "content": [
        {
          "id": "60252fc2d5efd95ee8890ead",
          "name": "Achondroplasia",
          "mappingStatus": "AUTO_MAPPED | ...",
          "source": <SOURCE_OBJECT>,
          "upstreamId": "STRING",
          "context": "STRING",
          "priority": INTEGER,
          "mappingSuggestions": [
              <MAPPING_SUGGESTION_OBJECT>
          ],
          "mapping": <MAPPING_OBJECT>,
          "auditTrail": [
              <AUDIT_OBJECT>
          ],
          "created": {
             "user": {
                 "name": "Test User 1",
                 "email": "[email protected]"
             },
          "timestamp": "2021-02-11T21:23:14.156+08:00"
      },
        ...
    ],
    "number": 0,
    "size": 20,
    "totalElements": 0,
    "pageable": {
        "sort": {
            "sorted": false,
            "unsorted": true,
            "empty": true
        },
        "offset": 0,
        "pageNumber": 0,
        "pageSize": 20,
        "paged": true,
        "unpaged": false
    },
    "last": true,
    "totalPages": 0,
    "sort": {
        "sorted": false,
        "unsorted": true,
        "empty": true
    },
    "first": true,
    "numberOfElements": 0,
    "empty": true
}

OR

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

RETRIEVE ONE

  • Endpoint: GET /v1/projects/{projectId}/entities/{entityId}
  • Response (Entity):
200 | OK

{
  "id": "60252fc2d5efd95ee8890ead",
  "name": "Achondroplasia",
  "mappingStatus": "AUTO_MAPPED | ...",
  "source": <SOURCE_OBJECT>,
  "upstreamId": "STRING",
  "context": "STRING",
  "priority": INTEGER,
  "mappingSuggestions": [
      <MAPPING_SUGGESTION_OBJECT>
  ],
  "mapping": <MAPPING_OBJECT>,
  "auditTrail": [
      <AUDIT_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