Hyphen in shortCode breaks PATCH via API #1765
Answered
by
acelaya
mitchellkellett
asked this question in
Help wanted
-
How Shlink is set up
SummaryWhen you generate a shortcode that has a hyphen in it, you cannot use PATCH to update it via the API. Current behaviorReceiving error saying Expected behaviorExpecting to be able to update the existing link that has been created. How to reproduce
{
"longUrl": "https://accounting.website.app/invoices/INV-1234/pdf",
"title": "Invoice # 1234",
"customSlug": "INV-1234",
}
{
"shortCode": "INV-1234",
"title": "Short URL not found",
"type": "https://shlink.io/api/error/short-url-not-found",
"status": 404,
"detail": "No URL found with short code \"INV-1234\""
} |
Beta Was this translation helpful? Give feedback.
Answered by
acelaya
May 2, 2023
Replies: 1 comment 4 replies
-
I see some possible reasons for this:
|
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I see you are explicitly providing a domain during the short URL creation (POST), and since the response includes it in the domain field instead of
null
, it means that is not the default domain (the one provided duringshlink-installer install
or viaDEFAULT_DOMAIN
env var.That is the reason of the 404 during the PATCH request. You need to provide the domain as query param there as well.