cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with creating an HTTP connection using embedded API

vondino
Deputy Chef I
Deputy Chef I

We use the embedded API to create a HTTP connection. The connection gets created successfully. But, the recipe in which we use the HTTP connection fails and the message we are shown is

401 Unauthorized { "code": 4001, "message": "Session Expired" }

After facing the error, we go to the Workato UI and update the Bearer token for the HTTP connection manually. And now when re-run the failed job, the job runs successfully. By the way our auth type is set to Header auth

We are somewhat sure that when we create the connection through the API, the value for the Authorization key is not getting set or getting set incorrectly. Will be great to get some help to fix above issue.

3 REPLIES 3

Prajwal
Deputy Chef III
Deputy Chef III

Hey @vondino ,

I have a question: When accessing APIs through the recipe, are you including the API key in the process? If not, it's essential to add the API key in the header section. Although the connection can be created successfully without adding the API key initially (as it's optional during connection setup), you'll need to include it in the header section while accessing the API in the recipe.

For more details, you can check out the documentation here: https://docs.workato.com/developing-connectors/http/connection-setup.html#authentication-type-header...

 

Let me know if you find this explanation helpful.

Prajwal Prasanna

@Prajwal When we create a recipe and the HTTP connection from the Workato UI, we do not include the API key in each of the API calls that we make from the recipe. All calls run successfully when the recipe is started and the trigger fires.

We copy the above recipe into a customer account and create a new HTTP connection using the embedded API's. The copy recipe and create HTTP connection succeed. But when we run the recipe, we face the issue of 401 Unauthorized { "code": 4001, "message": "Session Expired" }

After facing the above error, we go to the Workato UI and update the Bearer token for the HTTP connection manually. And now when re-run the failed job, the job runs successfully. By the way our auth type is set to Header auth

Clearly , it seems to be an issue with the way the HTTP connection is created using the embedded API. 

Hope the issue has been explained much clearly this time. We look forward to your help to overcome this issue.

Prajwal
Deputy Chef III
Deputy Chef III

Hello @vondino 

Okay, got it. Can you please provide more information on how you are configuring the http action to create a http connection using the embedded apis?

Prajwal Prasanna