# Dynamic redirect using API connector

**URL:** <https://community.feathery.io/t/dynamic-redirect-using-api-connector/501>\
**Category:** Support\
**Created:** [February 22, 2024, 12:38pm UTC](https://community.feathery.io/t/dynamic-redirect-using-api-connector/501 "2024-02-22T12:38:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkennedy](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@mkennedy](https://community.feathery.io/u/mkennedy)\
**Post date:** [February 22, 2024, 12:38pm UTC](https://community.feathery.io/t/dynamic-redirect-using-api-connector/501/1 "2024-02-22T12:38:53Z")

</div>

I want to create a signup form that captures name and email and sends to our /register endpoint. The /register endpoint returns a unique email verification link that I’d like to redirect the user to.

I see docs for using Rules + API Connectors to pre-fill fields, but can’t find any examples for this use case. Is this supported?

---

<div class="post-metadata">

**Author:** ![summep](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@summep](https://community.feathery.io/u/summep)\
**Post date:** [February 22, 2024, 7:55pm UTC](https://community.feathery.io/t/dynamic-redirect-using-api-connector/501/2 "2024-02-22T19:55:22Z")

</div>

Hi Mike,

You can leverage the [API Connector and logic rule](https://docs.feathery.io/platform/build-forms/logic/advanced/javascript-rule-builder/api-connectors-in-code) to send the name and email to your endpoint, and write code in the logic rule’s code editor to receive the URL and [redirect the user to the URL link](https://www.w3schools.com/howto/howto_js_redirect_webpage.asp).

Below is a quick example of how you could do it (after setting the API Connector to your endpoint):

```auto
const body = {
  name: NameInput.value, // change to your own field name and request body format
  email: EmailInput.value // change to your own field name and request body format
  // ... other request body fields if needed
}
const response = await feathery.http.post("Your Endpoint URL", body);
// process your response to obtain the link if needed
// eg. const link = response.link
window.location.href = link;

```

Please let us know if you have further questions. Thank you.

Thank you,  
Summer

---

<div class="post-metadata">

**Author:** ![mkennedy](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@mkennedy](https://community.feathery.io/u/mkennedy)\
**Post date:** [February 23, 2024, 12:34pm UTC](https://community.feathery.io/t/dynamic-redirect-using-api-connector/501/3 "2024-02-23T12:34:22Z")

</div>

Thanks Summer. I’m running into an error where the code editor is saying ‘window’ is not defined. Any tips?

```auto
// map fields from feathery form
const body = {
  firstName: first_name.value,
  lastName: last_name.value,
  email: email.value 
  
}

//process the response
const response = await feathery.http.post("https://integrationapi.greencheckverified.com/users/marketing-user-registration", body);
const link = response.passwordUrl

window.location.href = link;
```

---

<div class="post-metadata">

**Author:** ![mkennedy](https://avatars.discourse-cdn.com/v4/letter/m/7993a0/32.png) [@mkennedy](https://community.feathery.io/u/mkennedy)\
**Post date:** [February 23, 2024, 12:45pm UTC](https://community.feathery.io/t/dynamic-redirect-using-api-connector/501/4 "2024-02-23T12:45:28Z")

</div>

Ah I see. It’s disabled unless we upgrade to business plan.

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/feathery/original/1X/ce6b36c4171c80ca6da459549280717eb8a1fba1.png)
