Shorten a New Link
Generate a new shortened link for yourself
POST https://sh.phyr.in/api/generate
Creates a new link
Request Body
Name
Type
Description
url*
string
URL to be shortened
publicId
string
Custom alias to be used
password
string
Custom password
Request JSON
{
"url": "https://www.example.com",
"publicId": "hello",
"password": "123456"
}{
"success": true,
"link": {
"publicId": "hello",
"analyticsId": "mICTFx"
},
"message": "Link created successfully"
}{
"success": false,
"message": "Missing required fields. URL"
}Take a look at how you might call this method using curl and JS:
Possible errors
Custom alias exists: The publicId sent in the request body has been already used. Please use another publicID or keep it empty to generate a random alias.
Last updated