# "reason" : "Unrecognized token 'John': was expecting ('true', 'false' or 'null')

**URL:** <https://discuss.elastic.co/t/reason-unrecognized-token-john-was-expecting-true-false-or-null/29700>\
**Category:** Elasticsearch\
**Created:** [September 21, 2015, 1:07pm UTC](https://discuss.elastic.co/t/reason-unrecognized-token-john-was-expecting-true-false-or-null/29700 "2015-09-21T13:07:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gowtham\_Sen\_Potnuru](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@Gowtham\_Sen\_Potnuru](https://discuss.elastic.co/u/Gowtham_Sen_Potnuru)\
**Post date:** [September 21, 2015, 1:07pm UTC](https://discuss.elastic.co/t/reason-unrecognized-token-john-was-expecting-true-false-or-null/29700/1 "2015-09-21T13:07:20Z")

</div>

Hi,

This is the first time I am trying to use Elastic Search. I am unable to feed data to it.

here is the command (Having issues with this command):

> curl -XPUT localhost:9200/customer/external/1?pretty -d {"name":"John"}

But if I give the same command as below,its working:

> curl -XPUT localhost:9200/customer/external/1?pretty -d {"name":true}

Any suggestions will be very helpful.

Thanks  
Gowtham

---

<div class="post-metadata">

**Author:** ![Gowtham\_Sen\_Potnuru](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@Gowtham\_Sen\_Potnuru](https://discuss.elastic.co/u/Gowtham_Sen_Potnuru)\
**Post date:** [September 21, 2015, 1:24pm UTC](https://discuss.elastic.co/t/reason-unrecognized-token-john-was-expecting-true-false-or-null/29700/2 "2015-09-21T13:24:57Z")

</div>

I would like to update that I am using windows.  
PS:Its working if I keep the document in a file and use it.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 21, 2015, 1:32pm UTC](https://discuss.elastic.co/t/reason-unrecognized-token-john-was-expecting-true-false-or-null/29700/3 "2015-09-21T13:32:03Z")

</div>

It's because you have indexed a first document with name as a boolean.  
Remove your index and it will work.

---

<div class="post-metadata">

**Author:** ![Gowtham\_Sen\_Potnuru](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@Gowtham\_Sen\_Potnuru](https://discuss.elastic.co/u/Gowtham_Sen_Potnuru)\
**Post date:** [September 21, 2015, 1:47pm UTC](https://discuss.elastic.co/t/reason-unrecognized-token-john-was-expecting-true-false-or-null/29700/4 "2015-09-21T13:47:36Z")

</div>

Can you please explain about how can I do that? I just created an index using XPUT as per the document given in Elastic Search.

Please suggest.

Thanks  
Gowtham

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 21, 2015, 2:05pm UTC](https://discuss.elastic.co/t/reason-unrecognized-token-john-was-expecting-true-false-or-null/29700/5 "2015-09-21T14:05:46Z")

</div>

See [https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-delete-index.html)

---

<div class="post-metadata">

**Author:** ![rudo](https://avatars.discourse-cdn.com/v4/letter/r/bb73d2/32.png) [@rudo](https://discuss.elastic.co/u/rudo)\
**Post date:** [July 5, 2016, 2:01pm UTC](https://discuss.elastic.co/t/reason-unrecognized-token-john-was-expecting-true-false-or-null/29700/6 "2016-07-05T14:01:14Z")

</div>

i had the same problem and found another the solution:

> <https://stackoverflow.com/questions/4257490/how-to-post-put-request-under-the-windows-using-curl>

`In windows, if a double-quoted argument itself contains a double quote character, the double quote must be doubled.`

With this information i've modified the command and it works now:  
curl -XPUT 'localhost:9200/customer/external/1?pretty' -d '{""name"": ""John Doe""}'

---

<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:** [July 5, 2017, 10:37pm UTC](https://discuss.elastic.co/t/reason-unrecognized-token-john-was-expecting-true-false-or-null/29700/7 "2017-07-05T22:37:58Z")

</div>


