Really hoping this isn’t going to be a blocker for using bubble.io
I have a severely outdated client running on Magento 1. I am connecting to Magento 1’s API which involves first making a call to the “login” endpoint, retrieving a “sessionId” and then you can make any subsequent API call that you wish. For my example the next call I’ll be making is to the “lowChatGPTFieldValuesItems” endpoint.
The sessionId from Magento is valid for 1 hour. Since this is an internal application I’m building, I don’t honestly care much even if the login endpoint is called on every page load if it needs to be. All I need, is to get that sessionId so that I can make subsequent calls.
Does anybody know of an acceptable way to approach this?
Here are my API endpoints for the example:
I’ve then tried to create two elements on the page. One, is a hidden text element that loads the sessionId on page load from the API. This is working!
I also created a repeating group element to load the collection of items from the subsequent “lowChatGPTFieldValuesItems” endpoint. When I define the Datasource for this RG element, it wants me to select the API provider and for me to provide a static or dynamic value for the “sessionId”. I’ve tried retrieving the loaded text value from the “sessionId” element on the page. However, it doesn’t appear to allow me to do that.
It will however let me retrieve the “value” from a custom state on that hidden Text element. So I created a custom state. Now I just am trying to figure out how I can update that custom state with the “sessionId” from the “login” API endpoint.
But I honestly don’t know how to do that. My first thought was a backend workflow or an on-page-load event that calls the login API and sets the custom state. But in both the backend workflow and on-page-load event I didn’t see my custom plugin as an option to call. I’m not even sure I’m on the right path…
Please, anybody have ideas?