Persistent Session for API Usage

Hi Folks!

Hope this message find you well in these cold times. I’m having an issue with an API integration i have with the Kinetic Rest Service where i sometimes find the error of maximum user licenses reached because of a peak of user using the system at some point of the day.

Is there a way to make the session that the api uses for the integration to be persistent and to not expire in order to avoid this issue?

Contacted my CAM as i read in a few documents the existence of Web Service only licenses but it responded that those licenses are no longer being sold.

Thanks in advance for your help!

3 Likes

sus.. Could be true but I got one not that long ago, early last year maybe?

2 Likes

What is the nature of your API. What is it serving? Read only? Can you tell us more about the business problem that you’re trying to solve?

1 Like

Oof, this is exactly the problem Web Service licenses fix… That would be very disappointing if they are no longer sold.

1 Like

Hi Mark!

Basically we have an integration between Odoo and Epicor that does the following:

  • Reads inventory every 5 minutes
  • A few times a day reads the part master and creates new parts on Odoo.
  • Sales orders on Odoo create a new sale order on Epicor.
  • Shipments on Odoo between warehouses make inventory transfers on Epicor.

We use the ecommerce and POS modules on Odoo. Doing the mentioned actions sometimes we run out of licenses which makes us do the manual inventory transfers in Epicor as from a 200 SKU transfer for example, 67 might fail because of the maximum user error.

Wouldn’t surprise me though. Forces you to buy a more expensive license. Anything to increase the ARR.

3 Likes

What happens when Kinetic is down? Does Odoo retransmit every so often until successful?

That certainly is a lot of activity over the wire. Are both systems on prem?

Instead of hitting Epicor directly, you cloud put an intermediary system in there. That system would receive the connections from Odoo and save the transactions in a queue of some kind. If Kinetic is down, this would still work. If you had to restore Kinetic to a previous state, you could still rerun transactions to get back up to date.

The intermediary would open one connection to Kinetic and stay logged in, so you wouldn’t run out of licenses. New parts in Kinetic could be added (via method directive) to a queue going to Odoo and Odoo could grab them the next time it connected.

Inventory is trickier. Most eCommerce sites don’t have exact inventory all the time. They may start with some quantity and then offer a percentage for online sale. They may also keep an internal count remaining by subtracting sales from the available amount. Later, a new quantity from the ERP system would update the available balance. The other option is to look up the quantity live, but through the intermediary.

3 Likes

You can change the time-out settings for a user in User Account Security. I’m not sure how you’re doing your API integration, but maybe you can increase the time-out for the user that you’re using to create the session. Assuming that session is being reused, then you could have some kind of keep-alive process that would refresh the session being used so it doesn’t time out. If you are not reusing the session, then you’d need to create a system to be able to do that. Some kind of service factory that gives you the appropriate session when needed.

2 Likes

Hi Mark,

Thank you for your kind answer. Odoo is cloud and Kinetic is on-prem.

To avoid having an intermediary system is why we are looking for a way to keep the session open coming from Odoo as it would become a potentially point of failure.

I can see the benefits in a solution like that being Async and have the intermediate make sure data is replicated both ways.

Hi Pedro!

That sounds like could be a solution. Do you know of a method for session handling on Kinetic?

What happens when the connection is broken or one or the other system is otherwise unavailable. Having a highly coupled connection is a point of failure too, and a very likely one as well.

Fallacies of distributed computing - Wikipedia

1 Like

I haven’t needed to do something like that yet, and it also depends on your architecture. I s Oodo connecting directly to Kinetic through rest, or you have some middle layer somewhere that is doing that integration?

I would say @josecgomez is probably one of the experts on this as he created the Epicor Rest Helper package which I have used. In there you have to set up a session, so you can just keep that one around if you’re doing something like a .net core web/minimal api for your integration.

1 Like

Sounds like a good place to start. The integration was made in Odoo directly looking at Epicor App Server for Rest calls and handling errors directly on the code which is python.

Do you have a vpn set up in some way if you’re initiating it from Oodo, or do you have the Kinetic REST exposed to the outside?

1 Like

The we have an app server set up for external connections where only htpp calls can be made.

I hope you have at least restricted your firewall to inbound connections only from the Oodo IP address your integration is calling from.

I would personally have done the integration on an internal app that calls out to Oodo to get information then push that to Epicor, but I don’t know what your on-prem resources are.

It was a Thought at first but then exposing information via BAQs and REST calls felt like a more direct and more efficient approach.

Do you have any MES licences? From memory the data access licences could access and interact with all the ERP system from WCF/REST even though the GUI restricts what a human could do

We have Data Collection licenses if are those that you are referring to