{"id":18961657,"url":"https://github.com/trialanderrororg/ojs-webhook-plugin","last_synced_at":"2026-04-01T15:30:19.110Z","repository":{"id":168270507,"uuid":"626991888","full_name":"TrialAndErrorOrg/ojs-webhook-plugin","owner":"TrialAndErrorOrg","description":"EXPERIMENTAL Plugin for OJS allowing you to add webhooks for certain events, such as new submissions, submission status change, or review confirmations, making it easier to integrate OJS with other systems ","archived":false,"fork":false,"pushed_at":"2023-05-22T13:38:23.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-01T04:52:46.511Z","etag":null,"topics":["ojs","php","pkp","webhooks"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TrialAndErrorOrg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-04-12T15:06:02.000Z","updated_at":"2023-05-22T13:38:26.000Z","dependencies_parsed_at":"2023-12-03T10:30:45.017Z","dependency_job_id":null,"html_url":"https://github.com/TrialAndErrorOrg/ojs-webhook-plugin","commit_stats":null,"previous_names":["trialanderrororg/ojs-webhook-plugin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrialAndErrorOrg%2Fojs-webhook-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrialAndErrorOrg%2Fojs-webhook-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrialAndErrorOrg%2Fojs-webhook-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TrialAndErrorOrg%2Fojs-webhook-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TrialAndErrorOrg","download_url":"https://codeload.github.com/TrialAndErrorOrg/ojs-webhook-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239958283,"owners_count":19724925,"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":["ojs","php","pkp","webhooks"],"created_at":"2024-11-08T14:13:53.592Z","updated_at":"2026-04-01T15:30:19.029Z","avatar_url":"https://github.com/TrialAndErrorOrg.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nWebhook Plugin\n==============\n\nThe Webhook Plugin is an easy-to-use, flexible, and powerful solution for OJS/OMP that allows you to send notifications to external services when various events occur in your application. This plugin allows you to configure multiple webhooks per event and customize the data sent to each webhook. Additionally, the plugin provides an extensible interface for developers to add custom events and data providers.\n\nTable of Contents\n-----------------\n\n*   [Installation](#installation)\n*   [Configuration](#configuration)\n*   [Usage](#usage)\n    *   [Registering Your Own Webhooks](#registering-your-own-webhooks)\n    *   [Adding Custom Events](#adding-custom-events)\n    *   [Adding Custom Data Providers](#adding-custom-data-providers)\n*   [Returned Data](#returned-data)\n\nInstallation\n------------\n\n1.  Download the latest release of the Webhook Plugin from the GitHub repository.\n    \n2.  Extract the downloaded file and rename the extracted folder to `webhook`.\n    \n3.  Upload the `webhook` folder to the `plugins/generic` directory of your OJS/OMP installation.\n    \n4.  Login to the OJS/OMP admin dashboard and navigate to **Settings \u003e Website \u003e Plugins**.\n    \n5.  Find the Webhook Plugin in the \"Generic Plugins\" section and click the \"Enable\" checkbox.\n    \n6.  Click the blue \"Settings\" button to configure the plugin.\n    \n\n\nConfiguration\n-------------\n\nIn the plugin settings, you can configure webhooks by adding URLs and selecting the events that trigger each webhook. For each webhook, you can:\n\n*   Set the webhook URL.\n*   Choose the events that trigger the webhook.\n*   Send a test notification to the webhook URL.\n*   Optionally disable the webhook without removing it.\n\nUsage\n-----\n\n### Registering Your Own Webhooks\n\nTo register your own webhook, follow these steps:\n\n1.  In the Webhook Plugin settings, click the \"Add Webhook\" button.\n    \n2.  Enter the webhook URL where the notifications will be sent.\n    \n3.  Check the events you want to trigger the webhook.\n    \n4.  Save your changes.\n    \n### Adding custom events\n\nTo register your own events, you should use the `Plugin::Webhook::addEvent` hook. \n\nThis way, you get access to the default webhook events. By modifying this array, you can alter the available options. Make sure to inform your users that you are doing this.\n\n\n```php\n$defaultEvents = [\n    ['publicationEdit', 'Publication::validate', [$this, 'handleEditPublication']],\n    ['decision', 'EditorAction::recordDecision', [$this, 'editorDecision']],\n    ['add', 'Submission::add', [$this, 'addSubmission']],\n    ['confirmReview', 'ReviewerAction::confirmReview', [$this, 'confirmReview']],\n    ['updateStatus', 'Submission::updateStatus', [$this, 'updateStatus']],\n];\n```\n\nTo use this hook in your own plugin, register it like this:\n\n```php\nHookRegistry::register('Plugin::Webhook::addEvent', [$this, 'handleAddWebhookEvents']);\n```\n\nYou can then define a method `handleAddWebhookEvents` which gets access to the default webhook events. By modifying this array, you can alter the available options. Make sure to inform your users that you are doing this.\n\n### Webhook API Endpoint\n\nThere is an API endpoint you can use to send webhooks from the frontend, although it is only accessible to administrators at the moment. The endpoint is located at `/api/v1/webhook` and accepts the following parameters:\n\n*   `event`: (string) The name of the event.\n*   `data`: (any) The data to include in the webhook payload.\n*   `urls?`: (string\\[\\]) Optional array of URLs to send the webhook to. If not specified, the payload will be sent to the already defined URLs.\n\nTo use this API endpoint, make a POST request with the appropriate parameters.\n\n\nReturned Data\n-------------\n\nThe data returned by the webhook depends on the event that triggered it. \n\nIn general,  the payload looks like\n```json\n{\n    \"event\": \"event_name\",\n    \"data\": {\n       // relevant data \n    }\n}\n```\n\nFor e.g. publications, the data looks like\n```json\n```\n\nThe following events are currently supported:\n\n*   `publicationEdit`: Triggered when a publication is edited. The data returned includes the publication ID, the submission ID, and the user ID of the editor who made the change.\n*   `decision`: Triggered when a decision is made on a submission. The data returned includes the submission ID, the user ID of the editor who made the decision, and the decision.\n*   `add`: Triggered when a submission is added. The data returned includes the submission ID, the user ID of the editor who added the submission, and the submission title.\n*   `confirmReview`: Triggered when a reviewer confirms a review. The data returned includes the submission ID, the user ID of the reviewer who confirmed the review, and the review ID.\n*   `updateStatus`: Triggered when a submission's status is updated. The data returned includes the submission ID, the user ID of the editor who updated the status, and the new status.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrialanderrororg%2Fojs-webhook-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrialanderrororg%2Fojs-webhook-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrialanderrororg%2Fojs-webhook-plugin/lists"}