XeroAPI / Xero-NetStandard

A wrapper of the Xero API in the .NetStandard 2.0 framework. Supports Accounting, Payroll AU/US, and Files
MIT License
118 stars 119 forks source link

GetReportProfitAndLossAsync Return Null JSON #502

Open TechJarr opened 5 months ago

TechJarr commented 5 months ago

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 } ]

github-actions[bot] commented 5 months ago

PETOSS-390

github-actions[bot] commented 5 months ago

Thanks for raising an issue, a ticket has been created to track your request

thomas-anu commented 4 months ago

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?

TechJarr commented 4 months ago

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!

thomas-anu commented 4 months ago

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/

Screenshot 2024-02-19 at 15 14 17

Can you please share with screenshots or further information on the same? (Mask the data if there are any sensitive information in it.)

Also the sample Json data that you have mentioned is different from the Json response from the SDK and API.

Screenshot 2024-02-19 at 15 14 48

Can you please give more information on it?

TechJarr commented 4 months ago

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.

image

Let me know if there's anything else I can help you with!