From here:
How can I send a Firebase Cloud Messaging notification without use the Firebase Console?
Trying this:
curl -H "Content-type: application/json" -H "Authorization:key=<Your Api key>" -X POST -d '{ "to": "/topics/foo-bar","data": { "message": "This is a Firebase Cloud Messaging Topic Message!"}}' https://fcm.googleapis.com/fcm/send
With my API key. I get the response:
<HTML>
<HEAD>
<TITLE>Unauthorized</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Unauthorized</H1>
<H2>Error 401</H2>
</BODY>
</HTML>
What am I doing wrong, or is there a different way to send notifications from my server (I'd be doing POST requests from my server). Using curl from terminal.
Is there a difference between a Web API key and a server key? I'm currently using the web api key.