Call Third Party API from Application Studio

Hello, I am looking for some clarification on the two REST widgets in Application Studio.

image

I’m running Kinetic 2023.2, and I’d like to call a REST API that I control directly from a Kinetic Customization. I get the impression that this should be possible due to the existence of the two REST widgets, however it appears that they ultimately do the same thing.

I believe it’s possible to call this third-party API from an Epicor Function, and call that function from my Kinetic customization, but this adds extra overhead that I’d like to avoid if possible. Does anyone have any experience doing something like this?

Thanks!

How are you going to authenticate in that service from UI?

This could be a pretty loaded answer, but to keep it as simple as possible this API can require an API key in the request header for authentication.

This is the problem with REST API calls from the client - you have to securely store the secret API key somewhere which is not possible in javascript.

1 Like

Ok so what I’m gathering is that there is no possible way to call a third party API (even if no authentication is required) from the widgets in Application Studio, correct?

We’re saying that it’s a bad idea to do such a thing in the client.

Make a function (which executes server-side) and call that from the client or from a BPM.

4 Likes

I can appreciate and understand not storing hard-coded credentials client side…but this is not what I am asking about.

I’d like to know if either of these two widgets can call an external API. Any insight into this would be greatly appreciated.

Yes, you can insecurely call 3rd party APIs from the REST widget.

For some reason, I have always associated calling Kinetic APIs with the rest-erp widget since I think it handles some internal security not required for 3rd parties. But I could be full of :poop: too.

1 Like

Thanks for confirming. Can you elaborate on how to do this? Here’s a few screenshots of the request configuration options on the generic REST widget…which seems to restrict me to only using the Epicor API.

I must be missing something…

Well, I was wrong. The way to do it is exactly like @jtownsend recommended: put the call in an Epicor Function and then call it from AppStudio.

1 Like

You’ll thank yourself later.

In the meantime, make it as generic as possible, so you can reuse it.

2 Likes

I’m not interested in doing anything like this, I really just wanted clarification on the purpose of two separately named rest widgets in AppStudio when they appear to serve the same purpose.

I am happy to fulfill my requirement of calling an external API from a kinetic customization by way of Kinetic Client → Epicor Function → 3rd party API. I really just wanted to know if I could skip the intermediate step.

That’s a good question. @bconner @hmwillett would/might know.

The only way I can see jumping to the resource directly is by using a WebSite widget where you would pass in a URL.