# Sortproblem using the cURL API

**URL:** <https://discuss.elastic.co/t/sortproblem-using-the-curl-api/127781>\
**Category:** Elasticsearch\
**Created:** [April 12, 2018, 9:28am UTC](https://discuss.elastic.co/t/sortproblem-using-the-curl-api/127781 "2018-04-12T09:28:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![virapp](https://avatars.discourse-cdn.com/v4/letter/v/b5e925/32.png) [@virapp](https://discuss.elastic.co/u/virapp)\
**Post date:** [April 12, 2018, 9:28am UTC](https://discuss.elastic.co/t/sortproblem-using-the-curl-api/127781/1 "2018-04-12T09:28:57Z")

</div>

Hi!  
I'm trying to use the cURL API together with the request library i python and having problems with the parameters for sorting my response isn't affecting the result I'm receving.

The same parameters works fine running the in the dev console in Kibana, but generates a completly different response in my python lambda.

I use elastic search 5.1.

What I'm trying to do is to fetch the last entry and check it's timestamp and compare it to the current time in order to see that data is sent to our cluster.

See code here:  
paramters = {  
"size": 1,  
"sort":  
{"@timestamp" : "desc"}  
}  
response = requests.get(url='https://{name}.{region}.es.amazonaws.com/dss-services-\*/\_search' ,  
params=paramters, auth=auth)

Do you see any obvious errors in my parameters?

Best Regards /Viktor

---

<div class="post-metadata">

**Author:** ![cbuescher](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cbuescher/32/60402_2.png) [@cbuescher](https://discuss.elastic.co/u/cbuescher)\
**Post date:** [April 20, 2018, 3:33pm UTC](https://discuss.elastic.co/t/sortproblem-using-the-curl-api/127781/2 "2018-04-20T15:33:23Z")

</div>

I don't know much about python but guessing here that if you provide the parameters like this, they end up as url parameters. If looks like you would want to specify a request body instead.

---

<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:** [May 18, 2018, 3:33pm UTC](https://discuss.elastic.co/t/sortproblem-using-the-curl-api/127781/3 "2018-05-18T15:33:25Z")

</div>

Closed on May 18, 2018, 3:33pm UTC

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