First Curl Request Validating Gcm Api Key
Currently trying to build my first android app with a GCM API key which will be used by a piece of marketing software to send push notifications. Wanted to get some help validating
Solution 1:
As per my comment, you could try sending a simple downstream message using Postman.
Set request type to
POST
and provide the URL.Set the headers:
Authorization
==<Server Key>
(here, when you're just starting, it is suggested to proceed with using FCM instead of GCM, since a new valid Server Key can only be generated by creating a Firebase Project).Content-Type
=application/json
Set the (JSON payload) body (as raw):
{"registration_ids":["ABC"]}
Click on Send .
You should receive an InvalidRegistration
, a 401
, or an Invalid Legacy Server Key...
error:
InvalidRegistration
error means the token(s) are invalid, but the Server Key is valid.401
means invalid credentials, for this particular request, it's the Server Key.Invalid (legacy) Server-key delivered or Sender is not authorized to perform request.
means you attempted to use an old format Server Key (like the one in your post). New Server Key's have more characters. Usual response is like this:<HTML><HEAD><TITLE>Invalid (legacy) Server-key delivered or Sender is not authorized to perform request.</TITLE></HEAD><BODYBGCOLOR="#FFFFFF"TEXT="#000000"><H1>Invalid (legacy) Server-key delivered or Sender is not authorized to perform request.</H1><H2>Error 401</H2></BODY></HTML>
Post a Comment for "First Curl Request Validating Gcm Api Key"