JSON response table for redirects

This article explains what to expect from the redirects endpoints.

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 in API call specificaitons for redirects. This article outlines what to expect in the response.

JSON response

Calling the redirects API, described in API call specificaitons for redirects, will return results in the following format.

{
  categoryIds: [
  	"686f990ebd2987d4d97f089e"
	],
	fromUrl: "/news",
	id: "686be6e959c477368be36290",
	language: "en",
	statusCode: 301,
	toUrl: "/latest-news",
	version: 3
},
{
	categoryIds: [ ],
	fromUrl: "/matches",
	id: "686f7f66bd2987d4d97f089d",
	language: "en",
	statusCode: 301,
	toUrl: "/fixtures",
	version: 2
}


Field

Type

Description

id

String

Unique Identifier for the redirect

fromUrl

String

The URL that users should be redirected from. In other words, the previous home of the content.

Within Cortex, this field has validation to ensure it is a path, so that it will always start with a /.

toUrl

String

The URL that users should be redirected to. In other words, the new home of the content.

Within Cortex, this field has validation to ensure it is a path or a URL, so that it will always start with a /, http:// or https://.

statusCode

String

The status code to be used in the redirect. For example, if content has permanently moved, 301 is used. In Cortex, values are selected from a dropdown, with available options being 200, 301, 302, 404, and 410

categoryIds

Array

Array of strings, each of which corresponds to an ID of a category optionally added to the redirect in Cortex. The feature is intended to be flexible and use cases may vary depending on your requirements, but for example it may be used where multiple domains are powered by the Cortex CMS, to select one of those domains for the redirect to apply to.