Documentacion API - Webhooks
Esta documentaciĆ³n cubre los puntos finales para administrar webhooks.
1. Crear Webhook
Endpoint: POST /webhooks
DescripciĆ³n: Crear un webhook.
Request Headers:
- Authorization: Bearer token
Request Body:
{
"idUser": "string", // User ID to associate the webhook
"idLocker": "string", // Locker ID to associate the webhook
"url": "string" // URL to send the webhook notifications
}
Response:
{
"id": "string" // ID of the created webhook
}
2. Actualizar Webhook
Endpoint: PATCH /webhooks/:id
Descripcion: Actualiza un webbhook.
Request Headers:
- Authorization: Bearer token
Request Parameters:
- id: The ID of the webhook to update.
Request Body:
{
"idUser": "string", // Updated user ID
"idLocker": "string", // Updated locker ID
"url": "string" // Updated URL
}
Response:
{
"id": "string", // ID of the updated webhook
"url": "string", // Updated URL
"lockerId": "string", // Associated locker ID
"userId": "string" // Associated user ID
}
3. Eliminar Webhook
Endpoint: DELETE /webhooks/:id
Description: Elimina un webhook especifico por ID.
Request Headers:
- Authorization: Bearer token
Request Parameters:
- id: The ID of the webhook to delete.
Response:
{
"message": "Webhook with ID {id} successfully removed"
}