Dashboard “export” API is not the same as UI export from. Just try to export the same dashboard via UI and then via API and compare outputs. They are similar, but they are not the same => you can’t mix API/UI exports/imports (at least not without additional transformation), because they use different models.
It would seem to me to be beneficial if either the two formats could be made to
be the same, or at least the one which requires less data could ignore the
additional data produced by the other. That way, at least one direction would
work.
I’m intrigued as to why two different methods of achieving what appears (at
least to the average user) to be the same thing are incompatible.
API aproach is only GET dashboard (not “export” dashboard) = it will provide model, which is used by app itself (so you can see internal ids/uids there) - “internal” model = this model can be used only in that particular Grafana instance.
UI is a real dashboard export, which will transform internal model (e.g. replace internal ids/uids, remove sensitive details) so this output can be imported into another Grafana instance without any issue.
It will be nice to have API for dashboard export, but that API still doesn’t exist. Export feature is still implemented only in the UI - frontend.