How do you make manifest.json for Microsoft Teams bot? - json

I followed the online tutorial for constructing a bot in Visual Studio and deploying it Azure, and so far that seems to have worked. Now I want to add this bot to Microsoft Teams via the "Sideload a bot or tab" method. The online tutorial has NO explanation for what I need to do so I need some help. Here is the manifest.json I was currently trying to upload in a zip folder. Please help, I don't know how this process works.
{
"$schema": "https://statics.teams.microsoft.com/sdk/v1.0/manifest/MicrosoftTeams.schema.json",
"manifestVersion": "1.0",
"version": "1.0.0",
"id": "a5db14e6-8adf-445b-a0aa-daadc5e155eb",
"packageName": "com.testbot20170525114049",
"developer": {
"name": "Megan",
"websiteUrl": "https://website.com/",
"privacyUrl": "https://website.com/privacy",
"termsOfUseUrl": "https://website.com/app-tos"
},
"name": {
"short": "Botty"
}
"description": {
"short": "A sample bot to test the bot upload process"
}
"bots": [
{
"botId": "a5db14e6-8adf-445b-a0aa-daadc5e155eb",
"needsChannelSelector": "true",
"scopes": [ "team", "personal" ]
}
]
}

Enable Public Developer Preview. The v1.0 manifest is fully supported in that mode, and while it may work in the public version, for now I'd switch to developer preview mode.
Make sure your manifest follows the v1.0 format. While your schema is close, there are a few required fields missing:
description.full
icons.outline
icons.color (note currently there is a 2k limit on file size)
accentColor
Zip the manifest and icons into a sideloadable package. Make sure the manifest.json is at the top level.
Follow the sideload instructions.

Related

How to fix: "No help topic for 'preview'" error when using gactions?

I've been trying to follow a tutorial on building your first action for google home:
https://medium.com/google-cloud/building-your-first-action-for-google-home-in-30-minutes-ec6c65b7bd32
I was able to deploy my application to the google cloud, but once I try to deploy my action.json test file I receive an error message that says: "No help topic for 'preview'."
./gactions preview --action_package action.json --invocation_name "three doors" --preview_mins 1234
No help topic for 'preview'
I've followed the suggestions from:
https://stackoverflow.com/questions/46591266/golang-runtime-panic-when-using-gaction-on-linux-to-update-google-home-assistant
But updating gactions didn't work either as there were no new updates.
I'm running ubuntu-18.04.2 Linux 4.18.0-15-generic x86_64
{
"versionLabel": "1.0",
"agentInfo": {
"languageCode": "en-US",
"projectId": "three-doors-3124",
"voiceName": "male_1"
},
"actions": [
{
"description": "Launch intent",
"initialTrigger": {
"intent": "assistant.intent.action.MAIN"
},
"httpExecution": {
"url": "https://us-central1-three-doors-3124.cloudfunctions.net/three_doors"
}
}
],
"locale": "en"
}
I'm not sure how to fix this problem, so any help would be much appreciated.
Thanks
That post is from 2017, and a lot of the development environment and setup has changed since then. I'd recommend going to the codelabs as they will provide good up to date starting guides.

Access files located in the WIP folder of BIM360 Design (old C4R)

