Creating a webhook for a GitHub Marketplace listing
To create a webhook for your GitHub Marketplace listing, you'll need to configure the payload URL and content type. To secure your webhook, you'll want to add a secret.
Configuring a webhook
This is the URL of the server endpoint that will receive the webhook
Webhooks can be delivered using different content types:
application/jsoncontent type will deliver the JSON payload directly as the body of the POST.
application/x-www-form-urlencodedcontent type will send the JSON payload as a form parameter called "payload".
Choose the one that best fits your needs.
GitHub recommends using the
application/json content type.
Setting a secret allows you to ensure that
POST requests sent to the payload URL are from GitHub. When you set a
secret you'll receive the
X-Hub-Signature header in the webhook
POST request. For more details on how to use the
secret and the
X-Hub-Signature header to secure your webhook payloads see "Securing your webhooks."
Creating a webhook
marketplace_purchase event webhook can only be setup from your application's GitHub Marketplace listing page.
In the upper-right corner of any page, click your profile photo, then click Settings.
In the left sidebar, click Developer settings.
In the left sidebar, click either OAuth Apps or GitHub Apps depending on the GitHub Marketplace listing you'd like to manage. Note: You can also manage your listing by navigating to https://github.com/marketplace/manage.
Select the app listing whose webhooks you'd like to add.
- Click Edit Marketplace listing.
- In the left sidebar, click Webhook.
- In "Payload URL", type the payload URL for your app's webhook.
- In the "Content type" dropdown, select the content type for your app's webhook.
- In "Secret", type the secret token for your app's webhook (optional).
- Click Create webhook.