Redirect form using a POST

This is the last hurdle in one of our local payment gateway’s API docs. Ironically, I’ve managed to get all the more complicated API calls and responses working great up until this last step in the process. The API docs say this:

So you would think, OK cool, it’s just a redirect so let me just use something in the workflow like:

a) Navigation > Open and external website > and then make the Destination the base URL with the 2 parameters added on using ampersands (&), so it would be something like:
(substituting PAY_REQUEST_ID and CHECKSUM with what the actual values are)

b) I also tried this version, but no luck:

c) and then also one with the quotation marks:"ABC123"&CHECKSUM="XYZ456"

d) I even tried using the Run javascript plugin and using‘URL’) to achieve the same thing as in the above options

BUT - then they give you that little bit of help in the right column as in most API docs with an example request so you know you’re on the right track, but it’s in PHP. Here’s the example they give:

There you see they’ve snuck in a sneaky method=“POST”, so now I’m thinking, OK it’s actually an API call they’re doing there. But hang on, how can it be an API call and then a redirect at the same time?

So then I go ahead and setup a POST API call in my API Connector, but then what? I try all the Data types from the dropdown menu starting with JSON all the way down to Empty. The one that seemed the most promising response was when I used the Text data type. I received a response, but just a whole lot of HTML which I can see has worked correctly, but this still is not the redirect I’m looking for.

Also to note from their example in the above screenshot is they’re calling it a form and that they are saying that input types are “hidden”, which I understand since this is a payment gateway redirect and you can’t be sending IDs and sensitive data in a visible URL.

There has also been talk of this backend workflow API Endpoint (which I also tried) where they use the Redirect (302), but all of those point to internal pages, so I have no idea how to make that work when the redirect needs to go external.

So in summary:

  1. I can’t apply a normal redirect of just entering the URL to an external website because there is some sort of POST involved
  2. I can’t do a normal POST API call, because then after that, it needs to redirect somewhere

Apologies for the exhaustive (and possibly emotional) explanation, but I really can’t get my head around this and it really does seem to be quite simple. At face value, it’s a really straight forward action, but I have no idea how to execute it. From some of the forum topics, I’m sure there are others who have come across this similar issue who will share my frustration.

If anyone has some ideas on how to tackle this, it would be really appreciated. Even if it’s something so simple as one line that I’ve missed, I would be only too happy to admit being the fool here for not spotting what is actually an easy solution.

A fellow no-coder (obviously…)

Have you got a screenshot of your API set up?

When you initialise it won’t redirect you, but if you get a response you are on the right track :slight_smile: If you can initialise with a proper response (i.e no errors), then test it out in a workflow and see what happens :slight_smile:

Hey @equibodyapp

Thank you, I’ve managed to get the response working fine after doing my POST in the API Connector plugin.

I know it’s working because I display the result in an iFrame, which the payment gateway’s tech support has obviously said is not correct for security reasons. They have said that "the values can’t be added to the URL, they need to be posted to the redirect URL. "

So I have everything technically working, but for a payment gateway, I know this certainly isn’t the right way about going about it within the page.

Any suggestions on how to get the redirect part right?

Below is my current last step in the workflow:


Many thanks