List redirects
GET
/api/v2/redirects.json
Get or search for one or more redirect rules using a range of accepted query parameters.
Scopes
Requires either the content
or content.readonly
OAuth scope.
Parameters
Accepts the following query parameters:
createdOn:min
Return redirect rules with a createdOn datetime greater than or equal to the
datetime supplied in ISO-8601 format (e.g. 2024-04-28T00:27:37+01:00)
|
createdOn:max
Return redirect rules with a createdOn datetime less than or equal to the datetime
supplied in ISO-8601 format (e.g. 2024-04-28T00:27:37+01:00)
|
createdOn:after
Return redirect rules with a createdOn datetime greater than the datetime supplied
in ISO-8601 format (e.g. 2024-04-28T00:27:37+01:00)
|
createdOn:before
Return redirect rules with a createdOn datetime less than the datetime supplied
in ISO-8601 format (e.g. 2024-04-28T00:27:37+01:00)
|
id:in
Return redirect rules specified within a comma-separated list of Redirect IDs. |
id:min
Return redirect rules with an ID greater than or equal to that specified. |
id:max
Return redirect rules with an ID less than or equal to that specified. |
id:after
Return redirect rules with an ID greater than that specified. |
id:before
Return redirect rules with an ID less than that specified. |
path
Return redirect rules matching the supplied path. |
resource
Return redirect rules matching the supplied resource. Accepted values are:
|
resourceId:in
Return redirect rules matching the resource IDs within a comma-separated list. When querying by resourceId:in ensure to supply resource to
avoid unexpected results.
|
target
Return redirect rules matching a target URL, including redirect rules associated with both dynamic and static resources. |
JSON Response
Evance will return a JSON object containing the following properties:
success
A successful search request containing zero or more results will always return a true value.
|
status
An integer matching the HTTP response code. A successful request will have a status of 200 .
|
data
An array containing zero or more Redirect data objects. |
pagination
Search results include a pagination object contain information about the current page, total pages, the limit per page and the total number of results available.
|
links
An object containing links to traverse available search results.
|
Example: finding all redirect rules for a page ID
Find all redirect rules associated with a known web page and its ID.
resource
=page
&
resourceId:in
=42309
Response
{
"success": true,
"status": 200,
"data": [
{
"id": 3066,
"resource": "page",
"resourceId": 42309,
"path": "/redirect-from",
"target": null,
"language": null,
"country": null,
"createdOn": "2019-11-09T01:02:00+00:00",
}
],
"pagination": {
"page": 1,
"limit": 100,
"total": 1,
"totalPages": 1
},
"links": {
"self": "https://examples.evance.me/api/v2/redirects.json",
"previous": null,
"next": null
}
}
Example: finding all redirect rules for a target URL
Let's assume that the page in our previous example has a URL of /my-web-page
.
target
=/my-web-page
Response
{
"success": true,
"status": 200,
"data": [
{
"id": 3066,
"resource": "page",
"resourceId": 42309,
"path": "/redirect-from",
"target": null,
"language": null,
"country": null,
"createdOn": "2019-11-09T01:02:00+00:00",
}
],
"pagination": {
"page": 1,
"limit": 100,
"total": 1,
"totalPages": 1
},
"links": {
"self": "https://examples.evance.me/api/v2/redirects.json",
"previous": null,
"next": null
}
}