Forum Discussion
SatBhat
Feb 11, 2024Copper Contributor
Message extension based on API throwing "Unable to reach app. Please try again."
Hi, I have built a new message extension based on OpenAPI spec using Teams tool kit. I then launch it in dev for testing (F5). I can see the app and invoke it but when I give input parameter it t...
ChetanSharma-msft
Microsoft
Feb 12, 2024Hello SatBhat - Please find below comments on your queries:
1) Regarding NA/NA => We are getting this because of the configuration done in the "previewCardTemplate" like below and we are not getting top level values in the result of API call:
Even if we are getting NA/NA in search result, if you select and post it in the Teams, you will be able to see the actual results.
You may need to update the logic and map the data if we will be able to get those values:
"previewCardTemplate": {
"title": "${if(name, name, 'N/A')}",
"subtitle": "${if(opentools_url, opentools_url, 'N/A')}"
}
2) Please use same 3.0.1 version rather than 3.1.0. Also, I am also using same version and getting proper results:
3) Your zip package should contain all of below files:
Please find below JSON file:
{
"$schema": "https://developer.microsoft.com/json-schemas/teams/vDevPreview/MicrosoftTeams.schema.json",
"manifestVersion": "devPreview",
"version": "1.0.0",
"id": "55048865-a475-46c3-b91d-649c10f0ff1a",
"packageName": "com.microsoft.teams.extension",
"developer": {
"name": "Teams App, Inc.",
"websiteUrl": "https://www.example.com",
"privacyUrl": "https://www.example.com/termofuse",
"termsOfUseUrl": "https://www.example.com/privacy"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "api-medev",
"full": "Full name for api-me"
},
"description": {
"short": "OpenTools Plugin",
"full": "A plugin that allows the user to find the most appropriate AI tools for their use cases, with their pricing information."
},
"accentColor": "#FFFFFF",
"composeExtensions": [
{
"composeExtensionType": "apiBased",
"apiSpecificationFile": "apiSpecificationFiles/openapi.yaml",
"commands": [
{
"context": [
"compose"
],
"type": "query",
"title": "Search for AI Tools",
"id": "searchTools",
"parameters": [
{
"name": "search",
"title": "Search",
"description": "Used to search for AI tools by their category based on the keywords. For example, ?search=\"tool to create music\" will give tools"
}
],
"description": "",
"apiResponseRenderingTemplateFile": "responseTemplates/searchTools.json"
}
]
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": []
}SatBhat
Feb 13, 2024Copper Contributor
Thank you ChetanSharma-msft for your help with this. It is now working for me. Once the demo version worked I could amend my code to align with demo version and make it work.
I had path name in the URL (for example - https://gptplugin.opentools.ai/tools instead of just https://gptplugin.opentools.ai) which is why I was getting Unable to reach error with my messaging extension. Once I removed this it started working.
Thanks once again 🙂
I had path name in the URL (for example - https://gptplugin.opentools.ai/tools instead of just https://gptplugin.opentools.ai) which is why I was getting Unable to reach error with my messaging extension. Once I removed this it started working.
Thanks once again 🙂