Look up a redirect
const url = 'https://apibase.ecomweb.app/api/v1/public/stores/example/url-redirects/lookup?path=example';const options = {method: 'GET', headers: {'x-storefront-api-key': '<x-storefront-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://apibase.ecomweb.app/api/v1/public/stores/example/url-redirects/lookup?path=example' \ --header 'x-storefront-api-key: <x-storefront-api-key>'Finds the active redirect for a path of the store, following any chain of redirects to its final destination. data is null when the path has no redirect.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The store’s ref, as returned by GET /stores.
Query Parameters
Section titled “Query Parameters”The path to look up, such as /old-page.
Responses
Section titled “Responses”object
The redirect for the path, or null when the path has none.
object
Redirect ID.
The path that is redirected, such as /old-page.
The final destination, after following any chain of redirects.
The HTTP status to redirect with, such as 301 or 302.
Always true: only active redirects are returned.
How the redirect was created, such as manual or auto.
When the redirect was created, as an ISO 8601 timestamp.
When the redirect was last updated, as an ISO 8601 timestamp.
Always true.
Example generated
{ "data": { "id": 1, "source_path": "example", "destination_path": "example", "redirect_type": 1, "is_active": true, "source_type": "example", "created_at": "example", "updated_at": "example" }, "success": true}The key is missing, invalid, revoked or expired.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}