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 vanity_url to /v1/content output #219

Open
kmasiello opened this issue Mar 29, 2024 · 2 comments
Open

add vanity_url to /v1/content output #219

kmasiello opened this issue Mar 29, 2024 · 2 comments

Comments

@kmasiello
Copy link

/v1/content provides dashboard_url and content_url but does not provide the vanity URL, if set.

The old get_content_old() function would provide a TRUE/FALSE value for vanity_url and reported the url as the content_url.

The ergonomics of doing multiple API calls to get content info, get list of vanity url, and then joining is awkward.

@jonkeane
Copy link
Contributor

I need to dig further, but I suspect this might actually be a bug in the API of connect itself. From the API docs:

content_url: string The URL associated with this content. Computed from the associated vanity URL or GUID for this content.

Which to me reads as: the content_url will be the vanity if a vanity has been set or the GUID version if not, but when I tried it myself just now on content I know has a vanity I got back only the GUID. Why else would the docs mention vanity URL at all? But I'll need to dig into that and see if I can figure out what's wrong there.

This is a bit annoying, but you could also use connectapi::get_vanity_url() (though you have to construct a content item from each guid you have with connectapi::content_item(), and also concatenate the base URL onto the vanity suffix you get back)

@jonkeane
Copy link
Contributor

Should have reported back here earlier — it turns out that the docs were wrong. I've updated them, but vanities are not available there. They could (and probably should) be added to the API, but they are not there today.

So we'll have to do something like this in the meantime :(

This is a bit annoying, but you could also use connectapi::get_vanity_url() (though you have to construct a content item from each guid you have with connectapi::content_item(), and also concatenate the base URL onto the vanity suffix you get back)

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