API de comentarios
Comentarios en posts. Datos fijos en memoria: los cambios duran hasta que se reinicia la app.
Tu cuenta desbloquea estos endpoints. Usa Try it en la página de cada endpoint para enviar peticiones.
Estos endpoints necesitan una cuenta gratuita. Crea una o inicia sesión para ver sus detalles y probarlos aquí.
- GET
https://api.testingapis.com/api/CommentsList comments with filtering, sorting, search and paginationList comments with filtering, sorting, search and pagination. - POST
https://api.testingapis.com/api/CommentsCreate a commentCreate a comment. - GET
https://api.testingapis.com/api/Comments/{id}Get a comment by IDGet a comment by ID. - DELETE
https://api.testingapis.com/api/Comments/{id}Delete a commentDelete a comment.
Petición de ejemplo
List comments with filtering, sorting, search and pagination. Referencia completa y botón Send (en inglés).
curl -X GET "https://api.testingapis.com/api/Comments?limit=2"[
{
"id": 1,
"postId": 1,
"userId": 103,
"body": "Great writeup, exactly what I needed.",
"createdAt": "2025-07-01T15:23:00Z"
},
{
"id": 2,
"postId": 1,
"userId": 105,
… (3 more lines)Inicia sesión para ver los detalles
Los parámetros, los ejemplos de petición y respuesta y el panel Try it en vivo de estos endpoints son para miembros con sesión iniciada. Las cuentas son gratuitas y se crean en unos segundos.
Filtros, ordenación y paginación
El endpoint de lista acepta limit, page, offset, sort, order y q, y cualquier nombre de campo como filtro exacto. Los totales vuelven en la cabecera X-Total-Count. Los cambios se guardan en memoria hasta que se reinicia el servidor, así que los tests pueden crear, cambiar y borrar registros con libertad. Referencia de parámetros de query.