I’m developing a custom Teams app for the meeting side panel and trying to use "shareAppContentToStage," but it throws an error: {"errorCode": 1000, "message": "App doesn't have sufficient permission to use this API"}
.
This is my function to share content to stage:
const shareSpecificPart = () => {
microsoftTeams.app.initialize().then(() => {
const appContentUrl = "https://www.bing.com/";
microsoftTeams.meeting.shareAppContentToStage((err, result) => {
if (result) {
// handle success
}
if (err) {
// handle error
console.error(err)
}
}, appContentUrl);
});
};
This is my mainifest.json file
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.19/MicrosoftTeams.schema.json",
"manifestVersion": "1.19",
"version": "1.0.0",
"id": "${{TEAMS_APP_ID}}",
"developer": {
"name": "Teams App, Inc.",
"websiteUrl": "${{TAB_ENDPOINT}}",
"privacyUrl": "${{TAB_ENDPOINT}}/index.html#/privacy",
"termsOfUseUrl": "${{TAB_ENDPOINT}}/index.html#/termsofuse"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "Teams App ${{APP_NAME_SUFFIX}}",
"full": "Full name for Teams App"
},
"description": {
"short": "Short description",
"full": "Full description"
},
"accentColor": "#FFFFFF",
"bots": [],
"composeExtensions": [],
"configurableTabs": [
{
"configurationUrl": "${{TAB_ENDPOINT}}/config",
"canUpdateConfiguration": true,
"scopes": [
"team",
"groupChat"
],
"context": [
"meetingChatTab",
"meetingDetailsTab",
"meetingStage",
"meetingSidePanel",
"channelTab"
],
"meetingSurfaces": [
"sidePanel",
"stage"
]
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"${{TAB_HOSTNAME}}",
"drive.google.com",
"${{BACKEND_API_URL}}",
"https://www.bing.com/"
],
"webApplicationInfo": {
"id": "${{AAD_APP_CLIENT_ID}}",
"resource": "api://${{TAB_DOMAIN}}/${{AAD_APP_CLIENT_ID}}"
},
"authorization": {
"permissions": {
"resourceSpecific": [
{
"name": "MeetingStage.Write.Chat",
"type": "Delegated"
},
{
"name": "MeetingStage.Write.All",
"type": "Delegated"
},
{
"name": "ChannelMeetingStage.Write.Group",
"type": "Delegated"
},
{
"name": "OnlineMeeting.ReadWrite.Chat",
"type": "Delegated"
},
{
"name": "LiveShareSession.ReadWrite.Chat",
"type": "Delegated"
},
{
"name": "LiveShareSession.ReadWrite.Group",
"type": "Delegated"
},
{
"name": "OnlineMeeting.ReadWrite",
"type": "Delegated"
},
{
"name": "MeetingStage.Write.Group",
"type": "Delegated"
}
]
}
}
}