I\'m trying to send a message to an Android phone but keep getting response code 401 with text: Unauthorized. Also I keep reading different stories on what key to use, I kno
I changed the header to:
$headers = array("Content-Type:" . "application/json", "Authorization:" . "key=" . "mykey");
And it works. The mykey is Key for browser apps.
You could do your headers like this just to make it a little easier to read and eliminate the concatenation:
$headers = array(
"Authorization:key=mykey",
"Content-Type:application/json",
);