/rest/v1/customobjects/{name}.json is populating empty datetime field with default value

Yann_Lair
Level 2

/rest/v1/customobjects/{name}.json is populating empty datetime field with default value

Hi,

We are encountering a very weird behaviour with the custom object creation. It appears that when we push a new custom object with an empty datetime field (CheckoutDate), it actually gets populated with a fixed date (26/08/2019) and we have no idea why.

More details:

  • We are using the following POST endpoint  from a C# client

POST /rest/v1/customobjects/{customObjectName}.json

  • The custom object input has a data contract name "bc_logodraft_c" and looks like that in json:

{

"userEmail": "yann.lair+1@designcrowd.com",

"dateSaved": "2019-09-10T08:22:15.060624Z",

"saveCount": 1,

"checkoutDate": null,

"backgroundColor": null,

"logoColor": null,

etc.}

  • The CheckoutDate that you see in the above json gets set to the following in the Marketo customObject. How is it possible?

CheckoutDate: 26/08/2019

  • Odd things:
    • This is always the SAME date that gets saved
    • The other null fields are not filled (logoColor is still null in the custom object)
    • we only use DateTime objects, as you can see with dateSaved and this default date doesn't have the time part
    • There is no way to set a default value for a custom object field in Marketo but it behaves like it

We now to the point where we have to ask for your help cause we've exhausted all our ideas on the why for this one.

How is it possible that this custom object get created with a default date when set to null?

Thank you very much in advance for your help.

Yann Lair.

Tags (1)
6 REPLIES 6
SanfordWhiteman
Level 10 - Community Moderator

Re: /rest/v1/customobjects/{name}.json is populating empty datetime field with default value

Are you using a mock endpoint, or a network trace, to see the actual JSON put on the wire?

Yann_Lair
Level 2

Re: /rest/v1/customobjects/{name}.json is populating empty datetime field with default value

Hi,

This is happening in a lambda function from AWS, so what you see is the object in the serialization of the object that gets sent through the in the marketo API client as we log it and retrieve through cloudwatch. Unless there is tools on Marketo sides that would allows us to look at what's coming in, we have no mean of having a network trace for that.

This c# client is automatically generated from the Marketo REST endpoint using a tool called Refit.

SanfordWhiteman
Level 10 - Community Moderator

Re: /rest/v1/customobjects/{name}.json is populating empty datetime field with default value

Is this the API Gateway log, or the Lambda log after transformations?

Yann_Lair
Level 2

Re: /rest/v1/customobjects/{name}.json is populating empty datetime field with default value

That is the custom log that we have on our code to display each object that gets sent to CustomObject. This log stores it in the cloudwatch log for that particular lambda.

SanfordWhiteman
Level 10 - Community Moderator

Re: /rest/v1/customobjects/{name}.json is populating empty datetime field with default value

Well, I can't repro what you're describing. I were you I'd make triple-sure by sending to a mock endpoint (in place of the Marketo API) and inspecting the payload.

Yann_Lair
Level 2

Re: /rest/v1/customobjects/{name}.json is populating empty datetime field with default value

Thank you, we will try to push our investigation further, somehow.