Redirects API
The Redirect entities are used to create redirects that the front end can follow
The redirects are their own entity type called FlowzRedirect, they have only two bundles called 404 and pre_content
404 redirects only fire when there was a 404 for the path in question.
pre_content redirects are applied before checking the source path, we check for redirects first.
You set either the source path or a source entity, when this source path or the path of the source entity is requested by the normal content api if there is a match we serve a redirect response to the web as below.
If you are creating a redirect to an article or a section it is better to use the source and destination entities reference fields rather than just the path field.
The front end responds to this by doing a 301 redirect in the browser to the destination.
https://indy-api-dev.brightsites.co.uk/api/independent.co.uk?path=/contributors
{
"type": "redirect",
"destination": "/service/external-contributors-policy-7905982.html"
}
Redirect entities use the REST API for all of their CRUD operations
REST Endpoints
/flowz_redirect/{flowz_redirect}: GET, PATCH, DELETE
/entity/flowz_redirect: POST
Custom endpoints
/api/redirect/bundles
/api/redirects/{bundle}
/api/redirect/{id}
Bundles
This is self-explanatory, they have only two bundles called 404 and pre_content but the endpoint returns the list of Bundles for the entity type eg:
https://indy-api-dev.brightsites.co.uk/api/redirect/bundles
Search & CMS List
The search endpoint accepts the following arguments:
| Query Parameter | Description |
|---|---|
| q | The search query |
| publication | The publication domain |
| limit | The number of items to retrieve |
| offset | Where to start, for paging |
eg:
https://indy-api-dev.brightsites.co.uk/api/redirects/pre_content?publication=ndependent.co.uk&limit=10&offset=0&q=vegan
Accessing the WEB API for a single redirect
I'm not sure if this is actually ever used but you can view a single redirect by id
// By ID
https://indy-api-dev.brightsites.co.uk/api/redirect/3
The way redirects are exposed in the front end is when a path is requested that matches either the path or the entity id ID of the source entity.
This is explained above.