Delete a Shortened URL

DELETE Method

The Delete URL shortener request enables you to delete the created Shortened URL. Once shortened URL is deleted, you can not use it.

Request Format

To delete shortened URL, use the url-shortner/ endpoint.

curl --location --request DELETE '<URL>/v1/<SID>/url-shortner/<ID>' \
--header 'api-key: <API-KEY>'
--form 'format="<FORMAT>"'

📘

Note:

Ensure to replace the parameter values with the proper inputs in the above code.

Parameters and Variables

Following is the list of parameters and variables used:

ReplaceVariableDescriptionExampleMandatory
URLStringBase URL based on region.<https://api.kaleyra.io>True
SIDStringAccount SID (Security Identifier).HXXXXXXX071USTrue
IDNumberURL shortener ID to delete the associated URL shortener URL from the database.21True
API-KEYAlphanumericAPI key generated from Kaleyra.io account.Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3True
FORMATStringOutput format must be as specified by this variable. If not passed or kept Empty then it will be JSON by default.

Supported values:
JSON or XML.
xmlFalse

Response Format

This section provides you with the success and failure JSON response format for different scenarios. Refer to the below sections for more information:

Sample Success Response
Sample Failure Response

Sample Success Response

The following is a sample success response:

{
    "code": "RBC103",
    "message": "Deleted successfully!"
    "data": {
        "message": "Deleted successfully!"
    },
    "error": {}
}

Sample Failure Response

The following is sample failure responses:

{
    "code": "RBC124",
    "message": "Id entered not exits with this api user",
    "data": [],
    "error": {
        "error": "Id entered not exits with this api user"
    }
}
{
    "code": "RBC124",
    "message": "Unable to delete the record.Record not found",
    "data": [],
    "error": {
        "error": "Unable to delete the record.Record not found"
    }
}

Sample Request

curl --location --request DELETE 'https://api.kaleyra.io/v1/HXXXXXXX071US/url-shortner/<id>' \
--header 'api-key: Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3'
--form 'format="xml"'