The "Create Redirect" API Allows adding a new url redirect to the system. Use this endpoint to create a url redirect with the specified details. Ensure that the required information is provided in the request payload.
http
POST https://services.leadconnectorhq.com/funnels/lookup/redirectAuthorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
locationId | string | Yes | 6p2RxpgtMKQwO3E6IUaT | |
domain | string | Yes | example.com | |
path | string | Yes | /Hello | |
target | string | Yes | https://www.google.com | |
action | string | Yes | URL | Possible values: 'funnel', 'website', 'url', 'all' |
Responses
200 - Successful response
data(object, required): Data containing details of the created redirect
json
{}422 - Unprocessable Entity
json
{}Example
curl -X POST 'https://services.leadconnectorhq.com/funnels/lookup/redirect' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"locationId": "6p2RxpgtMKQwO3E6IUaT",
"domain": "example.com",
"path": "/Hello",
"target": "https://www.google.com",
"action": "URL"
}'const response = await fetch('https://services.leadconnectorhq.com/funnels/lookup/redirect', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"locationId": "6p2RxpgtMKQwO3E6IUaT", "domain": "example.com", "path": "/Hello", "target": "https://www.google.com", "action": "URL"}),
});
const data = await response.json();import os, requests
response = requests.request(
'POST',
'https://services.leadconnectorhq.com/funnels/lookup/redirect',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"locationId": "6p2RxpgtMKQwO3E6IUaT", "domain": "example.com", "path": "/Hello", "target": "https://www.google.com", "action": "URL"},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/funnels/lookup/redirect');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
'Version: 2021-07-28',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode({'locationId': '6p2RxpgtMKQwO3E6IUaT', 'domain': 'example.com', 'path': '/Hello', 'target': 'https://www.google.com', 'action': 'URL'}),
]);
$data = json_decode(curl_exec($ch), true);