Webhook response with redirection to a customURL Error

Hi, I have created a webhook response with redirection to a URL after passing a variable filter, in the make it shows as a successfully completed task, but in the browser it does not redirect (Accepted message), can you help me with a solution, I have tried 307, 302, 301 and 200.

Thank you


1 Like

Hello Luis,

The custom Location header combined with a 301 status should redirect the user. I’ve copied your redirection in a scenario and It’s working for me.

One issue that you may be experiencing is a caching issue. Try fetching the make.com webhook endpoint in an incognito tab and see if it works.

2 Likes

Is the user pasting your Webhook URL in the browser address bar, or is your Webhook URL called from JavaScript on your web page (i.e.: when user clicks a button to trigger an event).

If it’s the latter, you’ll need to update the script to handle the redirect.

2 Likes

Hello @samliew , is the second option, when people click on a form submission button, my desire is to have several redirections according to the response parameters of the customer’s form. Do I include the script in the body of the response module? is there a suitable script?

No, you have to edit the script on the external web page to perform the redirect.

E.g.: depending on the actual script, this is an example:

// where "Body" field in your Webhook response module contains the URL,
location.href = response.body; 

Without knowing what the script on the web page looks like, I am unable to assist further. Could you provide that script, and provide a link to the web page?

2 Likes

thanks, where can I find the script on the external page?
for example, if I want to redirect to google.com

How is the form pointed to the Webhook on Make? Can you provide the link to the form, or source code for the form, or the script that handles the form submission, if any?

You haven’t provided much information about this form yet.

2 Likes

Hello @samliew this is the tally form:

Forms hosted on a custom domain (my case) have access to a code injection block. This allows you to inject code snippets or custom styles on both form and domain level.

This is how you send the tally form to the webhook:

 HTTP status code	200
Request to your endpoint	
{
  "eventId": "c227bc63-5883-4647-8e70-f48e779a74f0",
  "eventType": "FORM_RESPONSE",
  "createdAt": "2023-12-16T17:35:15.104Z",
  "data": {
    "responseId": "A8kbYy",
    "submissionId": "A8kbYy",
    "respondentId": "Bkza5R",
    "formId": "mKVr8k",
    "formName": "Perfilacion larga",
    "createdAt": "2023-12-16T17:35:14.000Z",
    "fields": [
      {
        "key": "question_Ek7VxB",
        "label": "a. ¿Cuál es tu nombre?",
        "type": "INPUT_TEXT",
        "value": "luisa"
      },
      {
        "key": "question_rjM9o2",
        "label": "b. ¿Cuál es tu apellido?",
        "type": "INPUT_TEXT",
        "value": "gonzalez"
      },
      {
        "key": "question_ODMqGg",
        "label": "c. ¿Cuál es tu número de teléfono?",
        "type": "INPUT_PHONE_NUMBER",
        "value": "+573191110049"
      },
      {
        "key": "question_BzWYNA",
        "label": "Seleccionar País",
        "type": "DROPDOWN",
        "value": [
          "c3ce00bb-c731-46fe-9fe7-1e5e0fc8cac2"
        ],
        "options": [
          {
            "id": "c3ce00bb-c731-46fe-9fe7-1e5e0fc8cac2",
            "text": "Alemania"
          },
          {
            "id": "d41967de-639c-4898-ad01-ad6f75478468",
            "text": "Argentina"
          },
          {
            "id": "26bc2d7a-be05-46fb-8ea7-74e75ddf18c1",
            "text": "Australia"
          },
          {
            "id": "6ed371da-e7d3-406d-bfa9-1b00e5ced951",
            "text": "Bahamas"
          },
          {
            "id": "1bf6a2ca-7766-4c78-9faa-39fd4fcd4aac",
            "text": "Barbados"
          },
          {
            "id": "8b662a6c-e6a1-4329-83cb-4ad2467c6b4a",
            "text": "Belice"
          },
          {
            "id": "4e60d09f-3700-4ff2-aad7-ba6aabff8ccf",
            "text": "Bolivia"
          },
          {
            "id": "f03f401c-02aa-4386-a342-6485601fb79e",
            "text": "Brasil"
          },
          {
            "id": "a915dd7b-0dbd-4064-849d-50d8ca48042f",
            "text": "Canada"
          },
          {
            "id": "b6802637-c7af-4f53-9001-f35a2add9179",
            "text": "Chile"
          },
          {

            "id": "0c975303-2427-48d0-be00-29d6a9f05805",
            "text": "Colombia"   

Thank you

It appears that you’ve used a server-side integration, not a frontend-injected script. For Webhook redirects to work, the frontend (displayed on the user’s browser) needs to perform the redirection.

2 Likes