Forum Discussion
OAuth client for API-based message extension
Thank you Sayali-MSFT ! What should be specified in the App manifest then? Developer portal generates the following configuration which is invalid for 1.17 schema. I was not able to find any intructions for this in the provided articles. Thanks!
To ensure your OAuth client for API-based message extension is valid for the 1.17 schema, you need to update your app manifest accordingly. Here are the key elements you should include in your manifest:
-
Schema Reference: Ensure your manifest references the correct schema URL:
{ "$schema": "https://developer.microsoft.com/json-schemas/teams/v1.17/MicrosoftTeams.schema.json", "manifestVersion": "1.17", ... }
-
Authorization Property: Add the
authorization
property undercomposeExtensions
to define the type of authentication for your application:{ "composeExtensions": [ { "authorization": { "authType": "OAuth", "oauth2": { "clientId": "YOUR_CLIENT_ID", "scopes": ["SCOPE1", "SCOPE2"], "redirectUri": "YOUR_REDIRECT_URI" } }, ... } ], ... }
-
Bot ID: Ensure you have the
botId
specified undercomposeExtensions
:{ "composeExtensions": [ { "botId": "YOUR_BOT_ID", ... } ], ... }
-
Commands: Define the commands your message extension will support:
{ "composeExtensions": [ { "commands": [ { "id": "exampleCmd1", "title": "Example Command", "type": "query", "context": ["compose", "commandBox"], "description": "Command Description; e.g., Search on the web", "initialRun": true, "fetchTask": false, "parameters": [ { "name": "keyword", "title": "Search keywords", "inputType": "choiceset", "description": "Enter the keywords to search for", "value": "Initial value for the parameter", "choices": [ { "title": "Title of the choice", "value": "Value of the choice" } ] } ] } ], ... } ], ... }
For more detailed guidelines, you can refer to the App Manifest Reference
and the API-based Message Extension Guidelines