Closed nbransby closed 7 years ago
Awesome, thanks! Can you add that to the documentation too? Send a separate PR because I already merged this one.
Hey @nbransby, I'm getting an error when attempting to use setNotificationType()
:
'access-control-allow-origin': '*',
pragma: 'no-cache',
'cache-control': 'no-store',
'facebook-api-version': 'v2.8',
expires: 'Sat, 01 Jan 2000 00:00:00 GMT',
'content-type': 'text/javascript; charset=UTF-8',
'x-fb-trace-id': 'XXX',
'x-fb-rev': '2828561',
vary: 'Accept-Encoding',
'x-fb-debug': 'iXXX',
date: 'Sun, 12 Feb 2017 06:11:54 GMT',
connection: 'close' },
body: '{"error":{"message":"(#100) Invalid keys \\"notification_type\\" were found in param \\"message\\".","type":"OAuthException","code":100,"fbtrace_id":"GOYNPgzx7m7"}}',
statusCode: 400,
statusMessage: 'Bad Request' }
My usage is as follows:
new fbTemplate.Text(`Hi ${userData.first_name}, What can I help you with today?`)
.addQuickReply('Reply1', 'REPLY1')
.addQuickReply('Reply2', 'REPLY2')
.setNotificationType("NO_PUSH")
.get();
Per the API docs it looks like notification_type
needs to be a property of the root request object and the error message seems to indicate that it is being set as a property of the message
object incorrectly.
Do you see something I'm doing wrong?
@jamesandersen it's fixed by https://github.com/claudiajs/claudia-bot-builder/pull/86, we were waiting for the test for it, but I'll merge it right now and add a test later.
👍 Thanks!
Support for Facebook's notification type: https://developers.facebook.com/docs/messenger-platform/send-api-reference