crisboarna / fb-messenger-bot-api

NodeJS Facebook Messenger API for bots to send messages and setup events to Facebook.
https://www.npmjs.com/package/fb-messenger-bot-api
MIT License
34 stars 17 forks source link

OAuthException on quickreply #108

Open themakunga opened 3 years ago

themakunga commented 3 years ago

Hi, I'm currently using the api to integrate a custom made fulfillment for Dialogflow, when I try to send quick replies to the user I got the next error message:

2021-08-26T14:46:37.151Z ? workplaceHook: {
2021-08-26T14:46:37.151Z ? workplaceHook:   error: {
2021-08-26T14:46:37.151Z ? workplaceHook:     message: 'An unknown error has occurred.',
2021-08-26T14:46:37.151Z ? workplaceHook:     type: 'OAuthException',
2021-08-26T14:46:37.151Z ? workplaceHook:     code: 1,
2021-08-26T14:46:37.151Z ? workplaceHook:     fbtrace_id: 'Ar79mEkigYjU16TIat8NNva'
2021-08-26T14:46:37.151Z ? workplaceHook:   }
2021-08-26T14:46:37.151Z ? workplaceHook: }

I've even try to convert the response using the Interface IQuickReply, but the outcome is the same

const replies: IQuickReply[] = resp
                    .quickReplies!.quickReplies as unknown as IQuickReply[];
                  const rss = await messagingClient
                    .sendQuickReplyMessage(
                      user.uid,
                      resp.quickReplies!.title!,
                      replies,
                    );
                  console.log(rss);

with only text I have no problems!

ifritzler commented 1 year ago

migth be the best if you provide a mock example about the data pass to the replies parameter. all seems to be ok testing locally with the integration and unit tests by default.