We requested information on our active entities from September 10 to September 12 using the following code. Our understanding was that this should have meant we got information for September 10 and September 11. However the “array of ints” that we got had 3 numbers. Could you explain what those 3 numbers are? Could this have to do with different entities (different campaigns) starting on different days?
This is the code we used, most of which comes from the examples github:
def date_range(data): """Returns the minimum activity start time and the maximum activity end time from the active entities response. These dates are modified in the following way. The hours (and minutes and so on) are removed from the start and end times and a *day* is added to the end time. These are the dates that should be used in the subsequent analytics request. """ start = min([parse(d['activity_start_time']) for d in data]) end = max([parse(d['activity_end_time']) for d in data]) start = remove_hours(start) end = remove_hours(end) + datetime.timedelta(days=1) return start, end today = datetime.datetime.now().date() yesterday = today - datetime.timedelta(days=1) active_entities = LineItem.active_entities(account, yesterday, today) active_ids = [d['entity_id'] for d in active_entities] start, end = date_range(active_entities)