When calling the table/:id/export endpoint - the export created is unreachable via the GUI.
The call (curl version of a working postman request):
curl --location --request POST 'https://api.rjmetrics.com/0.1/client/12345/table/68/export' \ --header 'X-RJM-API-Key: mykey' \ --header 'Content-Type: application/json'
Result via export/:id/info:
{ "id": 384580, "name": "Copy of skus_and_attributes", "client_id": 12345, "user_id": -1, "table_id": 68, "status": "Completed", "created": "2022-07-27 19:24:16", "num_rows": 1709, "expires": "2022-08-03 19:24:19", "download_href": "/export/384580" }
I can download the export via API, but cannot see it in my gui which is problematic.
The problem being there's no good way for me to automate reports for other people at specific times.
So if this is intended, then the workflow would be:
1) Make the api call to export the table/view
2) Store the response, and hit the /info link it gives until there's a download href
3) Use the download href to make yet another api call to download the export
4) Put the export in an email or file location etc, via ... something. (This needs to be automated)
OR
Copy a GUI created export every darn week (That's how long they last) so that finance people can just click a button (Preferable).
Docs for reference- https://devdocs.magento.com/mbi/docs/export-api.html
Please, someone tell me that I'm missing something.
Hi William,
Thanks for describing the issue with User_id
Our Engg team will start debugging this issue. Meanwhile, please share the CID (or MAG ID) and Merchant name so we make sure we are looking at the right MBI instance.
Regards,
MBI Team
Hi @glo11486ad4f3e ,
Our client id is 13254
Our company is "Relias", I'm not sure where to get the "MAG ID"
If this isn't enough information please let me know!
Hi William,
The given details would be sufficient for us to analyze further.
We will keep you posted as we progress.
Regards,
MBI Team
Hi William,
The Raw Data Export page shows a list of manual data exports initiated by users having access to MBI Dashboards. This list not showing Export API related line items has a few reasons:
Regarding the other suggestion from you to retain manual data exports, we are considering an option to extend the one week data retention period to a 2 or 3 weeks timeline. This is subject to feasibility and decision making.
I shall get back to you once something is finalized on this.
Regards,
MBI Team
Thanks for the update!
Retaining exports for more than a week wouldn't technically be necessary - as long as the 'copy' endpoint could still retrieve the settings of a previous export, say, monthly, then that would solve the pretty standard monthly export use case.
In any case I'll begin investigating how to automate from outside of MBI. I would really love to be able to schedule some exports within MBI, ideally
Hi William,
Thanks for the patronage.
Based on the roadmap and severity, we will take a call on the feature enhancement.
It sounds like you're facing a bit of a challenge with the Export API for MBI. That user_id of -1 doesn't sound quite right, and I can understand how it might make the export unreachable via the GUI.
I found some interesting web scraping videos that might provide a bit of a distraction https://www.nannostomus.com/web-scraping/web-scraping-videos/.