2017-01-01 50 views
0

調用EventLog.getEnterpriseEvents 用的(現在 - 2小時)的時間內,直到(現在)返回錯誤400(BAD_REQUEST):BOX JAVA SDK:EventLog.getEnterpriseEvents返回錯誤

created_before is beyond one year in the past, API only supports time range starting from one year in the past from now 

我使用了Java SDK並正確認證(w /私鑰,智威湯遜),授予所有可能的權限。

請幫

回答

1

沒有與通過SDK提出的要求沒有問題,

問題是底層REST API中 - 它有一個錯誤,這錯誤的日期格式與+ UTC拋出一個錯誤(其中-UTC就好了)。
SDK使用DateFormat class to stringify the Date object,我位於UTC + 200的區域。

這非常奇怪,因爲這會影響一半嘗試使用這個REST API(和SDK)的星球用戶的影響,

作爲解決方法,我分叉SDK和使用規範化的UTC日期格式,所以我沒有得到+ UTC。

DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(date.toInstant().atZone(ZoneOffset.UTC)); 

另外,我提交了一個錯誤,以箱工程師。