MessagingExtensionActionResponse giving serializer error in python

Moshfiqur Rahman Rony 1 Reputation point

Hi, I am developing an MS Teams app in my REST API. I am using Django Rest Framework. My bot is doing great untill I implemented
. When this function returns a
type it creates an error like below

'dict' object has no attribute 'serialize'

This is what my function look like

async def on_teams_messaging_extension_fetch_task(
        self, turn_context: TurnContext, action: MessagingExtensionAction
    ) -> MessagingExtensionActionResponse:
        print('I am on_teams_messaging_extension_fetch_task', turn_context.activity.value, action)
        # card = create_adaptive_card_editor()
        card = CardFactory.adaptive_card(
                    "actions": [{"type": "Action.Submit", "title": "Close",}],
                    "body": [
                            "text": "You have been signed out.",
                            "type": "TextBlock",
                            "weight": "bolder",
                    "type": "AdaptiveCard",
                    "version": "1.0",
        task_info = TaskModuleTaskInfo(
            card=card, height=450, title="Task Module Fetch Example", width=500
        continue_response = TaskModuleContinueResponse(value=task_info)
        return MessagingExtensionActionResponse(task=continue_response)

Am I doing anything wrong? You can use this as a sample project.

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,033 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
2,829 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Tanmay Sarkar 1 Reputation point

    This is a sample code for using adaptive Card in Task module using Python, try this.

    0 comments No comments