Webhook Date Format

Hi,

What are the odds of the format of the date fields being standardized in the near future?
At the moment they seem to come through as 'seconds after the unix epoch, adjusted for the timezone selected under Manage > System'. This means that the system receiving the webhook needs to be aware of the timezone settings of the account, however this information isn't included in the data. Ideally this could be changed to use an ISO 8601 compliant format, or at least updated to return a UTC time.

Along a similar line, is there a reason the 'staff_id' field returns an empty object when the booking isn't made by a staff account rather than 'null' (or an invalid staff id like -1 for example)?

Thanks,

Matt

Comments

  • Hi Matt,

    Thanks for reaching out on the forums!

    I've passed along your feedback to our product team to review as part of their ongoing efforts to improve the API and Webhooks. 

    Please let us know if you notice any other quirks, we're all ears.

    Cheers,
    Mitch
    Checkfront support team
  • Thanks Mitch, will do.
  • JasonJason CEO Checkfront
    The epoch or unix timestamps are always UTC.  You can convert them generally quite easy with any language without worrying about what the timezone was where it was created.  

    With that said it would be a good idea to include the local timezone in the locale portion of the API call.
  • edited August 2016
    Hi Jason,

    That may be the case with the API however the webhook data certainly sends the dates adjusted for the timezone selected under Manage > System > Locale

    The following two lines are extracts from the webhook handler i set up to test, both are for the same booking (TKMD-300816) and the time stamps are the start and end dates. The first was with the locale settings set to UTC and the second was for eurpoe/london.
    2016-08-31 09:09:15,598 [12] INFO Webhooks.Handlers.GenericJsonWebHookHandler - ilukadev.checkfront.co.uk - WAIT - 1474531200 to 1474549200
    2016-08-31 09:12:23,375 [47] INFO Webhooks.Handlers.GenericJsonWebHookHandler - ilukadev.checkfront.co.uk - PEND - 1474527600 to 1474545600
    As you can see, the times are different with an offset of 3600 seconds, which would be explained by the UK currently being in british summer time.

    Matt

  • edited September 2016
    Hi Jason,

    Further investigation using the devloper console would indicate that the API responses are also affected by the timezone settings:
    booking/5
    Universal:     "start_date": 1474531200, "end_date": 1474549200
    Europe\London: "start_date": 1474527600, "end_date": 1474545600

    Matt
  • Any news on this?
  • Hi Matt,

    Thanks for your replies! In cases where you need to know the timezone settings of the account you can query the "company" endpoint, which includes a 'timezone' string like 'America/Vancouver.'

    Cheers,
    Mitch
    Checkfront support team
Sign In or Register to comment.