Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Redirects

The Redirects system in Kinesis API provides a way to create and manage URL redirects within your application. This feature is useful for creating shortened URLs, handling legacy endpoints, or creating memorable links to complex resources.

Understanding Redirects

Each redirect in Kinesis API consists of:

  • ID: A unique identifier for the redirect
  • Locator: A short, unique code that forms part of the redirect URL
  • URL: The destination where users will be redirected

When someone accesses a redirect URL (e.g., https://your-api.com/go/abc123), they are automatically forwarded to the destination URL associated with that locator.

Accessing Redirects Management

To access the Redirects management interface:

  1. Log in to your Kinesis API account
  2. Navigate to /web/redirects in your browser or select "Redirects" from the navigation menu

Redirects Page

Redirects Interface

The Redirects management interface includes:

  • A searchable list of all redirects in the system
  • Pagination controls for navigating through large redirect collections
  • Actions for creating, updating, and deleting redirects
  • Tools for copying redirect URLs for sharing

Creating a Redirect

To create a new redirect:

  1. Click the "Create a New Redirect" button at the top of the page
  2. Enter the destination URL in the field provided
  3. (Optional) Specify a custom locator in the "Custom Locator" field
    • If left empty, the system will automatically generate a unique locator
    • Custom locators must be unique across the system
  4. Click "Create" to generate the redirect

Create Redirect Modal

The system will use your custom locator if provided, or generate a unique locator code if none is specified. This locator forms part of the shortened URL, ensuring uniqueness and consistency across all redirects.

Using Redirects

After creating a redirect, you can use it by:

  1. Copying the redirect URL by clicking the clipboard icon next to the redirect
  2. Sharing this URL with others or using it in your applications

The redirect URL will be in the format:

https://your-api-domain.com/go/locator-code

When users access this URL, they will be automatically redirected to the destination URL you specified.

Managing Redirects

Filtering Redirects

To find specific redirects:

  1. Use the search box at the top of the redirects list
  2. Type any part of the locator code or destination URL
  3. The list will automatically filter to show matching redirects

Pagination

For systems with many redirects:

  1. Navigate between pages using the pagination controls
  2. The page displays up to 15 redirects at a time

Updating Redirects

To change a redirect's destination URL:

  1. Find the redirect in the list
  2. Click the edit button (pencil icon)
  3. Enter the new destination URL in the modal that appears
  4. Click "Submit" to save the changes

Update Redirect Modal

Note that only the destination URL can be updated. The locator code is set when the redirect is created and cannot be modified at any point. If you need a different URL pattern, you'll need to create a new redirect and delete the old one.

Deleting Redirects

To remove a redirect:

  1. Find the redirect in the list
  2. Click the delete button (trash icon)
  3. Confirm the deletion in the modal that appears

Delete Redirect Modal

Once deleted, the redirect URL will no longer work, and users attempting to access it will receive an error.

Common Use Cases

Redirects in Kinesis API can be used for:

URL Shortening

Create more manageable, shorter URLs for sharing complex links:

https://your-api.com/go/product1 → https://your-api.com/products/catalog/electronics/smartphones/model-x-256gb-black

API Version Management

Provide stable URLs that can be updated when API endpoints change:

https://your-api.com/go/user-api → https://your-api.com/api/v2/users

Later, when you update to v3, you can simply update the redirect without changing the URL clients use.

Marketing Campaigns

Create memorable URLs for marketing campaigns:

https://your-api.com/go/summer-sale → https://your-api.com/shop/promotions/summer-2023?discount=25&campaign=email

Temporary Resources

Link to resources that might change location:

https://your-api.com/go/docs → https://docs.google.com/document/d/1abc123def456

Best Practices

For effective redirect management:

  1. Monitor Usage: Periodically review your redirects to identify and remove unused ones
  2. Avoid Redirect Chains: Try not to redirect to URLs that themselves redirect to other locations
  3. Security Awareness: Be cautious about redirecting to external sites that could pose security risks
  4. Regular Cleanup: Delete redirects that are no longer needed to keep your system organized