Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Get all the descendants of an entity. The results are paginated. Use the optional query parameter limit to set the maximum page size. The default page size is 20. To fetch the next page, find the last entity (descendant) on the current page and use its ID to set the query parameter lastEntityId. Here is an example:

...

Code Block
languagebash
titleResponse for getting the first page
collapsetrue
{
    "idList": [
        {
            "id": "syn111"
        }, 
        {
            "id": "syn112"
        }
    ]
}

Code Block
languagebash
titleRequest for getting the second page
curl -i -H sessionToken:<yourToken> -H Accept:application/json 'https://repo.prod.sagebase.org/repo/v1/entity/syn1125146<entityID>/descendants?limit=20&lastEntityId=syn112'
Code Block
languagebash
titleResponse for getting the second pagecollapsetrue
{
    "idList": [
        {
            "id": "syn113"
        }, 
        {
            "id": "syn115syn114"
        }, 
        {
            "id": "syn116syn115"
        }
    ]
}

Get the descendants of a specific generation

Get all the descendants that are exactly n generations away. The children is generation 1. Children's children are generation 2. So on and so forth. The results are paginated in the same manner. To fetch the next page, find the last entity (descendant) on the current page and use its ID to set the query parameter lastEntityId.  Here is an example:

# To be written
Code Block
languagebash
titleRequest for getting the first page
descendants of the 2nd generation
curl -i -H sessionToken:<yourToken> -H Accept:application/json 'https://repo.prod.sagebase.org/repo/v1/entity/<entityID>/descendants/2
# To be written
Code Block
Code Block
languagebash
titleResponse for getting the second page
collapsetrue
languagebash
titleResponse for getting the first page
collapsetrue
# To be written
Code Block
languagebash
titleRequest for getting the second page
# To be written
the descendants of the 2nd generation
{
    "idList": [
        {
            "id": "syn114"
        }, 
        {
            "id": "syn115"
        }
    ]
}

 

References

Find reference to any version of an entity

...