Volver

Acortador URL

.NET
C#
SQL Sever

img

Descripción

Herramienta diseñada para simplificar y optimizar la forma de compartir enlaces en línea. Te permite transformar URL largas y complicadas en enlaces cortos, perfectos para compartir en redes sociales, correos electrónicos o cualquier plataforma digital.

Características

Uso

Crear URL corta

Crea una nueva URL corta usando el método POST


POST /shorten

{

"url": "https://www.example.com/some/long/url"

}

Response:


{

"id": "1",

"url": "https://www.example.com/some/long/url",

"shortCode": "abc123",

"createdAt": "2021-09-01T12:00:00Z",

"updatedAt": "2021-09-01T12:00:00Z"

}

Recuperar URL original

Recupere la URL original de una URL corta utilizando el método GET


GET /shorten/abc123

Response:


{

"id": "1",

"url": "https://www.example.com/some/long/url",

"shortCode": "abc123",

"createdAt": "2021-09-01T12:00:00Z",

"updatedAt": "2021-09-01T12:00:00Z"

}

Actualizar URL corta

Actualice una URL corta existente usando el método PUT


PUT /shorten/abc123

{

"url": "https://www.example.com/some/updated/url"

}

Response:


{

"id": "1",

"url": "https://www.example.com/some/updated/url",

"shortCode": "abc123",

"createdAt": "2021-09-01T12:00:00Z",

"updatedAt": "2021-09-01T12:30:00Z"

}

Eliminar URL corta

Eliminar una URL corta existente usando el método DELETE


DELETE /shorten/abc123

Obtener estadísticas de URL

Obtenga estadísticas para una URL corta usando el método GET


GET /shorten/abc123/stats

Response:


{

"id": "1",

"url": "https://www.example.com/some/long/url",

"shortCode": "abc123",

"createdAt": "2021-09-01T12:00:00Z",

"updatedAt": "2021-09-01T12:00:00Z",

"accessCount": 10

}

Obtener todas las URL cortas

Obtenga todas las URL cortas utilizando el método GET


GET /shorten

Response:


[

{

"id": "1",

"url": "https://www.example.com/some/long/url",

"shortCode": "abc123",

"createdAt": "2021-09-01T12:00:00Z",

"updatedAt": "2021-09-01T12:00:00Z"

},

{

"id": "2",

"url": "https://www.example.com/some/other/long/url",

"shortCode": "def456",

"createdAt": "2021-09-01T12:00:00Z",

"updatedAt": "2021-09-01T12:00:00Z"

}

...

]