{"id":23088218,"url":"https://github.com/yeswiki/yeswiki-extension-webhooks","last_synced_at":"2025-04-03T17:14:57.342Z","repository":{"id":37588043,"uuid":"160862788","full_name":"YesWiki/yeswiki-extension-webhooks","owner":"YesWiki","description":"Outgoing webhooks at each addition/modification/deletion of a YesWiki Bazar item","archived":false,"fork":false,"pushed_at":"2023-06-12T07:54:25.000Z","size":328,"stargazers_count":0,"open_issues_count":2,"forks_count":2,"subscribers_count":14,"default_branch":"doryphore","last_synced_at":"2025-02-09T05:41:24.439Z","etag":null,"topics":["php","webhooks","yeswiki"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YesWiki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-07T18:46:29.000Z","updated_at":"2021-11-18T16:30:21.000Z","dependencies_parsed_at":"2025-02-09T05:41:01.626Z","dependency_job_id":"17080d01-9606-4289-88cf-7d4ca59e082c","html_url":"https://github.com/YesWiki/yeswiki-extension-webhooks","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YesWiki%2Fyeswiki-extension-webhooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YesWiki%2Fyeswiki-extension-webhooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YesWiki%2Fyeswiki-extension-webhooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YesWiki%2Fyeswiki-extension-webhooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YesWiki","download_url":"https://codeload.github.com/YesWiki/yeswiki-extension-webhooks/tar.gz/refs/heads/doryphore","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247043348,"owners_count":20874087,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","webhooks","yeswiki"],"created_at":"2024-12-16T20:16:16.190Z","updated_at":"2025-04-03T17:14:57.309Z","avatar_url":"https://github.com/YesWiki.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yeswiki-extension-webhooks\nOutgoing webhooks at each addition/modification/deletion of a Bazar item.\n\n## Installation\n\nPut this repository inside the `/tools/webhooks` directory of YesWiki.\n\n## Configuration\n\nGo to the BazaR main page, at the bottom you have a Webhooks section.\n\n- On the left you have a dropdown menu to select the format: `Raw`, `Mattermost`, `Slack`\n- In the middle, you have a dropdown menu to select for which Bazar items the webhooks will be called. By default, the webhooks will be called on the addition/modification/deletion of all Bazar items.\n- On the right you must enter the URL of the webhook to call\n\nEvery time you click on Update, a new row will be added. If you wish to delete a webhook, just use a blank URL and it will be removed on update.\n\n### Mattermost\n\nTo integrate the webhook with a Mattermost chatroom, follow this guideline:\n\n- Log into your Mattermost chatroom as an admin\n- On the main menu, click on \"Integration\" (you only see it if you're an admin)\n- Choose \"Incoming webhooks\"\n- Create a webhook with the configurations you wish to use\n- On the YesWiki BazaR page, choose \"Mattermost\" and copy the URL provided by Mattermost\n\nYou can define `webhooks_bot_name` and `webhooks_bot_icon` in `wakka.config.php` if you want to change the look of the bot which will post on Mattermost (you must allow this in the Mattermost configurations).\n\n### Slack\n\nTo let Slack handle an incoming webhook, follow the [guide](https://api.slack.com/incoming-webhooks) here.\n\nOn the YesWiki BazaR page, choose \"Slack\" and copy the URL provided by Slack.\n\n### Raw\n\nIf you choose the \"Raw\" format, all informations about the given Bazar item will be POSTed to the given URLs in a JSON format.\n\nThe data will be sent formatted like this:\n\n- `action`: action type (add/edit/delete)\n- `user`: name of the user who performed the action\n- `text`: formatted text describing the action done (this is what is sent to Mattermost/Slack)\n- `data_type`: for now the value will be always \"bazar\". In the future we may support regular pages.\n- `bazar_form_id`: the ID of the Bazar item\n- `data`: all the data of the Bazar item\n\n### ActivityPub\n\nThe ActivityPub format only works if the Bazar objects are semantically defined. Please see [the documentation](https://yeswiki.net/documentation/?BazarSemantique) (in French) to know how to do that. You must use `https://www.w3.org/ns/activitystreams` as the main context, but other contexts can be added as well.\n\nThe data will be formatted like this:\n\n```json\n{\n  \"@context\": \"https://www.w3.org/ns/activitystreams\",\n  \"type\":\"Create\",\n  \"to\": [\n    \"http://localhost/?WikiAdmin/followers\",\n    \"https://www.w3.org/ns/activitystreams#Public\"\n  ],\n  \"actor\": \"http://localhost/?WikiAdmin\",\n  \"object\": { \n    \"id\": \"http://localhost/?MyComment\",\n    \"type\": \"Note\",\n    \"attributedTo\": \"http://localhost/?WikiAdmin\",\n    \"to\": [\n      \"http://localhost/?WikiAdmin/followers\",\n      \"https://www.w3.org/ns/activitystreams#Public\"\n    ],\n    \"title\":\"My comment\",\n    \"content\":\"Thank you for reading my comment\",\n    \"published\":\"2019-10-21T14:56:32Z\",\n    \"updated\":\"2019-10-21T14:56:32Z\"\n  }\n}\n```\n\nFor the `Delete` activity, only the object URI is sent.\n\nThe `published` and `updated` fields are set automatically, unless you mark a field explicitely with this context.\n\n#### ActivityPub actors\nBy default, the actor posting the activity will be the logged-in user. You can also mark a field with the context `https://www.w3.org/ns/activitystreams#author` to override this value.\n\nYou can set two parameters in the `wakka.config.php` file :\n\n- `webhooks_activitypub_default_actor`: The URL you associate with this parameter will be used as an actor for **all** ActivityPub activities.\n\n- `webhooks_activitypub_actors_base_url`: The base URL to use for all actors. For example if you use `https://activitypub.server/actor/`, then the URI of user WikiAdmin will be `https://activitypub.server/actor/WikiAdmin` instead of `http://localhost/?WikiAdmin`.\n\n\n## Test incoming webhook\n\nIf you wish to see the data returned by the webhook, you can use the URL of the test incoming webhook: `http://YOUR_URL/?BazaR\u0026vue=test-webhook`. All data POSTed to this URL will be inserted into the `yeswiki_triples` table.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeswiki%2Fyeswiki-extension-webhooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeswiki%2Fyeswiki-extension-webhooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeswiki%2Fyeswiki-extension-webhooks/lists"}