urbanairship / python-library

A Python library for using the Airship APIs for push notifications, reporting and other message types
https://docs.airship.com/api/libraries/python/
Other
82 stars 65 forks source link

Feedback API: Check that "since" is a date and not a datetime #19

Closed ofir-ov closed 9 years ago

ofir-ov commented 10 years ago

UrbanAirship's feedback API documentation clearly states that the "since" object should be of the form 2014-05-15.

When using the given example ( airship.feedback(datetime.datetime.utcnow() - datetime.timedelta(days=1)) ), the API returns a 400 bad request. The reason is that there's a time portion to the "since" parameter. E.g. 2014-05-15T15:23:45.238315 .

This fix ensures that even if a datetime object is received, the request to UA's server will only have the date portion of "since".

The fix was made inside the feedback function instead of to the documentation in order to maintain backwards compatibility.

robotadam commented 10 years ago

Time is definitely accepted, but it looks like there might be a regression in handling the miliseconds portion of the timestamp. I'll have the team take a look.

robotadam commented 10 years ago

@Ofir-Purple, a fix for this went out at the end of last week, and the timestamps are being properly parsed now. Can you give it another shot?

pdxmele commented 9 years ago

Closing old PRs. If it's indeed not fixed in the current version, please let us know!