# Bad Request - Specifying types in document get requests is deprecated

**URL:** https://discuss.elastic.co/t/bad-request-specifying-types-in-document-get-requests-is-deprecated/262024
**Category:** Elasticsearch
**Created:** [January 24, 2021, 7:36am UTC](https://discuss.elastic.co/t/bad-request-specifying-types-in-document-get-requests-is-deprecated/262024 "2021-01-24T07:36:56Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![shlomys](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shlomys/32/127274_2.png) [@shlomys](https://discuss.elastic.co/u/shlomys)
#### Post date: [January 24, 2021, 7:36am UTC](https://discuss.elastic.co/t/bad-request-specifying-types-in-document-get-requests-is-deprecated/262024/1 "2021-01-24T07:36:56Z")

</div>

Hi,

Since upgrading elastic stack docker containers to 7.10.2 I get the following error whenever trying to open a new transaction with the .net Elastic.Apm 1.7.1 :

```
StatusCode: 400, ReasonPhrase: 'Bad Request', Version: 1.1, Content: System.
Net.Http.StreamContent, Headers:
    {
      Warning: 299 Elasticsearch-7.10.2-747e1cc71def077253878a59143c1f785afa92b9
 "[types removal] Specifying types in document get requests is deprecated, use t
he /{index}/_doc/{id} endpoint instead."
      Content-Length: 287
      Content-Type: application/json; charset=UTF-8
    }
+-> Response body [length: 287]:
    {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"reque
st [/config/v1/agents] contains unrecognized parameter: [service.name]"}],"type"
:"illegal_argument_exception","reason":"request [/config/v1/agents] contains unr
ecognized parameter: [service.name]"},"status":400}

```

Same code used to work with an older version of the stack. is there a compatibility issue I was missing?

Thanks.

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [January 24, 2021, 10:19am UTC](https://discuss.elastic.co/t/bad-request-specifying-types-in-document-get-requests-is-deprecated/262024/2 "2021-01-24T10:19:24Z")

</div>

The path `/config/v1/agents` suggests this is trying to use the [Agent configuration API](https://www.elastic.co/guide/en/apm/server/current/agent-configuration-api.html), but the response indicates it's talking directly to Elasticsearch. You need to direct this call to the APM server instead.

---

<div class="post-metadata">

### Author: ![shlomys](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shlomys/32/127274_2.png) [@shlomys](https://discuss.elastic.co/u/shlomys)
#### Post date: [January 24, 2021, 12:39pm UTC](https://discuss.elastic.co/t/bad-request-specifying-types-in-document-get-requests-is-deprecated/262024/3 "2021-01-24T12:39:48Z")

</div>

David, you are absolutely correct. I had a stupid mistake on my side using the wrong docker-compose file which confused me. It is working now. Thank you very much.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [February 21, 2021, 12:39pm UTC](https://discuss.elastic.co/t/bad-request-specifying-types-in-document-get-requests-is-deprecated/262024/4 "2021-02-21T12:39:50Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
