# How to retrieve index template version number using High Level REST API

**URL:** https://discuss.elastic.co/t/how-to-retrieve-index-template-version-number-using-high-level-rest-api/226473
**Category:** Elasticsearch
**Created:** [April 3, 2020, 8:04pm UTC](https://discuss.elastic.co/t/how-to-retrieve-index-template-version-number-using-high-level-rest-api/226473 "2020-04-03T20:04:28Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Cat](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@Cat](https://discuss.elastic.co/u/Cat)
#### Post date: [April 3, 2020, 8:04pm UTC](https://discuss.elastic.co/t/how-to-retrieve-index-template-version-number-using-high-level-rest-api/226473/1 "2020-04-03T20:04:29Z")

</div>

I am new to elasticsearch. I am looking for example how to retrieve index template version using HLRest API. I saw some posts indicating that this is not possible?

---

<div class="post-metadata">

### Author: ![tylerjl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylerjl/32/44965_2.png) [@tylerjl](https://discuss.elastic.co/u/tylerjl)
#### Post date: [April 20, 2020, 5:29pm UTC](https://discuss.elastic.co/t/how-to-retrieve-index-template-version-number-using-high-level-rest-api/226473/2 "2020-04-20T17:29:19Z")

</div>

Hey @Cat, does [this documentation about index template versioning answer your question](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html#versioning-templates)?

---

<div class="post-metadata">

### Author: ![Cat](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@Cat](https://discuss.elastic.co/u/Cat)
#### Post date: [April 22, 2020, 8:50pm UTC](https://discuss.elastic.co/t/how-to-retrieve-index-template-version-number-using-high-level-rest-api/226473/3 "2020-04-22T20:50:21Z")

</div>

Is there a solution where I can use it in conjunction with REST High Level call?

---

<div class="post-metadata">

### Author: ![tylerjl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylerjl/32/44965_2.png) [@tylerjl](https://discuss.elastic.co/u/tylerjl)
#### Post date: [April 23, 2020, 5:44pm UTC](https://discuss.elastic.co/t/how-to-retrieve-index-template-version-number-using-high-level-rest-api/226473/4 "2020-04-23T17:44:29Z")

</div>

@Cat if you're referring to the Java high-level REST client, I believe the "Get Template" call will return a structure that should include the version field for the template you ask for:

[https://www.elastic.co/guide/en/elasticsearch/client/java-rest/master/java-rest-high-get-templates.html](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/master/java-rest-high-get-templates.html)

---

<div class="post-metadata">

### Author: ![Cat](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@Cat](https://discuss.elastic.co/u/Cat)
#### Post date: [May 13, 2020, 5:33pm UTC](https://discuss.elastic.co/t/how-to-retrieve-index-template-version-number-using-high-level-rest-api/226473/5 "2020-05-13T17:33:47Z")

</div>

I've tried both GetIndexRequest(...) and GetIndexTemplatesRequest(...). Both resulted in

```auto
2020-05-13 17:14:22.962 WARN 7 --- [nio-9991-exec-3] o.e.c.RestClient : request [GET http://<myES>/_template/documents_metadata_template?master_timeout=30s] returned 1 warnings: [299 Elasticsearch-6.8.7-c63e621 "[types removal] The parameter include_type_name should be explicitly specified in get template requests to prepare for 7.0. In 7.0 include_type_name will default to 'false', which means responses will omit the type name in mapping definitions."]

```

What do I need to set and where? Do you have an example of how to retrieve the version?

Thank you very much for your help,  
Catherine

---

<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: [June 10, 2020, 5:33pm UTC](https://discuss.elastic.co/t/how-to-retrieve-index-template-version-number-using-high-level-rest-api/226473/6 "2020-06-10T17:33:48Z")

</div>

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