API : Edit Short URL
Check the Polls App.
End Point
METHOD : PUT
http://mocker.in/api/urls/SHORT_ID/EDIT_TOKEN
SHORT_ID
and EDIT_TOKEN
should be replaced with your actual data.
All Parameters
{
"slug": "test3",
"long_url": "http://google.com",
"edit_token": "0u92sQPm66",
"password": "123456",
"active_from": "23-03-2020",
"active_till": "29-03-2020",
"is_onetime": true
}
Above is the completely list of parameters. slug
can be provided if you want change the short url. The slug value will decide the URL of your Short URL. https://mocker.in/{slug}
. password
is different from edit_token
. password
is the password that your users will have to enter before they are redirected to the website specified in long_url
. This feature maybe used to password protect your shortened links. Whereas edit_token
is required to edit the Short URL in future. It is very important to store this somewhere. active_from
and active_till
is used to enable the poll only at a specific duration. is_onetime
if set to true will automatically delete the link after it is used once.
Response
{
"status": "success",
"message": "Your URL/Clip details have been updated.",
"data": {
"short_id": "test3",
"edit_token": "0u92sQPm66",
"short_url": "https://mocker.in/test3",
"edit_url": "https://mocker.in/test3/0u92sQPm66"
}
}
The reponse will always return two parameters, status
and message
. If status is success
then the action is complete. and if it is error
then that means some problem has occured. The problem details can be found in the message
parameter. Additionally creating a new short url returns the short_id
,edit_token
,short_url
and 'edit_url' inside the data
parameter. Once you have the short_id
and edit_token
you may get the complete details of the Short URL and also edit it.