I am currently working on a Ingestion API Schema File for Salesforce CDP. Using postman, I was trying to format the data type fields in my payloads using various specifications:
- yyyy-mm-dd'T'hh:mm:ss'Z
- yyyy-mm-ddThh:mm:ss.SSSZ
- yyyy-mm-ddThh:mm:ssZ
and so forth. According to Salesforce's documentation, the payload data type field should be in ISO 8601 UTC Zulu with format yyyy-MM-dd'T'HH:mm:ss.SSS'Z (which does not work as the field value returns empty when ingested, although the call response is 'true'), however, talking to Salesforce support, they have suggested I try the following format:
2019-11-06T06:24:42.558008Z
With this, I finally managed to insert a record with correctly populated date fields into the CDP data object. However, I have never seen this format before and I am not sure how to work with this - I couldn't find any documentation on it that I can use to better understand it. Salesforce support was also not able to provide more explanation than "this is the format that works".
Any help or resource would be greatly appreciated.
(Also, did anyone else ever have this type of issue with Salesforce CDP? The platform is quite new with many bugs and the fact that it only accepts the above format seems a little strange to me...)
It's an RFC 3339 date, a "profile" of ISO 8601.
The RFC does not specify the number of decimal places for the fractional seconds. However, there is precedent in, for example, the Python standard library for using six-digit microseconds:
Different Salesforce APIs have different datetime-formatting requirements and can be quite strict about them. (And not all conform to the RFC). For example, the Bulk API does not work correctly with six-digit microseconds. There's little you can do besides conforming your data to the specific expectations of the API you're using.