Re: How to get createdAt time zone form webhook?

Mykhailo_Starod
Level 1

How to get createdAt time zone form webhook?

Hi,

My goal is to get the absolute time of lead creation from webhook. I added the next token to webhook template: {{lead.Created At}}. But in the result, I have a string like this: "2019-10-29 16:27:41". This date does not provide time zone information and looks like it uses the account time zone. Questions are:

  • Is it possible to specify the date format in webhook template?
  • Is it possible to get an account time zone from webhook?

P.S. Format "yyyy-MM-dd hh:mm:ss" is not the best practice for the program interface.

Tags (2)
3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: How to get createdAt time zone form webhook?

This date does not provide time zone information and looks like it uses the account time zone.

Yes.

Is it possible to specify the date format in webhook template?

No.

Is it possible to get an account time zone from webhook?

No, unless you manually pass it as a field.

P.S. Format "yyyy-MM-dd hh:mm:ss" is not the best practice for the program interface.

It's valid ISO 8601 local. I don't know what you mean by "best practice" unless you're referring to the absence of an explicit timezone for transport outside the system.

Mykhailo_Starod
Level 1

Re: How to get createdAt time zone form webhook?

No, unless you manually pass it as a field.

Duplicate system time zone in the webhook template is not a good solution. Does it possible to request a new system token: {{system.timezone}}?

An alternative solution is to provide a possibility to set date format in the token: {{createdAt:format=yyyy-MM-dd'T'hh:mm:ssZ}}

It's valid ISO 8601 local. I don't know what you mean by "best practice" unless you're referring to the absence of an explicit timezone for transport outside the system.

Yes. Local date is fine for user interface but not for the system to system communication

SanfordWhiteman
Level 10 - Community Moderator

Re: How to get createdAt time zone form webhook?

Well, it's what you've got.

In years of building webhook-compatible services for Marketo, this particular behavior has never stopped a project from being implemented, as every admin knows their tz and it's rarely, if ever, changed.

It could be better, yes. You can open some Ideas (which may already exist).