Integrating Lenme Webhooks
Integrating real time Lenme webhook notifications into your server side
Integrating Lenme Webhooks into Your Server
Verification and Data Extraction
Code examples for verification incoming webhooks
import json
import jwt
secret_key = "your-webhook-secret-key-here"
def validate_lenme_webhook(request_body, headers):
body = json.loads(request_body)
token = body.get("token")
topic = headers.get("X-Lenme-Topic")
data = jwt.decode(token, secret_key, algorithms=["HS256"])
return dataimport org.json.JSONObject;
import io.jsonwebtoken.Jwts;
import io.jsonwebtoken.Claims;
public class ValidateLenmeWebhook {
private static final String SECRET_KEY = "your-webhook-secret-key-here";
public static Claims validateLenmeWebhook(String requestBody, Map<String, String> headers) {
JSONObject body = new JSONObject(requestBody);
String token = body.getString("token");
String topic = headers.get("X-Lenme-Topic");
Claims data = Jwts.parser()
.setSigningKey(SECRET_KEY.getBytes())
.parseClaimsJws(token)
.getBody();
return data;
}
}
Last updated