# Related entities of a specific service through the environment API V2

**URL:** <https://community.dynatrace.com/t/related-entities-of-a-specific-service-through-the-environment-api-v2/53422>\
**Category:** Dynatrace API\
**Tags:** dynatrace-api\
**Created:** [September 19, 2025, 11:14am UTC](https://community.dynatrace.com/t/related-entities-of-a-specific-service-through-the-environment-api-v2/53422 "2025-09-19T11:14:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![svendb1803](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svendb1803](https://community.dynatrace.com/u/svendb1803)\
**Post date:** [September 19, 2025, 11:14am UTC](https://community.dynatrace.com/t/related-entities-of-a-specific-service-through-the-environment-api-v2/53422/1 "2025-09-19T11:14:42Z")

</div>

Hello

I am trying to get the related entities of a specific service via the environment api. I am using the FromRelations.Calls relationship. I have read the documentation, but unfortunately i am not able to make it work.

This is what i am trying to execute.

```auto
curl -X 'GET' \ 'https://#########blanked out########/api/v2/entities?entitySelector=fromRelationships.Calls%28entityId%28SERVICE-1AAA4F%29%29' \ -H 'accept: application/json; charset=utf-8' \ -H 'Authorization: Api-Token ####blanked out####'

```

output is

```auto
{ "error": { "code": 400, "message": "Constraints violated.", "constraintViolations": [ {
        "path": "entitySelector", "message": "The entitySelector parameter must contain entity type information on all levels, not determinable on level with values: fromrelationships.calls", "parameterLocation": "QUERY", "location": null
      }
    ]
  }
}

```

Can someone try to help me out here with the syntax? Thank you in advance!

---

<div class="post-metadata">

**Author:** ![AntonPineiro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/antonpineiro/32/49_2.png) [@AntonPineiro](https://community.dynatrace.com/u/AntonPineiro)\
**Post date:** [September 19, 2025, 1:01pm UTC](https://community.dynatrace.com/t/related-entities-of-a-specific-service-through-the-environment-api-v2/53422/2 "2025-09-19T13:01:56Z")

</div>

Hi,

I am using this and I can see relations in the output:

```markup
curl -X 'GET' \
  'https://XXXXX.live.dynatrace.com/api/v2/entities/SERVICE-XXXXX' \
  -H 'accept: application/json; charset=utf-8' \
  -H 'Authorization: Api-Token XXXXX'

```

Best regards

---

<div class="post-metadata">

**Author:** ![SjoerdB](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/sjoerdb/32/157_2.png) [@SjoerdB](https://community.dynatrace.com/u/SjoerdB)\
**Post date:** [September 19, 2025, 1:22pm UTC](https://community.dynatrace.com/t/related-entities-of-a-specific-service-through-the-environment-api-v2/53422/3 "2025-09-19T13:22:07Z")

</div>

I haven’t tested it, but it seems it wants to get type information, hence something like entityselector=type(SERVICE),fromRelationships.Calls(…) , to determine the base type it needs to query…

As mentioned, not tested but my first though…

---

<div class="post-metadata">

**Author:** ![svendb1803](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@svendb1803](https://community.dynatrace.com/u/svendb1803)\
**Post date:** [September 22, 2025, 5:36am UTC](https://community.dynatrace.com/t/related-entities-of-a-specific-service-through-the-environment-api-v2/53422/4 "2025-09-22T05:36:32Z")

</div>

i found it. thanks for the insight

$CurlArgument = ‘X’, ‘GET’, ‘https://################/api/v2/entities?entitySelector=type%28SERVICE%29%2Cfromrelationships.calls%28entityID%28SERVICE-5123456789EF%29%29’,  
‘-H’, ‘accept: application/json; charset=utf-8’, ‘-H’, ‘Authorization: Api-Token ####################’
