Send Push Notifications from Your Backend (REST API)
Your backend calls the REST API to send notifications and calls to the app.
🖥️ Backend
Your backend calls the REST API to send notifications and calls to the app.
Send a notification
Your backend calls
POST /notificationswith the headerAuthorization: Key <API_KEY>. Same format as OneSignal's API.curlcurl -X POST "https://tingpush.com/notifications" \ -H "Authorization: Key <API_KEY>" \ -H "Content-Type: application/json" \ -d '{ "app_id": "YOUR_APP_ID", "include_aliases": { "external_id": ["user-123"] }, "headings": { "en": "Order delivered" }, "contents": { "en": "Order #42 was delivered" }, "data": { "screen": "order", "id": "42" } }'Send a call
Add the
callfield. The app receives an accepted event withcall_idanddatato connect the real call (WebRTC/SIP/Agoraβ¦). When the caller cancels or another device answers, send"action": "ended"with theidso the other devices stop ringing.JSON// Incoming call — id must be a UUID; your backend generates and stores it { "app_id": "YOUR_APP_ID", "include_aliases": { "external_id": ["user-123"] }, "call": { "action": "incoming", "id": "6f1c2a3e-8a7b-4c5d-9e0f-1a2b3c4d5e6f", "caller_name": "John Smith", "handle": "0901234567", "is_video": false, "timeout": 45 }, "data": { "room": "abc" } } // End the call (caller cancelled / answered elsewhere / timed out) { "app_id": "YOUR_APP_ID", "include_aliases": { "external_id": ["user-123"] }, "headings": { "en": "Missed call" }, "contents": { "en": "John Smith called you" }, "call": { "action": "ended", "id": "6f1c2a3e-8a7b-4c5d-9e0f-1a2b3c4d5e6f" } }Examples by language
C#using var http = new HttpClient { BaseAddress = new Uri("https://tingpush.com") }; http.DefaultRequestHeaders.Add("Authorization", "Key <API_KEY>"); var callId = Guid.NewGuid(); await http.PostAsJsonAsync("/notifications", new { app_id = "YOUR_APP_ID", include_aliases = new { external_id = new[] { "user-123" } }, call = new { action = "incoming", id = callId, caller_name = "John Smith", is_video = false }, data = new { room = "abc" } });Node.jsconst callId = crypto.randomUUID(); await fetch('https://tingpush.com/notifications', { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: 'Key <API_KEY>' }, body: JSON.stringify({ app_id: 'YOUR_APP_ID', include_aliases: { external_id: ['user-123'] }, call: { action: 'incoming', id: callId, caller_name: 'John Smith', is_video: false }, data: { room: 'abc' }, }), });See every supported field in the API reference.
β After integrating, check
- Run the app on a real device with logging on: you should see
[PushConsole] Device registered β¦. - The project's Devices tab: the device appears; iOS devices show the VoIP badge if you use calls.
- The Send tab: send a test to that device.
- Choose π Call and test with the app open, closed and with the screen locked.