BingAds / BingAds-PHP-SDK

Other
56 stars 45 forks source link

Inconsistent date type on `OfflineConversion->ConversionTime` #167

Open neildaniels opened 2 years ago

neildaniels commented 2 years ago

The comment on OfflineConversion->ConversionTime indicates that the type should be a DateTime object.

https://github.com/BingAds/BingAds-PHP-SDK/blob/68ca0f367be9e2a7f23236453717248730ec03be/src/V13/CampaignManagement/OfflineConversion.php#L26-L30

But the sample code implies that it should/can merely be a timestamp like 1657665961.

https://github.com/BingAds/BingAds-PHP-SDK/blob/24d028e03faa72efb146479fa7c5a957ba0824a2/samples/V13/OfflineConversions.php#L119-L121

Is there a definitive type this should be?

eugeene commented 1 year ago

Hi there. For those whom might get into similar situation:

I was getting cryptic WSDL errors (The string '' is not a valid AllXsd value) due to this 'inconsistency'. The \DateTime typehint is wrong. Use string representation of your date(time).

I used $offlineConversion->ConversionTime = $dateTimeObject->format('c');

This seems to be working. The whole SDK library/documentation/examples is not the greatest in the world. The online customer service is slow and not helpful at all.