Xero-NetStandard icon indicating copy to clipboard operation
Xero-NetStandard copied to clipboard

GetReportProfitAndLossAsync Return Null JSON

Open TechJarr opened this issue 1 year ago • 7 comments

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

TechJarr avatar Feb 02 '24 03:02 TechJarr

PETOSS-390

github-actions[bot] avatar Feb 02 '24 03:02 github-actions[bot]

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

github-actions[bot] avatar Feb 02 '24 03:02 github-actions[bot]

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?

thomas-anu avatar Feb 09 '24 07:02 thomas-anu

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!

TechJarr avatar Feb 16 '24 07:02 TechJarr

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?

thomas-anu avatar Feb 19 '24 10:02 thomas-anu

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!

TechJarr avatar Feb 22 '24 03:02 TechJarr

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()

ankushkhandare95 avatar Sep 03 '24 13:09 ankushkhandare95