0

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...)

1 Answers1

0

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:

datetime.isoformat(sep='T', timespec='auto')
Return a string representing the date and time in ISO 8601 format:
YYYY-MM-DDTHH:MM:SS.ffffff, if microsecond is not 0

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.

David Reed
  • 2,522
  • 2
  • 16
  • 16
  • Thanks a lot for your answer, David. Makes a lot of sense. Interesting information regarding the Bulk API - do you know which format works here and what is the experience you have made with using streaming vs bulk API for CDP ingestions? There is little documentation/support so I am curious if you can speak from experience or have a reliable source you would be able to share. Thank you in advance! – Lisa.xcv Jun 08 '22 at 11:53
  • I am familiar with other Salesforce APIs (including the Bulk API), but not with CDP specifically. I'm sorry that I don't have more specific information to offer you. – David Reed Jun 08 '22 at 16:39