Skip to content

[API] Recovering an existing url #3764

Answered by dgw
gab12 asked this question in Q&A
May 30, 2024 · 2 comments · 1 reply
Discussion options

You must be logged in to vote

The way the shorturl action checks for a keyword already in use also checks if the keyword is reserved or banned, so there might not be a long URL to return in this case (error:keyword).

If you get this error when calling the shorturl action, the simplest next step if you want any long URL associated with the keyword is to call the expand action. If the keyword is in use, the link already associated with that keyword will be returned in the longurl field. You will get a 404 status code if the keyword is not in use (i.e. reserved). See the API tab of https://your.yourls.site/readme.html for more information about available API methods.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by gab12
Comment options

You must be logged in to vote
1 reply
@dgw
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants