# Using curl with bulk API: ActionRequestValidationException Validation Failed: 1: no requests added

**URL:** <https://discuss.elastic.co/t/using-curl-with-bulk-api-actionrequestvalidationexception-validation-failed-1-no-requests-added/15832>\
**Category:** Elasticsearch\
**Created:** [February 16, 2014, 8:22pm UTC](https://discuss.elastic.co/t/using-curl-with-bulk-api-actionrequestvalidationexception-validation-failed-1-no-requests-added/15832 "2014-02-16T20:22:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pulkitsinghal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pulkitsinghal/32/802_2.png) [@pulkitsinghal](https://discuss.elastic.co/u/pulkitsinghal)\
**Post date:** [February 16, 2014, 8:22pm UTC](https://discuss.elastic.co/t/using-curl-with-bulk-api-actionrequestvalidationexception-validation-failed-1-no-requests-added/15832/1 "2014-02-16T20:22:43Z")

</div>

Whenever I try to perform a bulk import from CURL, I get an error  
stating: ActionRequestValidationException[Validation Failed: 1: no requests  
added

Can someone point out my mistake in this command?

$ curl -u username:password -XPOST [http://my.es.com:9200/\_bulk](http://my.es.com:9200/_bulk) -d'  
{"index":{"\_index":"my\_index\_test","\_type":"product","\_id":"033fe3db-038f-11e3-a415-bc764e10976c"}}  
{"api\_id":"033fe3db-038f-11e3-a415-bc764e10976c","name":"tray","short\_description":"

serve  
fresh things with a fresh look
","long\_description":"
serve fresh  
things with a fresh  
look
","price":19.5,"image\_url":"[https://s3.amazonaws.com/blah.jpg","barcodes":["CODE\_128:tray","CODE\_39:tray","MANUAL:tray","MANUAL:TRAY](https://s3.amazonaws.com/blah.jpg%22,%22barcodes%22:%5B%22CODE_128:tray%22,%22CODE_39:tray%22,%22MANUAL:tray%22,%22MANUAL:TRAY)"]}  
'

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8c46092e-814f-4f92-ac8f-2a1772721cc8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8c46092e-814f-4f92-ac8f-2a1772721cc8%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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:** [February 16, 2014, 8:28pm UTC](https://discuss.elastic.co/t/using-curl-with-bulk-api-actionrequestvalidationexception-validation-failed-1-no-requests-added/15832/2 "2014-02-16T20:28:24Z")

</div>

Check that you have \n after each line (last line needs it as well).

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 16 février 2014 à 21:22:48, pulkitsinghal ([pulkitsinghal@gmail.com](mailto:pulkitsinghal@gmail.com)) a écrit:

Whenever I try to perform a bulk import from CURL, I get an error stating: ActionRequestValidationException[Validation Failed: 1: no requests added

Can someone point out my mistake in this command?

## $ curl -u username:password -XPOST [http://my.es.com:9200/\_bulk](http://my.es.com:9200/_bulk) -d' {"index":{"\_index":"my\_index\_test","\_type":"product","\_id":"033fe3db-038f-11e3-a415-bc764e10976c"}} {"api\_id":"033fe3db-038f-11e3-a415-bc764e10976c","name":"tray","short\_description":" serve fresh things with a fresh look ","long\_description":" serve fresh things with a fresh look ","price":19.5,"image\_url":"[https://s3.amazonaws.com/blah.jpg","barcodes":["CODE\_128:tray","CODE\_39:tray","MANUAL:tray","MANUAL:TRAY](https://s3.amazonaws.com/blah.jpg%22,%22barcodes%22:%5B%22CODE_128:tray%22,%22CODE_39:tray%22,%22MANUAL:tray%22,%22MANUAL:TRAY)"]} '

You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/8c46092e-814f-4f92-ac8f-2a1772721cc8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8c46092e-814f-4f92-ac8f-2a1772721cc8%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.53011f68.333ab105.f2%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.53011f68.333ab105.f2%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![pulkitsinghal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pulkitsinghal/32/802_2.png) [@pulkitsinghal](https://discuss.elastic.co/u/pulkitsinghal)\
**Post date:** [February 16, 2014, 8:31pm UTC](https://discuss.elastic.co/t/using-curl-with-bulk-api-actionrequestvalidationexception-validation-failed-1-no-requests-added/15832/3 "2014-02-16T20:31:37Z")

</div>

Thanks, that was it!

On Sunday, February 16, 2014 2:28:24 PM UTC-6, David Pilato wrote:

> Check that you have \n after each line (last line needs it as well).
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr[https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 16 février 2014 à 21:22:48, pulkitsinghal ([pulkit...@gmail.com](mailto:pulkit...@gmail.com)\<javascript:\>)  
> a écrit:
> 
> Whenever I try to perform a bulk import from CURL, I get an error  
> stating: ActionRequestValidationException[Validation Failed: 1: no requests  
> added
> 
> Can someone point out my mistake in this command?
> 
> ## $ curl -u username:password -XPOST [http://my.es.com:9200/\_bulk](http://my.es.com:9200/_bulk) -d[http://my.es.com:9200/\_bulk-d](http://my.es.com:9200/_bulk-d) ' {"index":{"\_index":"my\_index\_test","\_type":"product","\_id":"033fe3db-038f-11e3-a415-bc764e10976c"}} {"api\_id":"033fe3db-038f-11e3-a415-bc764e10976c","name":"tray","short\_description":" serve fresh things with a fresh look ","long\_description":" serve fresh things with a fresh look ","price":19.5,"image\_url":" [https://s3.amazonaws.com/blah.jpg](https://s3.amazonaws.com/blah.jpg) ","barcodes":["CODE\_128:tray","CODE\_39:tray","MANUAL:tray","MANUAL:TRAY"]} '
> 
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/8c46092e-814f-4f92-ac8f-2a1772721cc8%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8c46092e-814f-4f92-ac8f-2a1772721cc8%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bb022da2-f5bd-4f60-8af1-1423a774bf25%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bb022da2-f5bd-4f60-8af1-1423a774bf25%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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 6, 2017, 1:49am UTC](https://discuss.elastic.co/t/using-curl-with-bulk-api-actionrequestvalidationexception-validation-failed-1-no-requests-added/15832/4 "2017-07-06T01:49:48Z")

</div>


