Hello Noorul,
In order to send push notifications via REST, there are basically two changes needed, in comparison to Parse:
1) Change the URL
The new URL is:
Instead of the old one:
2) Use the Master Key
The back4app service is based on the open-source platform developed by Parse itself (parse-server). This framework aims to maintain as much compatibility as possible with Parse, but at the same time, solve some security issues. One of the changes introduced is that, in order to send push notifications, you now need to use the Master Key of your app. That is valid even on the REST API.
So, what you'll need to do is replace the "X-Parse-REST-API-Key" header with the "X-Parse-Master-Key", updating the value accordingly.
If you don't use the Master Key, you'll get an error like the following:
HTTP/1.1 403 Forbidden
{"error":"unauthorized: master key is required"}
Example
In case it helps, I'm sending an example request bellow (using channels instead of the where clause).
POST /push HTTP/1.1
X-Parse-Application-Id: YOUR_APP_ID
X-Parse-Master-Key: YOUR_MASTER_KEY
Content-Type: application/json
{
"channels": ["general"],
"data": {
"alert": "The Giants won against the Mets 2-3."
}
}
If there are any issues still, just let us know =)