Add revision changes view link to webhook "page update" event data #2618

Closed
opened 2026-02-05 04:37:57 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @moucho on GitHub (Jan 31, 2022).

Originally assigned to: @ssddanbrown on GitHub.

Describe the feature you'd like

When using webhooks to send notifications to an external app, it would be great if:

  • when a page was edited, send the link to the revision view of the changes. It could also be a link to the page instead
  • when a page is created, send the link to the new page @ssddanbrown edit, already possible

Describe the benefits this feature would bring to BookStack users

This will help if someone wanted to see the changes made with a simple click

Additional context

No response

Originally created by @moucho on GitHub (Jan 31, 2022). Originally assigned to: @ssddanbrown on GitHub. ### Describe the feature you'd like When using webhooks to send notifications to an external app, it would be great if: - when a page was edited, send the link to the revision view of the changes. It could also be a link to the page instead - ~when a page is created, send the link to the new page~ _@ssddanbrown edit, already possible_ ### Describe the benefits this feature would bring to BookStack users This will help if someone wanted to see the changes made with a simple click ### Additional context _No response_
OVERLORD added the 🔨 Feature Request label 2026-02-05 04:37:57 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Feb 28, 2022):

Hi @moucho,

when a page is created, send the link to the new page

This is already included under a "url" property on the webhook request. For reference, here's an example of this webhook's data:

JSON Example
{
    "event": "page_create",
    "text": "Dan Brown created page \"New page webhook test\"",
    "triggered_at": "2022-02-28T16:33:20.000000Z",
    "triggered_by": {
        "id": 1,
        "name": "Dan Brown",
        "slug": "dan-brown-WI3"
    },
    "triggered_by_profile_url": "https://bookstack.local/bookstack/user/dan-brown-WI3",
    "webhook_id": 10,
    "webhook_name": "Page Create Test",
    "url": "https://bookstack.local/bookstack/books/I95OYz1PZy/page/new-page-webhook-test",
    "related_item": {
        "id": 2591,
        "book_id": 13,
        "chapter_id": 0,
        "name": "New page webhook test",
        "slug": "new-page-webhook-test",
        "priority": 253,
        "created_at": "2022-02-28T16:33:09.000000Z",
        "updated_at": "2022-02-28T16:33:20.000000Z",
        "created_by": 1,
        "updated_by": 1,
        "draft": false,
        "revision_count": 1,
        "template": false,
        "owned_by": 1
    }
}

when a page was edited, send the link to the revision view of the changes

My issue with this is that we need to the limit the scope of the webhook data at some level. More thoughts on this in my comment here.

Either way, I'll update the original issue title and description to be focused on this particular detail since the page URL is already provided.

