API - Retrieve Trial Balance

Lubos, I am trying to use api to pull back a TB (General Ledger Balances) via the api to integrate with my Business Forecasting package 4CastPro
.json does not work on Summary and I cannot see how to use api to actually run a tb report? It just lists the Trial Balance reports?

Kind Regards
Richard

Reports are not stored in the form you see displayed. What are saved are the definitions of reports—column titles, date ranges, and so forth. The report data itself is synthesized fresh from the underlying transactions every time you view the report. So it sounds like you are trying to recover something that does not exist.

It seems that adding .JSON at the end of the URL doesn’t work for this kind of report. Maybe @lubos can add this undocumented option also to this report.

In the latest version, JSON format should be supported now on all reports. It was added at the same time when ability to Clone any report was added.

1 Like

Yes. It works with trial balance but still not with custom reports.

@Davide, if you haven‘t already solved getting the data from custom reports, it is possible to get this data by using the old API and the approach @Ealfardan came up with, see API using excel. Trick is to have checked „Show custom field as column“ so that custom fields appear also in the JSON data in Excel. But of course this entails all the records for each module as it can not be confined to a timeperiod.

out of curiosity, you mentioned it works with trial balance, can I ask how you extract the JSON data for the trial balance at some specific date ?

@Tor, the following CURL request will extract the report in JSON format and save it to trial-balance-rpt.json.

curl -v -4 -G "https://apiUser:apiPassword@dev.mioapi.local/trial-balance-view.json?Key=4c1903a8-4eeb-433e-a3f1-71e5a83ca91e&FileID=Tm9ydGh3aW5kLWRhdGE" -o "trial-balance-rpt.json"

So the important bits are, you will need to retrieve the Key for the report via the /api/ entrance first. Then call the Front End view for the normal trial balance report but just add “.json” to the url destination. e.g. /trial-balance-view.json?Key= instead of /trial-balance-view?Key=

Above was tested on ManagerServer v 20.10.89 running behind nginx which I use instead of caddy.

Note: These queries no longer work directly to the localhost:port install and only work with a reverse proxy setup in front of it. This has been the case since 20.10.1. Version 20.10.0 being the last version that would work directly to localhost:port.

Hi @Tor, you are close :wink:

Due to the fact that there is some private info in my response, please check your DM’s. However, I will say that the url you are using to retrieve the Trial balance report is wrong. it should not contain the /api portion (which is why I refer to is as the “Front End” API).

The JSON Report data is quite complex so you will need to study it a bit to get a handle on finding what you need.

hi, if having this issue? may i know what is the reason?

@DnD_IT_Solution, try to see if the link works without the “/API”…

Hi @Tor ,
No luck, still the same error.
but I try to change the /API to small capital, it work perfectly now.
think the URL is case sensitive.

Thanks a lot. :laughing:

yes M code in Power BI is case sensitive