Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Redirect URLs to Content Delivery API Response #53

Open
stevematney opened this issue Aug 3, 2022 · 3 comments
Open

Add Redirect URLs to Content Delivery API Response #53

stevematney opened this issue Aug 3, 2022 · 3 comments

Comments

@stevematney
Copy link

As with #44, it would be really helpful for us to search Redirect URLs. We may have instances in our use of the API where we're searching for content a URL that has changed, but would still like to find it via the old URL. We would like something built into the API response body that would allow for this functionality.

I'm imagining something like using the /content/filter endpoint with a body like:

{
  "contentTypeAlias": "",
  "properties": [{
    "alias": "redirectUrls",
    "value": "/some/content/was/moved",
    "match": "CONTAINS"
  }]
}

Thanks!

@sitereactor
Copy link
Contributor

We have just released a Redirect API for Heartcore this week. You can find the documentation here: https://our.umbraco.com/documentation/Umbraco-Heartcore/API-Documentation/Redirect/

Right now it allows you to retrieve all Redirect urls, which correspond to all the ones you would see on Redirect dashboard in the backoffice. We don't have search or filtering capabilities yet, but we are open to suggestions. If you can elaborate with a use case for our understanding of what you want to achieve then we are happy to add additional options/endpoints to our backlog.

@stevematney
Copy link
Author

That's excellent! I will review this and let you know if we have any needs this doesn't meet. Thanks for your work!

@stevematney
Copy link
Author

stevematney commented Aug 31, 2022

Hello @sitereactor! One thing that would be super useful for our use case is a lookup by URL. Right now, we're basically checking the whole list of redirects if we don't find content by the URL on the first try. It would be a lot nicer if we could just get the current correct URL for one that has been redirected. I'm imagining something like:

var content: Content;
try {
  content = _deliveryService.Content.GetByUrl(url);
} catch (Exception ex) {
  var redirectedUrl = _deliveryService.Redirect.GetByUrl(url);
  content = _deliveryService.Content.GetByUrl(redirectedUrl);
}

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants