cancel
Showing results for 
Search instead for 
Did you mean: 

Export API for MBI creates exports with user_id of -1

Export API for MBI creates exports with user_id of -1

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.

9 REPLIES 9

Re: Export API for MBI creates exports with user_id of -1

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

Regards,
Adobe Commerce Intelligence Team

Re: Export API for MBI creates exports with user_id of -1

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!

Re: Export API for MBI creates exports with user_id of -1

Hi William,

 

The given details would be sufficient for us to analyze further.

 

We will keep you posted as we progress.

 

Regards,

MBI Team

Regards,
Adobe Commerce Intelligence Team

Re: Export API for MBI creates exports with user_id of -1

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:

 

  1. The core intention of having raw data export via API is downstream usage of MBI data. This need not be tracked by an MBI user.
  2. Export API may be automated by downstream systems excessively, thereby causing too many such occurrences. This would eventually defeat the purpose of showing these many occurrences in the Raw Data Export page.

 

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

Regards,
Adobe Commerce Intelligence Team

Re: Export API for MBI creates exports with user_id of -1

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 Smiley Happy 

Re: Export API for MBI creates exports with user_id of -1

Hi William,

 

Thanks for the patronage.

 

Based on the roadmap and severity, we will take a call on the feature enhancement.

Regards,
Adobe Commerce Intelligence Team

Re: Export API for MBI creates exports with user_id of -1

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.

Re: Export API for MBI creates exports with user_id of -1

I found some interesting web scraping videos that might provide a bit of a distraction https://www.nannostomus.com/web-scraping/web-scraping-videos/.

Re: Export API for MBI creates exports with user_id of -1

Honestly, I'm glad that I don't have to create anything from scratch or hire developers to improve my online business website. I work on Magento and at amasty site I can find a wide variety of extensions ready to use. By installing them with the help of experts, I can quickly get started using new features or providing new services.