paint-brush
Facebook API — The URL couldn’t be validated.by@xameeramir
251 reads

Facebook API — The URL couldn’t be validated.

by Zameer AnsariDecember 24th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Was trying to <a href="https://developers.facebook.com/docs/messenger-platform/getting-started/app-setup/#webhook_setup" target="_blank">setup FB messenger webhook</a> with a strong verify token. Somewhat like this: <code class="markup--code markup--p-code">o\/ERviEE\/vt0|&lt;E|\|</code>

Company Mentioned

Mention Thumbnail
featured image - Facebook API — The URL couldn’t be validated.
Zameer Ansari HackerNoon profile picture

credit: https://my.kualo.com/uk/knowledgebasekualo.php?kbcat=0&article=120

Was trying to setup FB messenger webhook with a strong verify token. Somewhat like this: o\/ERviEE\/vt0|<E|\|

The same is been verified in the code:

req.query['hub.verify_token'] === 'o\/ERviEE\/vt0|<E|\|'

However, the value received from FB is: o\\/ERviEE\\/vt0|<E|\\|

This is strange. There seems to be no document reference as such which talks about how Facebook escapes special characters for verify tokens or alike. Not sure if this happens for other entities as well.

Conclusion: need to be a little bit cautious when using special characters for verify tokens.

Originally published at xameeramir.github.io.