API - encoding for StartDate


#1

Hi –

I’m trying to understand the encoding for StartDate in the return JSON from /public/schedrules/:id. Are the pointers to docs other than what’s on rachio.readme.io?

Thanks.


#2

@wfd3 All of our dates are milliseconds from epoch. Here is a handy converter with different programming language conversions.

:cheers:


#3

Right, thanks.

Another question for you: how does /public/scheduleid/:id encode the cycle start time and frequency? I see what looks like an enum in scheduleJobTypes but can’t find any documentation on the return values and I don’t see a start time in the JSON struct?

Thanks!


#4

Nevermind, I got it. I just misunderstood your data model… Thanks!


#5

But still: if you have docs on enums in scheduleJobType, I’d appreciate a pointer to it.


#6

This should help:

:cheers:

DAY_OF_WEEK_0(Type.DAY_OF_WEEK), // SUNDAY
DAY_OF_WEEK_1(Type.DAY_OF_WEEK), // MONDAY
DAY_OF_WEEK_2(Type.DAY_OF_WEEK), // TUESDAY
DAY_OF_WEEK_3(Type.DAY_OF_WEEK), // WEDNESDAY
DAY_OF_WEEK_4(Type.DAY_OF_WEEK), // THURSDAY
DAY_OF_WEEK_5(Type.DAY_OF_WEEK), // FRIDAY
DAY_OF_WEEK_6(Type.DAY_OF_WEEK), // SATURDAY
ODD(Type.ODD_OR_EVEN), // Run only on odd days
EVEN(Type.ODD_OR_EVEN), // Run only on even days
INTERVAL_1(Type.INTERVAL), // run frequency - every 1 days
INTERVAL_2(Type.INTERVAL), // run frequency - every 2 days
INTERVAL_3(Type.INTERVAL), // run frequency - every 3 days
INTERVAL_4(Type.INTERVAL), // run frequency - every 4 days
INTERVAL_5(Type.INTERVAL), // run frequency - every 5 days
INTERVAL_6(Type.INTERVAL), // run frequency - every 6 days
INTERVAL_7(Type.INTERVAL), // run frequency - every 7 days,
INTERVAL_8(Type.INTERVAL),
INTERVAL_9(Type.INTERVAL),
INTERVAL_10(Type.INTERVAL),
INTERVAL_11(Type.INTERVAL),
INTERVAL_12(Type.INTERVAL),
INTERVAL_13(Type.INTERVAL),
INTERVAL_14(Type.INTERVAL),
INTERVAL_15(Type.INTERVAL),
INTERVAL_16(Type.INTERVAL),
INTERVAL_17(Type.INTERVAL),
INTERVAL_18(Type.INTERVAL),
INTERVAL_19(Type.INTERVAL),
INTERVAL_20(Type.INTERVAL),
INTERVAL_21(Type.INTERVAL),
ANY(Type.ANY); // Any day of the week


#7

Awesome, thanks!