Announcements
postActivity
invoke
Here is the code I’m using:
directLine.postActivity({ type: 'invoke', name: 'message/submitAction', value: { actionName: 'feedback', actionValue: { feedback: { feedbackText: feedbackText || defaultFeedbackText }, reaction: reaction }, activityId: activityId }, from: { id: user.employeeId, name: user.userName } }).subscribe( id => console.log('Feedback sent, activityId:', id), error => console.error('Error sending feedback:', error) );
The bot successfully receives and processes the feedback
Data (feedback text, reaction, etc.) is correctly stored
The subscribe callback does not always trigger an error
subscribe
However, in the browser Network tab, the request consistently returns:
502 Bad Gateway
Since the bot processes the request successfully, I would expect an HTTP 200 OK instead of 502
200 OK
502
Ideally, no error should appear in the Network tab
I do NOT have access to the bot backend code (it is managed / wrapped by another team or service)
I can only make changes on the frontend
Is this a known behavior of Direct Line when using invoke activities without an explicit response from the bot?
Is there any way from the frontend to prevent or suppress the 502 response?
Would switching from invoke to message be a recommended workaround in such cases?
message
Is there any configuration in Direct Line that can avoid this behavior?
The issue seems related to missing or improper invokeResponse from the bot
invokeResponse
Functionality is not affected, but the 502 response is confusing and undesirable in production
Any insights or recommended best practices would be greatly appreciated.
The 502 error occurs as expected because an 'invoke' action requires an invokeResponse from the bot; if it's missing, Direct Line returns a 502 error.
Solution: Update the type from 'invoke' to 'event'. Since events are fire-and-forget, the bot doesn't need to respond, and you won't encounter a 502 error. The bot will still receive the data, and no backend changes are necessary.
Thank you for the update.
Just to clarify, reactions and comments are processed differently. Reactions (messageReaction activity) are managed through onReactionsAdded, while comments are not a standard Direct Line activity type.
To collect custom feedback (both reactions and comments): You can use an Adaptive Card with Action.Submit (instead of invoke), including thumbs-up/down options and a text field for comments. Then, handle the submitted data in your bot's onMessage handler. This approach avoids the 502 error and allows you to manage the feedback process directly.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Valantis 633
Vish WR 301
Haque 219