Api
Initialize Widget
Authorization
WidgetJWT AuthorizationBearer <token>
HS256 with typ refref-widget+jwt, iss and projectId equal to Project ID, aud refref-widget, sub the external ID of the participant, participantKind its kind (individual or group), mandatory iat and exp, lifetime at most 900 seconds. scope lists one or more Widget scopes separated by one space; widget:read gives Widget init and the payout details read, and widget:payout gives the payout details save, for example "widget:read widget:payout". A token without the scope of an operation gets 403. Signed by the Project backend with its secret.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/widget/init" \ -H "Content-Type: application/json" \ -d '{ "projectId": "string" }'{ "position": "bottom-right", "triggerText": "string", "icon": "gift", "title": "string", "subtitle": "string", "logoUrl": "string", "cssVariables": { "property1": "string", "property2": "string" }, "shareMessage": "string", "enabledPlatforms": { "facebook": true, "twitter": true, "linkedin": true, "whatsapp": true, "email": true, "instagram": true, "telegram": true }, "referralLink": "string", "productName": "string", "participantId": "string", "referralLinks": [ { "refCodeId": "string", "refCode": "string", "url": "string" } ], "status": "enrolled", "enrollmentId": "string", "programId": "string"}