【发布时间】:2019-10-02 15:03:21
【问题描述】:
我正在开发 Snapchat 广告 API。 (为大查询编写连接器)。目前我以一天的粒度获得指标(性能统计数据)。我将以下作为查询参数传递给请求 URL。
帐户时区:美国/洛杉矶
我成功地使用了以下日期格式来检索数据。
2019-03-11T00:00:00.000-07:00 2019-03-12T00:00:00.000-07:00
payload = {
'granularity': 'DAY',
'start_time': start_datetime,
'end_time': end_datetime,
'fields': fields
}
但是,当我查询 2019-03-10 的日期时(我认为是夏令时调整导致了这种情况),它给了我以下错误
{'request_status': 'ERROR', 'request_id': 'xxxxxxxx', 'debug_message': "Unsupported Stats Query: Timeseries queries with DAY granularity must have a start time that is the start of day (00:00:00) for the account's timezone. This account's timezone is: America/Los_Angeles", 'display_message': "We're sorry, but the data provided in the request is incomplete or incorrect", 'error_code': 'E1008'}
我还尝试通过调整夏令时调整来进行查询。但不成功。
2019-03-11T00:00:00.000-08:00 2019-03-12T00:00:00.000-08:00
2019-03-11T00:00:00.000-06:00 2019-03-12T00:00:00.000-06:00
没有可用的文档:https://developers.snapchat.com/api/docs/
任何帮助将不胜感激。谢谢!
【问题讨论】:
标签: python python-3.x datetime snapchat