GetReportProfitAndLossAsync Return Null JSON
When using the GetReportProfitAndLossAsync function to receive the JSON response, we received a status code of 200. However, upon deserializing the JSON to text, we discovered that there was no data present in the JSON. Additionally, we checked the History log in the Xero developer platform and found no record of this call.
Sample null json: [ { "Filtered": true, "TrackingCategoryId": "xxx", "ReportData": null }, { "Filtered": false, "TrackingCategoryId": null, "ReportData": null } ]
PETOSS-390
Thanks for raising an issue, a ticket has been created to track your request
Hi @TechJarr Can you please provide the details of the SDK version that you are using? We have tested the method with latest SDK and could not reproduce the issue. Can you give details on any additional parameters if you have used?
Hi @thomas-anu
Our SDK version is as follows: "XeroDataExtraction/1.0.0": { "dependencies": { "Xero.NetStandard.OAuth2": "3.34.5", "Xero.NetStandard.OAuth2Client": "1.6.0" },
From our code base, below are the parameters used for getting P&L data: apiInstance.GetReportProfitAndLossAsync(accessToken, task.TenantId, t.FromDate, t.ToDate, t.Periods, t.Timeframe, t.TrackingCategoryID1, t.TrackingCategoryID2, t.TrackingOptionID1, t.TrackingOptionID2);
Many thanks!
Hi @TechJarr , can you please check the Xero dashboard with the same filters and the API explorer to check what data is being returned? We are still not able to reproduce the issue. Please find the screenshots attached.
To check on Xero dashboard, navigate to Accounting --> Profit and Loss To check using API explorer, https://api-explorer.xero.com/
Also the sample Json data that you have mentioned is different from the Json response from the SDK and API.
Can you please give more information on it?
Thanks @thomas-anu
After testing the API explorer, it returned a normal JSON response. However, when switching to send a request using the SDK, it produced a null JSON response. The sample JSON data is different from the normal response, indicating that this is one of its behaviors. I checked with the Xero Developer Platform, and although the server did not record the JSON call, it did produce a response similar to the one shown in the image you provided.
Let me know if there's anything else I can help you with!
Hi @TechJarr,
Apologies for the inconvenience caused.
We tried reproducing the same issue, called GetReportProfitAndLossAsync() with "Xero.NetStandard.OAuth2": "3.34.5" as specified by you, however we were getting valid report data with success response. Can you please verify the parameters/filters you are using on API explorer and developer dashboard match with your GetReportProfitAndLossAsync() method arguments. If you face the same issue post verifying it, give us some more idea about the filters you are using to call GetReportProfitAndLossAsync()