title: How to fix HTTP-Status 401 (Unauthorized) on bot-connector when calling the facebook-messenger webhook?
body: <p>After setting up a bot-connector (SAP Conversational AI: <a href="https://github.com/SAPConversationalAI/bot-connector" rel="nofollow noreferrer">https://github.com/SAPConversationalAI/bot-connector</a>), creating a channel for the fb-messenger and configuring a webhook in the fb-app i constantly get http-status 401 (unauthorized) in my bot-connector log when sending a message from my fb-messenger.</p>
  
  <p>Here is what i've done so far: (i fallowed this guide: <a href="https://github.com/SAPConversationalAI/bot-connector/wiki/Channel---Messenger" rel="nofollow noreferrer">https://github.com/SAPConversationalAI/bot-connector/wiki/Channel---Messenger</a>)</p>
  
  <ul>
  <li><p>deployed bot-connector to google cloud as app engine service to get the [bot-connector url]</p></li>
  <li><p>created bot-connector:</p>
  
  <ul>
  <li>POST on [bot-connector url]/v1/connectors with body:</li>
  </ul>
  
  <pre><code>{"url":[bot-connector endpoint url]}
  </code></pre>
  
  <ul>
  <li>POST-response:</li>
  </ul>
  
  <pre><code>{
     "results": {
         "id": [connector id],
         "url": [bot-connector endpoint url],
         "isTyping": true,
         "conversations": [],
         "channels": []
     },
     "message": "Connector successfully created"
  }
  </code></pre></li>
  <li><p>created channel for fb-messenger:</p>
  
  <ul>
  <li>POST on [bot-connector url]/v1/connectors/[connector id]/channels with body: </li>
  </ul>
  
  <pre><code>{
      "slug":"channel-messenger-srtbot-dev",
      "type":"messenger",
      "token":[fb-app secret],
      "apiKey":[fb-app api-key],
      "isActivated":true
  }
  </code></pre>
  
  <ul>
  <li>POST response:</li>
  </ul>
  
  <pre><code>{
     "results": {
         "id": [connector id],
         "updatedAt": "2019-01-22T15:03:29.569Z",
         "createdAt": "2019-01-22T15:03:29.569Z",
         "webhook": "/v1/webhook/[channel id]",
         "slug": [name of my channel],
         "type": "messenger",
         "token": [fb-app secret],
         "apiKey": [fb-app api-key],
         "connector": [connector id],
         "locales": [],
         "openingType": "never",
         "hasGetStarted": false,
         "forwardConversationStart": false,
         "isActivated": true,
         "isErrored": false,
         "webhookToken": [fb webhook token]
     },
     "message": "Channel successfully created"
  }
  </code></pre></li>
  <li><p>configured fb-messenger-webhook: (after completing the config i get the http-status 200 in the bot-connector log)</p>
  
  <ul>
  <li>callback-url: [bot-connector url]/v1/webhook/[channel id]</li>
  <li>token: [fb webhook token]</li>
  </ul></li>
  <li><p>subscribed webhook to my fb-page</p></li>
  <li><p>sent a message in my fb-messenger</p></li>
  </ul>
  
  <p><strong>Expected results:</strong></p>
  
  <ul>
  <li>after i send a message in the fb-messenger: 
  
  <ul>
  <li>http-status 200 in the bot-connector log</li>
  <li>messages gets forwarded to [bot-connector endpoint url]</li>
  <li>bot responds to the message (i get an answer in the fb-messenger)</li>
  </ul></li>
  </ul>
  
  <p><strong>Actual results:</strong></p>
  
  <ul>
  <li>after i send a messag in the fb-messenger: 
  
  <ul>
  <li>http-status 401 (unauthorized) in the bot-connector log (approximately every 60 seconds after the first fb-messenger message)</li>
  <li>nothing else happens</li>
  <li>i get no answer in the fb-messenger</li>
  </ul></li>
  </ul>