1

Could you help, I don't know how to filter by date on fuel-sdk.

I just want to retrive data after "2015-11-10". I look on Fuel-SDK unit test and not found anything relate to filter by date. I try below code but it does not work.

val filter = ETFilter.parse(s"unsubscribedDate >= 2015-11-10}")
val response = client.retrieve(classOf[ETSubscriber], filter)

*code in Scala

val filter = ETFilter.parse(s"unsubscribedDate >= 2015-11-10") // remove "}"
val response = client.retrieve(classOf[ETSubscriber], filter)

I found on other post that ET accect below date format.

Acceptable Date Formats:

Date: "YYYY-MM-DD" Date and Time: "YYYY-MM-DDThh:mm:ssZ" Date and Time also accepts offset times like YYYY-MM-DDThh:mm:ss+hh:mm and YYYY-MM-DDThh:mm:ss-hh:mm

After fixed my code, I've found Socket Timeout Exception instead.

Caused by: java.net.SocketTimeoutException: Read timed out

After config timeout to "no timeout". I got

com.exacttarget.fuelsdk.ETResponse[
batchResult = com.exacttarget.fuelsdk.ETResult[
    requestId = 49cda6d3-ba76-4b6f-82fb-4529142441cd
    responseCode = Error: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
    responseMessage = Error: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.
]
individualResults = []
moreResults = false
]
3
  • Are you sure you are on the right stack exchange board? How does this question related to Salesforce? It would be great if you can expand that in the post. – RajeshShah Nov 18 '15 at 8:05
  • Yes, I'm really sure, Fuel-SDK is SDK of ExactTarget, – Peerapat A Nov 18 '15 at 8:09
  • I found my false, It should be '2015-11-10' not '2015-11-10}' but when I input correct filter, I found "Caused by: java.net.SocketTimeoutException: Read timed out" – Peerapat A Nov 18 '15 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.