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 | Development
Microsoft Teams | Development
Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
Microsoft Teams | Microsoft Teams for business | Other
0 comments No comments
{count} votes

1 answer

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

Your answer

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