JWS Webhooks
Send subscriptions events to a custom JWS (JSON Web Signature) webhook channel. Glassfy monitors the subscriptions and sends all relevant events to the custom Webhook even if the user does not have the app open.
- Open the JWS webhook connector setting in the Glassfy dashboard
- Set your webhook URL in the "JWS webhook URL" field
JWS response format
Sample event:
{
"event": {
"id": "21e8fe4ea29e4d699a5be432cf79dd9a",
"event_date": 1644933838,
"source": "SDK",
"type": 5008,
"environment": "S",
"store": "1",
"vendorid": "8NOV6FQBHHRJ4F9N2HV0HUXOQ5LL0QA3",
"appid": "SZ126UWWVGTH82UE9313EQQ5N1YM3QOA",
"subscriberid": "dfd29763e530470688a5741f419e7c07",
"productid": "ios_read_article_5",
"date_ms": 1644933832000,
"original_purchase_date_ms": 1644933832000,
"price": 0.99,
"price_usd": 1.3381319169279828,
"currency_code": "GBP",
"country_code": "GB",
"sub_platform": "1",
"system_version": "15.3.1",
"device": "iPhone14,2",
"sdk_version": "dev",
"bundle_version": "1",
"app_version": "1.0",
"is_trial_period": false,
"trial_status":0,
"userid":"custom user id"
},
"exp": 1644937438,
"iss": "glassfy"
}
Read the Webhooks documentation for details of the event
field.
Glassfy generates a signed JWS token for each event. You can use the Glassfy public key https://dashboard.glassfy.io/.well-known/jwks.json to verify it.
Sample JWS token event:
eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9.eyJldmVudCI6eyJzb3J0X2RhdGVfbXMiOjE2NDQ5MzM4MzIwMDAsIml
kIjoiMjFlOGZlNGVhMjllNGQ2OTlhNWJlNDMyY2Y3OWRkOWEiLCJldmVudF9kYXRlIjoxNjQ0OTMzODM4LCJzb3VyY2U
iOiJTREsiLCJ0eXBlIjo1MDA4LCJlbnZpcm9ubWVudCI6IlMiLCJzdG9yZSI6IjEiLCJ2ZW5kb3JpZCI6IjhOT1Y2RlF
CSEhSSjRGOU4ySFYwSFVYT1E1TEwwUUEzIiwiYXBwaWQiOiJTWjEyNlVXV1ZHVEg4MlVFOTMxM0VRUTVOMVlNM1FPQSI
sInN1YnNj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wiaXNzIjoiZ2xhc3NmeSJ9.mOIfTrxy2LBQTq_TwpTzFnkQQ0
6KahgMUKsZO7GKJq_-e1a0nqEDraH_mRmosrxNSQqEnelHne0Jg7_EmkqTOg
The event is then POSTed to the "JWS webhook URL".
Retries
Glassfy will send POST requests to your server with the authentication header and a json with the details of the event. Your server must return a 200 status code. If the status code is not 200 Glassfy will retry 5 times (after 5, 15, 30 and 60 minutes). After all the retries Glassfy stops sending the event.
Updated over 1 year ago