We have a requirement from one of our clients to access the project files that are stored in the BIM360 Design (old Collaboration for Revit - C4R). I can not find any information in the developer pages of the Forge APIs that points to this location. I assume such an API is not part of Forge, but we were wondering if there is any other API that can provide those files.
The exact requirements are:
Constantly monitor for changes on the files located there.
When changes occur, retrieve and backup all those files to a local machine.
The question is, how, if possible, can we access the project files located at the BIM360 Design cloud?
UPDATE (10/04/2018)
We have found these commands - specifically PublishModel and GetPublishModelJob. This does something, we can at the very least prompt the publication on demand, without the need for Revit. It is not clear to me when the items:autodesk.bim360:C4RModel pseudo-file is created. On top of that, the API does not appear to be able to receive a prefered output folder, which makes it really cumbersome to work for the intended purpose of backing up the information inside BIM360 Design.
UPDATE (25/04/2018)
We have tried using both commands (PublishJob and GetPublishModelJob). We have impersonated a Project Admin (via the x-user-id) but Forge is returning a 401 error (which is not even documented). The following (with a redacted documentID) is what we have tried:
{
"jsonapi": {
"version": "1.0"
},
"data": {
"type": "commands",
"attributes": {
"extension": {
"type": "commands:autodesk.bim360:C4RModelGetPublishJob",
"version": "1.0.0"
}
},
"relationships": {
"resources": {
"data": [ { "type": "items", "id": "<document_id>" } ]
}
}
}
}
And this is Forge's response:
{
"jsonapi": {
"version": "1.0"
},
"errors": [
{
"id": "a4547153-1fd4-4710-b0d1-a7184d9e7e22",
"status": "401",
"code": "C4R",
"detail": "Failed to get publish model job"
}
]
}
Any thoughts?
After discussing with #tfrascaroli in Forge Help channel, we found the root cause of this error is caused by the incorrect value of x-user-id, so he didn't have the right permission to push the latest version of the C4R model to BIM360 docs.
{
"jsonapi": {
"version": "1.0"
},
"errors": [
{
"id": "a4547153-1fd4-4710-b0d1-a7184d9e7e22",
"status": "401",
"code": "C4R",
"detail": "Failed to get publish model job"
}
]
}
The x-user-id is not a GUID and not the id we saw in the response of GET users or GET users/:user_id, it should be the value of the uid. After replacing the x-user-id value by the uid, the error doesn't show up again.
[
{
"id": "a75e8769-621e-40b6-a524-0cffdd2f784e", //!<<< We didn't use it for `x-user-id`
"account_id": "9dbb160e-b904-458b-bc5c-ed184687592d",
"status": "active",
"role": "account_admin",
"company_id": "28e4e819-8ab2-432c-b3fb-3a94b53a91cd",
"company_name": "Autodesk",
"last_sign_in": "2016-04-05T07:27:20.858Z",
"email": "john.smith#mail.com",
"name": "John Smith",
"nickname": "Johnny",
"first_name": "John",
"last_name": "Smith",
"uid": "L9EBJKCGCXBB", //!<<<<< Here is the value for the x-user-id
"image_url": "http://static-dc.autodesk.net/etc/designs/v201412151200/autodesk/adsk-design/images/autodesk_header_logo_140x23.png",
"address_line_1": "The Fifth Avenue",
"address_line_2": "#301",
"city": "New York",
"postal_code": "10011",
"state_or_province": "New York",
"country": "United States",
"phone": "(634)329-2353",
"company": "Autodesk",
"job_title": "Software Developer",
"industry": "IT",
"about_me": "Nothing here",
"created_at": "2015-06-26T14:47:39.458Z",
"updated_at": "2016-04-07T07:15:29.261Z"
}
]
Do you have an access right to the workshared Revit file? Publish command is to publish workshared central model in the cloud to Docs. To use it, you need an access to Revit model in the central in the cloud. Forge Publish command does the same thing as publish command in Revit desktop. You need the same access right. To use cloud workshared feature, first you need to have Design license assigned to you, then you also need to be a member a Revit project. Being invited to Docs is not enough.
(As C4R/Design was merged to Docs recently, this C4R specific license part was intentionally kept the same as previous licensing. We also have Team for earlier versions. It makes it a bit complicated. I hope it will be easier as we move forward in future.)

Angular6 ServiceWorker dont cache all files

I generated a clean Angular6 Project and use ng add #angular/pwa i get this ngsw-config.json:
{
"index": "/index.html",
"assetGroups": [
{
"name": "app",
"installMode": "prefetch",
"resources": {
"files": [
"/favicon.ico",
"/index.html",
"/*.css",
"/*.js"
]
}
},
{
"name": "assets",
"installMode": "lazy",
"updateMode": "prefetch",
"resources": {
"files": [
"/assets/**"
]
}
}
]
}
There is the whole assets folder marked for "Service Worker Caching" But the Sad reality show that this isnt real:
The 3 Graphic files i use ( header-bg.jpg, list-border-red.svg & list-border-green.svg ) Are marked as "from ServiceWorker" But when i create a App on my Smartphone, and disconnect the Internet connection and open the App, is only header-bg.jpg available. but list-border-red.svg & list-border-green.svg are not available offline.
Also shows the graphic thas 2 favicons are loaded from "Disc Cache" and one from the ftp... The files are also in the assets folder, why they are not cached fro mServiceWorker? Is the ServiceWorker stuff maybe bugged in Chrome?
The App is allready Online and can be found here: https://expense-calculator.com/ Just open and make your own tests if you need this to reproduce my problem.
Your service worker code looks good and is registered perfectly to serve the files in offline just as you have expected it to work. I've checked in Chrome with Airplane mode on. All files including .svg files loaded from cache.
Please retry.

Static Tab with placeholder values not displayed

