Webhook Configuration
Push Pgyer app events to a URL of your choice, or integrate with WeCom, DingTalk, and Lark group bots via Webhook.
A webhook is a mechanism for customizing the behavior of a web app via user-supplied callbacks, maintained by the third-party developer. Pgyer uses webhooks to push a message to the URL you specify whenever a given event happens, wiring Pgyer into another platform or website. For example, when you upload a new version, Pgyer pushes the corresponding message to your URL.
Pgyer webhooks support events for app updates, version management, app settings, app migration, and app deletion. Payload examples for some of these events are below.
Prerequisites
- An app already uploaded to Pgyer.
- A URL that can receive the message: either a service you've built yourself, or a group bot webhook URL issued by WeCom / DingTalk / Lark.
Webhook Types
Pick a type when creating a webhook — the type determines the payload format Pgyer uses:
| Type | Description |
|---|---|
| Other | Pushes raw JSON to your own service endpoint. See Data Protocol below for the field layout. |
| WeCom group bot | Pushes messages in WeCom bot format to the specified group. |
| DingTalk group bot | Pushes messages in DingTalk bot format to the specified group. |
| Lark group bot | Pushes messages in Lark bot format to the specified group. |
For group-bot types, Pgyer adapts the message to the platform's format for you — no conversion needed on your side.
Events You Can Subscribe To
When creating a webhook, the Select events to push section offers:
| Event | Trigger |
|---|---|
| App update | A new version of the app is uploaded. |
| Version management | Any version is edited, shown / hidden, or deleted. |
| App settings | Any change to app settings. |
| App migration | The app is migrated to another account. |
| App deletion | The app is deleted. |
Create a Webhook
- Basics. Open Settings → Webhook Settings in the app, click Create Webhook, set the Name, and choose the target platform under Webhook Type.
- URL. Enter the URL that should receive messages. For group bots, paste the webhook URL issued by the corresponding platform.
- Events and status. In Select events to push, check the events you want; under @mention members, decide whether group-bot messages should @ members (applies to group bots only); set Webhook status to Enabled and click Save.
Once saved, Pgyer will push messages to the URL when the chosen events fire.
Data Protocol
Pgyer sends events as an HTTP POST request with Content-Type: application/json and a JSON body.
When a new version is uploaded, the payload looks like this (actual values vary):
{
"action": "应用更新",
"title": "OooPlay",
"link": "https://www.pgyer.com/oooplay_test",
"message": "您的应用OooPlay有了新的版本(2.4)更新。",
"type": "updateVersion",
"os_version": "2.4",
"build_version": "139",
"created": "2015-10-09 11:25:16",
"updated": "2015-10-09 11:25:16",
"timestamp": 1444361118,
"appsize": "2238036",
"device_type": "iOS",
"notes": "修复了若干已知问题"
}Field Reference
| Field | Type | Description |
|---|---|---|
action | string | Event name, e.g. 应用更新 (app update). |
type | string | English identifier for programmatic routing — for an app update it's updateVersion. |
title | string | App name. |
link | string | Download page URL for the app on Pgyer. |
message | string | Human-readable message; also used as the default body of group-bot messages. |
os_version | string | App version (i.e. versionName), not the OS version — the field name is a historical artifact. |
build_version | string | App build number (iOS CFBundleVersion or Android versionCode). |
created | string | Event creation time in YYYY-MM-DD HH:MM:SS format. |
updated | string | Event update time, same format. |
timestamp | integer | Event Unix timestamp in seconds. |
appsize | string | Installer size in bytes. |
device_type | string | Platform the app targets; typically iOS or Android. |
notes | string | Extra content — the release notes for an app-update event. |
On the server, read the raw POST body to get the message. In PHP, for example:
$data = file_get_contents('php://input');Decode it as JSON to parse the fields:
$info = json_decode($data, true);From there, handle it however you need — append to a message stream, post to a notification center, etc.
WeCom Group Bot
- Open WeCom and go to the group that should receive messages.
- Open the group menu, choose Add Group Bot → Add Bot, name the bot, and finish creating it.
- Copy the webhook URL assigned to the bot, then paste it into the URL field on Pgyer's webhook creation page.
DingTalk Group Bot
- Open the settings in the top right of the group chat and go to Smart Group Assistant.
- Tap Add → Custom Bot, name the bot, set Security Settings → Custom Keyword to 应用, and finish.
- Copy the webhook URL assigned to the bot and paste it into the URL field on Pgyer's webhook creation page.
The keyword must be 应用 because Pgyer's push messages always contain the characters "应用" — setting this keyword is what lets the messages pass DingTalk's security check. Without it, DingTalk will reject the messages.
Lark Group Bot
- Open Group settings → Group bots → Add bot, choose Custom bot, and add it.
- Enter a name and description for the bot, then click Next.
- Set Security settings → Custom keyword to 应用, copy the webhook URL, and click Finish.
- Back on Pgyer's webhook creation page, paste the URL you copied into the URL field.
The keyword is also 应用 for the same reason as DingTalk: Pgyer's push messages contain "应用", and this keyword is what lets them pass Lark's security check.
Link WeChat to Your Pgyer Account
Follow Pgyer's official WeChat service account to receive notifications and manage your apps from inside WeChat.
Upload via the Jenkins Plugin
Install, configure, and use the official Pgyer Jenkins plugin — upload ipa/apk to Pgyer automatically and expose the response as Jenkins global variables.