API and subscription flow reference =================================== API sequence diagrams ---------------------- Registration:: Browser JS Service Worker Vendor pushitgood.eu Your webapp | : : | : | : : | : | GET userDetails | | |------------------------------------------------------------------->| | : : | | | 200 OK | | |<-------------------------------------------------------------------| | : | | | | : | | : | request subscription | | : |-------------------------->| | : | : | | : |<---subscription obj-------| | : | : : | : | : : | : | POST /register | : | (contains unique notification vendor endpoint | : | required to later send a notification) | : |----------------------------------------------->| : | : : | POST webhook : | : : |------------------>: | : : | : Send notification:: Browser Your webapp pushitgood.eu Vendor(s) User agent | | : : | POST /notify | : : |--------------------->| : : | | : : |<---notification obj--| : : | | | : \ | | WebPush request | : | | |----------------->| | | | POST | | push event | | | state="sent|failed" | |------------->| | |<---------------------| | | | Repeated | | | | | for | | | | | each | | POST /ping | | | subscription | POST |<--------------------------------| | | state="received" | | | | |<----push obj---------| | | /