Server-side topic subscription - Unauthorized - am I using the wrong credentials?

438 views
Skip to first unread message

Tom Dancer

unread,
Jan 19, 2017, 1:15:10 PM1/19/17
to Firebase Google Group
I need a little help checking whether I'm using the wrong credentials...

The FCM docs refer to using the Instance ID APIs to to perform basic topic management tasks. I would like to be able to manage sub/unsubscriptions for our Android apps on the server side (a Node process), but I'm just starting with the most basic request first - getting information about app instances. (https://developers.google.com/instance-id/reference/server#get_information_about_app_instances) Each attempt receives a 401 Unauthorized response.

The Instance ID docs linked above require the "IID_TOKEN" in the URL, and "key=YOUR_API_KEY" in the Authorization header.
For "YOUR_API_KEY" I am using the API Key given in the Firebase console (I have also tried the Android API key from Google developer console from before the project was imported into Firebase).
For "IID_TOKEN" I'm using the registration token which is returned in the Android app when Firebase registers and I send to the server.

Are these wrong?

Tom Dancer

unread,
Jan 20, 2017, 10:55:51 AM1/20/17
to Firebase Google Group
Resolved. This might be obvious to people but I guess I missed it. So in case this helps anyone, for my use case...

- YOUR_API_KEY is the Server Key from the Firebase Console (Overview->Gear icon->Project setting->CLOUD MESSAGING-> Server key)
- IID_TOKEN is the Firebase registration token of the app
Reply all
Reply to author
Forward
0 new messages