Get a webhook - OsiriX-Foundation/KheopsAuthorization GitHub Wiki

Used to get a webhook for an album.

URL : /albums/{album_id}/webhooks/{webhook_id}

Method : GET

Auth Required : Authorization with a JWT Bearer token with the user as the sub claim.

Headers

  • Accept : If present, require that this value be application/json

Query Parameters

  • limit={limit} (Optional)
  • offset={offset} (Optional)

Limit and offset are used for the webhook history

Success Response

  • Status : 200 OK
{
    "id": "QAdfIstxuOvwkcm39WEO",
    "url": "https://webhook.site/123456",
    "name": "a name",
    "use_secret": false,
    "events": ["new_series","new_user","remove_series"],
    "enabled": true,
    "number_of_triggers": 11,
    "triggers": [
        {
            "id": "tHjsRP7tCHl2L8TilXe08pmEJYikj0",
            "is_manual_trigger": false,
            "event": "new_user",
            "user": {
                "email": "[email protected]",
                "last_name": "user",
                "first_name": "two",
                "sub": "baa88921-db53-4a59-80d3-7853da25e7f0"
            },
            "attempts": [
                {
                    "status": 204,
                    "time": "2020-02-04T15:15:22.826354",
                    "attempt": 4
                },
                {
                    "status": 404,
                    "time": "2020-02-04T15:15:18.737893",
                    "attempt": 3
                },
                {
                    "status": 404,
                    "time": "2020-02-04T15:15:12.889536",
                    "attempt": 2
                },
                {
                    "status": 404,
                    "time": "2020-02-04T15:15:07.030232",
                    "attempt": 1
                }
            ]
        },
        {
            "id": "GOj8EwCfKRtNb8NxkMbCwYBH5aZY58",
            "is_manual_trigger": false,
            "event": "new_series",
            "study" : {
                "study_uid" : "1.2.276.0.7238010.5.1.3.0.36848.1378230634.93",
                 "retrieve_url": "http://127.0.0.1/api/studies/1.2.276.0.7238010.5.1.3.0.36848.1378230634.93",
                "series" : [
                    {
                       "series_uid" : "1.2.276.0.7238010.5.1.3.0.36848.1378230634.9999",
                       "retrieve_url": "http://127.0.0.1/api/studies/1.2.276.0.7238010.5.1.3.0.36848.1378230634.93/series/1.2.276.0.7238010.5.1.3.0.36848.1378230634.9999"
                    },
                    {
                       "series_uid" : "1.2.276.0.7238010.5.1.3.0.36848.1378230634.8888",
                       "retrieve_url": "http://127.0.0.1/api/studies/1.2.276.0.7238010.5.1.3.0.36848.1378230634.93/series/1.2.276.0.7238010.5.1.3.0.36848.1378230634.8888"
                    },
                    { 
                       "series_uid" : "1.2.276.0.7238010.5.1.3.0.36848.1378230634.7777",
                       "retrieve_url": "http://127.0.0.1/api/studies/1.2.276.0.7238010.5.1.3.0.36848.1378230634.93/series/1.2.276.0.7238010.5.1.3.0.36848.1378230634.7777"
                    }
                ]
            },
            "attempts": [
                {
                    "status": 204,
                    "time": "2019-12-30T11:12:13.737893",
                    "attempt": 1
                }
            ]
        },
        {
            "id": "Tg8Koc5suS0nN9rqidlKT97psm9Bsz",
            "is_manual_trigger": false,
            "event": "remove_series",
            "study" : {
                "study_uid" : "1.2.276.0.7238010.5.1.3.0.36848.1378230634.93",
                "series" : [
                    { "series_uid" : "1.2.276.0.7238010.5.1.3.0.36848.1378230634.9999" },
                    { "series_uid" : "1.2.276.0.7238010.5.1.3.0.36848.1378230634.8888" },
                    { "series_uid" : "1.2.276.0.7238010.5.1.3.0.36848.1378230634.7777" }
                ]
            },
            "attempts": [
                {
                    "status": 204,
                    "time": "2019-12-31T11:15:18.754821",
                    "attempt": 1
                }
            ]
        },
        {...}
    ]
}

triggers are sorted from most recent to oldest. attempts are sorted from last attempt to first attempt.

Error Response

If the user is not found If the webhook is not found If the album is not found

  • Status : 404 Not Found