How can I post the card in different channel?

aya 5 Reputation points
2023-12-06T19:26:05.84+00:00

I want to post the card that contains text of message to different channel.

How can I do it? I used teams toolkit to use messaging extension.

Currently I used below code inside of handleTeamsMessagingExtensionSubmitAction to post the card but it doesn't work. error is Error posting card: RestError: Authorization has been denied for this request.

      const newConversation = await context.adapter.createConversationAsync(
          credentialsFactory.appId,
          channelId, // Use the extracted channel ID
          conversationReference.serviceUrl,
          "https://graph.microsoft.com/.default", 
          conversationParameters, // Pass the conversation parameters
          async (newContext) => {
            await newContext.sendActivity(message);
          }
        );
Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,952 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.
3,203 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ChetanSharmamsft 1,031 Reputation points Microsoft Vendor
    2024-03-13T10:17:14.46+00:00
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.