Single PHP file to send push notification via OneSignal REST API

Here’s a single php file where you can send a push notification using your OneSignal account via REST API. It’s simple and straightforward using the code example at This one is more complete as the code example is just the curl_setopt code. But what if you don’t know how to POST the code from your form to send a message using the basic example from OneSignal REST API? Example in this link are all just API parameters with basic code example, no actual code example with an HTML form that will work if you copy paste it.