I'm trying to retrieve recent orders from Magento 2.3.5, via REST API. I use this command:
curl -X GET "https://my_magento_site/index.php/rest/V1/orders/search?searchCriteria[filter_groups][0][filters][0][field]=created_at&searchCriteria[filter_groups][0][filters][0][value]=2021-01-01&searchCriteria[filter_groups][0][filters][0][condition_type]=gt" -H "Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -H "Content-type: application/json" -g -o C:\orders.json
What I get is this error in my orders.json:
{"message":"The \"search\" value's type is invalid. The \"int\" type was expected. Verify and try again."}
I'm pretty sure REST API is working fine and authentication is OK. If I simply replace "orders" with "customers" in the above command, I get all recently added customers. Also issuing:
curl -X GET "https://my_magento_site/index.php/rest/V1/orders/1" -H "Authorization: Bearer xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -H "Content-type: application/json" -g -o C:\orders.json
returns my order "1" details.
What may be the problem ?