빠른 시작
세 단계로 첫 푸시 알림을 보내 보세요.
1. 푸시 그룹 시작하기
group 값은 사람들이 보는 이름이에요. pushGroupId 값은 그룹을 가리키는 텍스트면 무엇이든 돼요. 이후 모든 호출에 같은 값을 보내세요.
1 2 3 4 5 6 7 8 9 10 11 12
curl -X POST https://api.webliveactivity.com/api/push/start \ -H 'Content-Type: application/json' \ -H 'x-api-key: wla_your_key' \ -d '{ "group": "Acme Orders", "pushGroupId": "acme-orders", "reuse": true, "brand": { "name": "Acme", "logo": "https://acme.example/logo.png" } }'
응답(201)에는 참여 버튼인 links.iframe 값이 들어 있어요. POST /api/push/start 문서를 참고하세요.
1 2 3 4 5 6 7 8
{ "ok": true, "groupId": "pg-7hk3mzq2wd9x", "pushGroupId": "acme-orders", "links": { "iframe": "<iframe src=\"https://api.webliveactivity.com/embed/button?type=notify&userId=pg-7hk3mzq2wd9x\" width=\"340\" height=\"95\" style=\"border:0;color-scheme:light\"></iframe>" } }
2. 사용자 참여시키기
웹 페이지에 links.iframe 값을 붙여 넣으세요. 휴대폰에서는 탭하면 그룹에 참여해요. 컴퓨터에서는 클릭하면 휴대폰 카메라로 스캔할 QR 코드가 표시돼요. 색상을 바꾸거나 어두운 페이지에서 쓰려면 실행 버튼을 참고하세요.
3. 알림 보내기
그룹의 모든 휴대폰이 받아요. POST /api/push/send 문서를 참고하세요.
1 2 3 4 5 6 7 8 9 10 11
curl -X POST https://api.webliveactivity.com/api/push/send \ -H 'Content-Type: application/json' \ -H 'x-api-key: wla_your_key' \ -d '{ "pushGroupId": "acme-orders", "title": "Your order shipped!", "subtitle": "Order #1234", "message": "Your package is on the way. Expected delivery: tomorrow by 5 PM.", "imageUrl": "https://acme.example/shipped.webp", "actionURL": "https://acme.example/orders/1234" }'
응답의 targeted 값은 알림을 보낸 휴대폰 수예요. 누군가 참여하기 전까지는 0이고, 그때는 아무것도 청구되지 않아요.









