API call specifications for redirects

This article explains how to fetch redirects set by the Cortex user.

Introduction

Cortex provides a form in which users can create redirects to be implemented by the front-end website, such as where content may have moved to a different URL. For a front end website implementing this feature the first step is to get the redirects from Cortex, as described below.

API call constructs for redirects

Fetch all redirects

Below is the API call to fetch redirects.

GET {environment-id}/v1/clients/{client-id}/redirects

In which:

{environment-id} is the URL shown below, depending on environment used.

{client-id} is your client ID, assigned during onboarding.

For example:

GET https://navigation.cortextech.io/v1/clients/DEMO/redirects

Fetch all redirects in a category

GET {environment-id}/v1/clients/{client-id}/redirects?categoryIds={category-id}

In which:

{environment-id} and {client-id} are as described above.

{category-id} is the ID of a category created and assigned to a redirect in Cortex. Using this filter will return only the redirects assigned that category. Multiple categories can be specified by using a comma-delimited list of category IDs, as per the example below. Where multiple category IDs are added, the endpoint returns redirects with at least one of those category IDs.

For example, the following call would return all redirects in the client DEMO, with either or both of the categories with IDs 1234 or 5678.

GET https://navigation.cortextech.io/v1/clients/DEMO/redirects?categoryIds=1234,5678