Closed thusithagh closed 1 year ago
Hi Thusitha,
You can use the GetAccountsAsyncWithHttpInfo()
method to retrieve this additional response data.
This method will return an ApiResponse<T>
wrapping the standard model you get using GetAccountsAsync()
. You will find the date time under Content
, note, you will have to manually parse this information, i.e. something like:
var response = await _accountingApi.GetAccountsAsyncWithHttpInfo(xeroAccessToken, xeroTenantId);
var datetime = (DateTime)JObject.Parse(response.Content.ToString()).GetValue("DateTimeUTC");
Let me know if this solves your issue or if you have any other questions :)
Thanks for that @JRising-Xero I'll try out and let you know.
@JRising-Xero That works. Thanks! However, it'd be a great help if the object classes itself had a property with this info populated.
Xero.NetStandard.OAuth2 3.29.1 Xero.NetStandard.OAuth2Client 1.6.0
No property to hold the
DateTimeUTC
which seems to be the request processed by the API server, in any of the response object classes in Xero.NetStandard.OAuth2.To Reproduce Steps to reproduce the behavior:
Go to API explorer
Make any API request against the Demo org (eg: Accounting/GetAccounts)
Notice the "DateTimeUTC" in the response
Use Xero.NetStandard.OAuth2 to make the same request.
Notice that there isn't any property to hold the "DateTimeUTC" within the object class
Expected behavior There should be a proper
DateTime
property to hold theDateTimeUTC
returned.This timestamp is needed, so we don't have a mismatch between the time actually the request got processed by the API server, and the time we started requesting. Please see if we can add that property to all the response object classes.
Best regards, Thusitha H