title: Why always getting bad request fcm?
body: <p>I am trying to send a notification to the android client from FCM using rest API. My code is: ```</p>
  <pre><code>post_offline_message(From, To, Body) -&gt;
      K = &quot;FCM key&quot;,
      U = &quot;https://fcm.googleapis.com/fcm/send&quot;,
      P = #{
        payload =&gt; #{
          to =&gt; &lt;&lt;&quot;rid&quot;&gt;&gt;,
          priority =&gt; &lt;&lt;&quot;high&quot;&gt;&gt;,
          data =&gt; #{
            &lt;&lt;&quot;title&quot;&gt;&gt; =&gt; &lt;&lt;&quot;Some Title&quot;&gt;&gt;,
            &lt;&lt;&quot;message&quot;&gt;&gt; =&gt; &lt;&lt;&quot;Hi&quot;&gt;&gt;
          }
        }
      },
      EP = jiffy:encode(P),
      ?INFO_MSG(&quot;EP data: ~p&quot;, [EP]),
      httpc:set_options([{keep_alive_timeout, 0}]),
      {_, Resp} = httpc:request(post, {U, [{&quot;Authorization&quot;, &quot;key=&quot; ++ K}], &quot;application/json&quot;, EP}, [], []),
      ?INFO_MSG(&quot;FCM response: ~p&quot;, [Resp]).
  </code></pre>
  <pre><code>My EP data (payload) is this:
  **&lt;&lt;&quot;{\&quot;payload\&quot;:{\&quot;to\&quot;:\&quot;dOqZOggYQZG6xKVY9P4_Xi:APA91bG0kuM-o_lSf3fUaWcyiW0fVj8-L49QgzU6rWfxi3o5lMaKapkOjvvLUxm-e78XS49TVl5jjgQt6DrRKTaDK2xzg-ffm1Qe4Xx-61_Hrmr6I0cPOcGAZ9Wv7QgFFjGXtWwWEvSi\&quot;,\&quot;priority\&quot;:\&quot;high\&quot;,\&quot;data\&quot;:{\&quot;title\&quot;:\&quot;Some Title\&quot;,\&quot;message\&quot;:\&quot;Hi\&quot;}}}&quot;&gt;&gt;** 
  and response from FCM is: 
  **{{&quot;HTTP/1.1&quot;,400,&quot;Bad Request&quot;},[{&quot;cache-control&quot;,&quot;private, max-age=0&quot;},{&quot;date&quot;,&quot;Thu, 03 Sep 2020 08:57:56 GMT&quot;},{&quot;accept-ranges&quot;,&quot;none&quot;},{&quot;server&quot;,&quot;GSE&quot;},{&quot;vary&quot;,&quot;Accept-Encoding&quot;},{&quot;content-length&quot;,&quot;3&quot;},{&quot;content-type&quot;,&quot;text/plain; charset=UTF-8&quot;},{&quot;expires&quot;,&quot;Thu, 03 Sep 2020 08:57:56 GMT&quot;},{&quot;x-content-type-options&quot;,&quot;nosniff&quot;},{&quot;x-frame-options&quot;,&quot;SAMEORIGIN&quot;},{&quot;content-security-policy&quot;,&quot;frame-ancestors 'self'&quot;},{&quot;x-xss-protection&quot;,&quot;1; mode=block&quot;},{&quot;alt-svc&quot;,&quot;h3-29=\&quot;:443\&quot;; ma=2592000,h3-27=\&quot;:443\&quot;; ma=2592000,h3-T051=\&quot;:443\&quot;; ma=2592000,h3-T050=\&quot;:443\&quot;; ma=2592000,h3-Q050=\&quot;:443\&quot;; ma=2592000,h3-Q046=\&quot;:443\&quot;; ma=2592000,h3-Q043=\&quot;:443\&quot;; ma=2592000,quic=\&quot;:443\&quot;; ma=2592000; v=\&quot;46,43\&quot;&quot;}],&quot;to\n&quot;}**
  Please suggest what I am doing wrong or missing something. I am calling this method from ejabberd hook which is **offline_message_hook**.
  </code></pre>