@ssddanbrown commented on GitHub (Feb 28, 2022): Hi @moucho, > when a page is created, send the link to the new page This is already included under a "url" property on the webhook request. For reference, here's an example of this webhook's data: <details> <summary>JSON Example</summary> ```json { "event": "page_create", "text": "Dan Brown created page \"New page webhook test\"", "triggered_at": "2022-02-28T16:33:20.000000Z", "triggered_by": { "id": 1, "name": "Dan Brown", "slug": "dan-brown-WI3" }, "triggered_by_profile_url": "https://bookstack.local/bookstack/user/dan-brown-WI3", "webhook_id": 10, "webhook_name": "Page Create Test", "url": "https://bookstack.local/bookstack/books/I95OYz1PZy/page/new-page-webhook-test", "related_item": { "id": 2591, "book_id": 13, "chapter_id": 0, "name": "New page webhook test", "slug": "new-page-webhook-test", "priority": 253, "created_at": "2022-02-28T16:33:09.000000Z", "updated_at": "2022-02-28T16:33:20.000000Z", "created_by": 1, "updated_by": 1, "draft": false, "revision_count": 1, "template": false, "owned_by": 1 } } ``` </details> > when a page was edited, send the link to the revision view of the changes My issue with this is that we need to the limit the scope of the webhook data at some level. More thoughts on this in [my comment here](https://github.com/BookStackApp/BookStack/issues/3279#issuecomment-1053732429). Either way, I'll update the original issue title and description to be focused on this particular detail since the page URL is already provided.
Author
Owner

@ssddanbrown commented on GitHub (Mar 26, 2022):

Within changes in 3625f12abe I have now added revision details to page_update and page_create events. These added details don't provide a link to the revision changes view but should provide enough detail for building that url yourself if required.

Updated JSON Example
{
    "event": "page_update",
    "text": "Benny updated page \"My wonderful updated page\"",
    "triggered_at": "2021-12-11T22:25:10.000000Z",
    "triggered_by": {
        "id": 1,
        "name": "Benny",
        "slug": "benny"
    },
    "triggered_by_profile_url": "https://bookstack.local/user/benny",
    "webhook_id": 2,
    "webhook_name": "My page update webhook",
    "url": "https://bookstack.local/books/my-awesome-book/page/my-wonderful-updated-page",
    "related_item": {
        "id": 2432,
        "book_id": 13,
        "chapter_id": 554,
        "name": "My wonderful updated page",
        "slug": "my-wonderful-updated-page",
        "priority": 2,
        "created_at": "2021-12-11T21:53:24.000000Z",
        "updated_at": "2021-12-11T22:25:10.000000Z",
        "created_by": {
            "id": 1,
            "name": "Benny",
            "slug": "benny"
        },
        "updated_by": {
            "id": 1,
            "name": "Benny",
            "slug": "benny"
        },
        "draft": false,
        "revision_count": 9,
        "template": false,
        "owned_by": {
            "id": 1,
            "name": "Benny",
            "slug": "benny"
        },
       "current_revision": {
            "id": 597,
            "page_id": 2598,
            "name": "My wonderful updated page",
            "created_by": 1,
            "created_at": "2021-12-11T21:53:24.000000Z",
            "updated_at": "2021-12-11T21:53:24.000000Z",
            "slug": "my-wonderful-updated-page",
            "book_slug": "my-awesome-book",
            "type": "version",
            "summary": "Updated the title and fixed some spelling",
            "revision_number": 2
        }
    }
}

These changes will be part of the next feature release so I'll therefore close this off.

@ssddanbrown commented on GitHub (Mar 26, 2022): Within changes in 3625f12abe7c0cc052bd027af961d0214d6fcc7e I have now added revision details to `page_update` and `page_create` events. These added details don't provide a link to the revision changes view but should provide enough detail for building that url yourself if required. <details> <summary>Updated JSON Example</summary> ```json { "event": "page_update", "text": "Benny updated page \"My wonderful updated page\"", "triggered_at": "2021-12-11T22:25:10.000000Z", "triggered_by": { "id": 1, "name": "Benny", "slug": "benny" }, "triggered_by_profile_url": "https://bookstack.local/user/benny", "webhook_id": 2, "webhook_name": "My page update webhook", "url": "https://bookstack.local/books/my-awesome-book/page/my-wonderful-updated-page", "related_item": { "id": 2432, "book_id": 13, "chapter_id": 554, "name": "My wonderful updated page", "slug": "my-wonderful-updated-page", "priority": 2, "created_at": "2021-12-11T21:53:24.000000Z", "updated_at": "2021-12-11T22:25:10.000000Z", "created_by": { "id": 1, "name": "Benny", "slug": "benny" }, "updated_by": { "id": 1, "name": "Benny", "slug": "benny" }, "draft": false, "revision_count": 9, "template": false, "owned_by": { "id": 1, "name": "Benny", "slug": "benny" }, "current_revision": { "id": 597, "page_id": 2598, "name": "My wonderful updated page", "created_by": 1, "created_at": "2021-12-11T21:53:24.000000Z", "updated_at": "2021-12-11T21:53:24.000000Z", "slug": "my-wonderful-updated-page", "book_slug": "my-awesome-book", "type": "version", "summary": "Updated the title and fixed some spelling", "revision_number": 2 } } } ``` </details> These changes will be part of the next feature release so I'll therefore close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2618