Answer the question
In order to leave comments, you need to log in
API Yandex. How to overcome the error with passing the date in the request?
I'm trying to get data using the Yandex API (), but an error is returned - "{"code":"400","message":"Parse error at pos 109, path 'query.park.order.booked_at.from': Can't parse datetime: 2021-09-01, the latest token was :\"2021-09-01\""}"
Please tell me what am I doing wrong? I can't decide on my own.
import requests
import json
url = 'https://fleet-api.taxi.yandex.net/v1/parks/orders/list'
data = {
"limit": 1,
"query": {
"park": {
"id": Park_ID,
"order": {
"booked_at": {
"from": "2021-09-01",
"to": "T18:25+03:00",
},
},
},
},
}
headers= {
"X-Client-ID": Client_ID,
"X-API-Key": API_KEY,
"Accept-Language": "ru"
}
data =json.dumps(data)
r = requests.post(url,data=data, headers=headers )
print(r.text)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question