GCM 401 Unauthorized - Where to get the "right" Server Key?
<p>I already tried so many solutions there to solve it.</p>

<p>Have a lot of <strong>unsolved questions here</strong> (on stackoverflow) finding for same solution.</p>

<p>When I call:</p>

<pre><code>curl --header "Authorization: key=MY_KEY" --header "Content-Type: application/json" https://android.googleapis.com/gcm/send -d "{\"registration_ids\":[\"THE_ID\"]}"
</code></pre>

<p>I'm got: </p>

<pre><code>&lt;HTML&gt;
&lt;HEAD&gt;
&lt;TITLE&gt;Unauthorized&lt;/TITLE&gt;
&lt;/HEAD&gt;
&lt;BODY BGCOLOR="#FFFFFF" TEXT="#000000"&gt;
&lt;H1&gt;Unauthorized&lt;/H1&gt;
&lt;H2&gt;Error 401&lt;/H2&gt;
&lt;/BODY&gt;
&lt;/HTML&gt;
</code></pre>

<p>The problem is: every solution here on stackoverflow says "Use the server key, not the browser key". On the current console, when I create a server key, it showme some options and I'm not sure if it right. </p>

<p>Course, I already created some of then. It <strong>creates a json file to download</strong>, with some data on it... <strong>but I really don't know WHERE ARE the SERVER KEY</strong>.</p>

<p>What key should I use and <strong>where to get it exactly</strong> ?</p>

<hr>

<p>The "create credential" option, where I choose the third one:</p>

<p><a href="https://i.stack.imgur.com/WtJZa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WtJZa.png" alt="The &quot;create credential&quot; option, where I choose the third one"></a></p>

<p>The two options to create a server key:</p>

<p><a href="https://i.stack.imgur.com/hYIzx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hYIzx.png" alt="enter image description here"></a></p>