Edit a webhook - OsiriX-Foundation/KheopsAuthorization GitHub Wiki
Used to edit a webhook to an album. The user must be an admin.
URL : /albums/{album_id}/webhooks/{webhook_id}
Method : PATCH
Auth Required : Authorization with a JWT Bearer token with the user as the sub claim.
Headers
Accept
: If present, require that this value beapplication/json
Content-Type
: Must be :application/x-www-form-urlencoded
Parameters
url={url}
(Optional)name={name}
(Optional)secret={secret}
(Optional) if empty the preview secret will be removedevent={event}
- event : new_series, new_user, remove_series, delete_album.
event
can be send multiple times.(Optional)
- event : new_series, new_user, remove_series, delete_album.
add_event={event}
- event : new_series, new_user, remove_series, delete_album.
add_event
can be send multiple times.(Optional)
- event : new_series, new_user, remove_series, delete_album.
remove_event={event}
- event : new_series, new_user, remove_series, delete_album.
remove_event
can be send multiple times.(Optional)
- event : new_series, new_user, remove_series, delete_album.
enabled={true/false}
(Optional)
event
rewrite all the events list.
add_event
and remove_event
update the events list
If a event is in add_event
and remove_event
. He will be removed
If event
is empty, all the event will be removed.
Do not use event
and add/remove_event
at the same time
Success Response
- Status :
200 OK
{
"id": "QAdfIstxuOvwkcm39WEO",
"url": "https://webhook.site/123456",
"name": "the name of the webhook",
"use_secret": false,
"events": ["new_series","new_user"],
"enabled": true,
"last_triggers": [
{
"id": "peasMs9OIgbBnIA1na4ANnDj2b4ebl",
"status": "pass"
},
{
"id": "j3gbeiu78gI78GI87G2WIU278FGbbm",
"status": "fail"
},
{
"id": "bmnbmBU78gHizFGgvfi78fvUJzfFZu",
"status": "pass"
},
{
"id": "jhUIGHiugBIUgvZI8t7g87FVUzfv78",
"status": "fail"
},
{
"id": "iugiGi7g7zIGVujzfgG8f67JIup0uj9",
"status": "fail"
}
],
"number_of_triggers": 13
}
last_triggers
are sorted from most recent to oldest.
Error Response
If the user is not found If the album is not found
- Status :
404 Not Found
If a parameter is wrong
- Status :
400 Bad Request