I am currently getting into Microsoft Team Apps and am trying to create a very simple tool.
All it should be is a static tab, that when visited embeds a certain website, that's given the groupId as a parameter. This is the format, that I have in mind for the contentUrl: https://foo.bar?groupId=\{groupId\}
The app consists only of two images, that are PNGs in 20x20px (transparent) and 96x96px (with background color) and the manifest (version 1.2).
The manifest contains all required fields:
$schema, manifestVersion, version, id, packageName, developer {name, websiteUrl, privacyUrl, termsOfUseUrl}, icons {color, outline}, description {short, full}, accentColor, permissions, validDomains, staticTabs [{entityId, name, contentUrl, scopes}]
An Id for the app has been generated at apps.dev.microsoft.com.
The upload of the custom app as zip file causes no error and I can see the app in the list of the installed applications. If I switch to a channel I can't see the tab which should be there without being explicitly added because it's a static tab. Adding it manually isn't possible because it's not shown in the list of "addable apps".
I tried some of the example apps from GitHub, but they seem outdated and at least partly can't be even read (Error while reading manifest.json).
Is this sufficient information to help me?
Edit: (anonymized manifest.json)
{
"$schema":
"https://statics.teams.microsoft.com/sdk/v1.2/manifest/MicrosoftTeams.schema.json",
"manifestVersion": "1.2",
"version": "1.0.0",
"id": "12345678-abcd-efgh-1234-123456789012",
"packageName": "com.microsoft.teams.bar",
"developer": {
"name": "Foo Corp",
"websiteUrl": "https://foo.com",
"privacyUrl": "https://foo.com/privacy",
"termsOfUseUrl": "https://foo.com/termsofuse"
},
"icons": {
"color": "src/images/waldo-96x96.png",
"outline": "src/images/waldo-20x20.png"
},
"name": {
"short": "bar",
"full": "bar"
},
"description": {
"short": "Opens baz and does qux.",
"full": "Opens baz and does qux."
},
"accentColor": "#FFFFFF",
"permissions": ["identity", "messageTeamMembers"],
"validDomains": ["*.baz.com", "*.foo.com"],
"staticTabs": [
{
"entityId": "tabId",
"name": "example tab",
"contentUrl":
"https://foo.com/?teamId={teamId}&teamName={teamName}&channelId={channelId}&channelName={channelName}&locale={locale}&theme={theme}&entityId={entityId}&subEntityId={subEntityId}&upn={upn}&tid={tid}&groupId={groupId}&theme={theme}&isFullScreen={isFullScreen}",
"scopes": ["personal"]
}
]
}
I could see two issues in your manifest code:
Invalid GUID: 12345678-abcd-efgh-1234-123456789012 is not valid GUID.
Icons must be included in the package and referenced via relative paths in the manifest.
ex. waldo-96x96.png - Please place them inside zip file.
Please feel free to use Teams App Studio to create the manifest file. You can also use the existing form the sample code.

Using chrome.runtime.sendmessage to communicate from a webpage to a packaged app

I'm trying to communicate from a web page to a packaged app. The idea is to have the web page read a number from a serial device. Because I want to access the serial device, I need a packaged app and can't use an extension. This is pretty similar to Keep Chrome Packaged App running in background? and it seems that Chrome documentation says this is possible.
How can I execute the chrome.runtime.sendMessage from a regular web page? When I do so, I get *Uncaught TypeError: Cannot read property 'sendMessage' of undefined. My simple function is:
function doFunction(){
chrome.runtime.sendMessage(editorExtensionId, {openUrlInEditor: url},
function(response) {
if (!response.success)
handleError(url);
});
}
My packaged app loads and can access the serial ports. But my suspicion is the manifest isn't "enabling" the chrome.runtime of the regular webpage. Manifest.json:
{
"name": "Hello World!",
"description": "My first Chrome App.",
"version": "0.1",
"app": {
"background": {
"scripts": ["background.js"]
}
},
"icons": { "16": "calculator-16.png", "128": "calculator-128.png" },
"permissions": [
"serial",
"*://localhost/*"
],
"externally_connectable": {
"matches": [
"*://localhost/*"]
}
}
Maybe it's the ://localhost/ which I'm using for testing. But Chrome does not complain.
Any ideas out there? Thanks in advance.
Xan's comment did the trick.
While Chrome did not complain about *://localhost/*, it did not work. Chrome did complain about other combinations such as file://localhost/.
I added foo.com to host file and then served up my web page through a web server, and it worked! I can communicate from my web page to my packaged app.
Note that browsing to file://www.foo.com/hostpage.html did not work. But browing to http://www.foo.com:3000/hostpage.html did. (I'm using Rails, hence the 3000 port).
Morale of the story: When testing locally, you need to add an entry with a bogus second level domain to your host file.
Here's my manifest.json:
{
"name": "RFID Tag Reader",
"description": "Reads RFID Tags connected via USB reader",
"version": "0.0.0.1",
"app": {
"background": {
"scripts": ["background.js"]
}
},
"icons": {
"16": "rfid-16.png",
"128": "rfid-128.png"
},
"permissions": [
"serial",
"*://www.foo.com/*",
"*://arealsite.net/*"
],
"externally_connectable": {
"matches": [
"*://www.foo.com/*",
"*://arealsite.net/*"
]
}
}
Adding "*://localhost/*" to externally_connectable worked for me.