Skip to main content

Hello group!

I’m new to using APIs, and after tinkering with the timeline Post-API, I have a question about the date format. 

I have my data in a CSV file which I then converted into a JSON file. The date in the payload was sent in the following format "Activity Date": "2020-06-09T00:00:00.000". The activity date however was created as the date/time of the execution command, ie yesterday’s date.

Is there anything wrong with my date format?

 Thank you,

Jasmina

Try it without the space between “Activity” and “Date” @jivanova  -- the actual API name for the “Activity Date” standard field is “ActivityDate”.

Because we default the Activity Date field to match the Created Date if no “ActivityDate” is provided, the load ends up being successful -- it simply ignores the field name you’ve entered with the space (and any other unrecognized fields).

Are you loading this as a Bulk Save or a Single Save?  I’m surprised we don’t throw an error, or at least a message, that the JSON includes a fieldname that doesn’t match with anything . . . let me know which and I’ll pursue internally.


Thank you, Scott! I’m using the Bulk Save. 

After fixing the header name, I received this error: 

 "errorCode": "GS_TL_10_0301",

                    "message": "Invalid data type for key `ActivityDate`. Expected ISO 8601 Date Time String."

I added a Z at the end it worked as a charm. Now I need to figure how to convert dates to ISO in excel with the Z appended, because simply adding the format listed in the API as a custom cell format in excel didn’t work for me - yyyy-MM-dd'T'HH🇲🇲ss.SSSXXX.

I think the documentation for the timeline API may need to be enhanced a bit (at least non-experienced users as myself would benefit from it). For example, company gsid, author gsid are not mentioned in the parameters but they are a must for the lookups to work.

Maybe a line that each header should match the API name of the field it is inserting to?

Some of the parameters in the list in the document appear like API names, ex: ActivityTypeId, so I used the names there to create my headers, hence the space in the Activity Date.

 


@jivanova - Unfortunately, the Timeline API uses a very strange datetime format. See if this date format works for you (please adjust the “+8:00” if you need a specific timezone offset) …

...

"ActivityDate": "2022-06-15T00:00:00.000+08:00"

Please let me know if you require additional assistance.


Reply