firebase-cloud-messaging Sending Downstream Messages via cURL


Example

You can test sending messages using the FCM REST API by sending a request through cURL.

curl --header "Authorization: key=<API_KEY>" \
       --header Content-Type:"application/json" \
       https://fcm.googleapis.com/fcm/send \
       -d "{\"registration_ids\":[\"ABC\"]}"

Syntax retrieved from here.

The API_KEY indicated above is referring to the Server Key that can be seen in your Firebase Console's Cloud Messaging Tab.

The part where:

"{\"registration_ids\":[\"ABC\"]}"

is, can be replaced with your own payload. See the FCM HTTP Protocol Documentation for more details.