Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation ThirdPartyCloudStorage #2325

Open
usselite opened this issue May 14, 2024 · 16 comments
Open

Documentation ThirdPartyCloudStorage #2325

usselite opened this issue May 14, 2024 · 16 comments

Comments

@usselite
Copy link

Hi,

We have interest in integrating deeper within MS Teams, the ThirdPartyCloudStorage API seems applicable, however, it is kind of unclear what the requirements are in order to use it. Is this part of the Cloud Storage Partner Program? If so, or if it's not, could it be clarrified?

Referring to this:
https://github.com/OfficeDev/microsoft-teams-library-js/blob/3d3f2cc82ec1b2df5562bbad9d7a68242c8fbcf7/packages/teams-js/src/public/thirdPartyCloudStorage.ts

Thanks,

@jekloudaMSFT
Copy link
Contributor

Hi @usselite, thanks for reporting this; I'll look into improving the documentation around ThirdPartyCloudStorage. Could you tell me more about the scenario you're looking to implement with the ThirdPartyCloudStorage APIs?

@usselite
Copy link
Author

usselite commented May 14, 2024

Hi @jekloudaMSFT, I am mostly interested in the drag and drop scenario (#1903), so we can implement our own cloud solution other than Onedrive for example.

What makes it confusing, for being able to use functionalities, is it required to be enroled in the CSP program (https://developer.microsoft.com/en-us/office/cloud-storage-partner-program)? Because right now, the only information that can be found about 'third party cloud' providers, is the list here: https://techcommunity.microsoft.com/t5/microsoft-teams-blog/microsoft-teams-adds-third-party-file-integration/ba-p/80880 and it looks as these are enroled into the CSP program, but it's not clearly stated on the site that Teams is also part of the program.

Thanks,

@jekloudaMSFT
Copy link
Contributor

Hey @usselite, it looks like this API is unrelated to the Cloud Storage Partner Program. I asked the dev who worked on this for more information, and this is what they said:

When a user drags and drops files in the compose box, the files are stored in OneDrive. We can also enable the user to send files to other third-party storage providers.


##Prerequisites
Admins must configure the third-party cloud storage provider's App ID
Admin settings for file drag-drop to third-party storage - Microsoft Teams | Microsoft Learn
Note to use this "NativeFileEntryPoints" should be disabled" : Turn off Teams Native File Upload policy - Microsoft Teams | Microsoft Learn

##For Cloud Storage Providers
If you are a cloud storage provider and want to support this feature, you will use the API to handle files dragged and dropped by users so that they are uploaded to your cloud storage.

From applicationContext they will get the value of Thread id and ReplyToId.

They need to concatenate above two values to get unique id / cache id like below:
const uniqueIdForChats = replyChainIdforChats + inputthreadId;

Send this id along with the callback, and they will receive the files which were drageddroped in compose.
drag_and_drop

Note: "commandContext":"thirdParty" This will help the Third Party App to identify that their app was opened programmatically and they have to call the Teams SDK API for the dropped files.


Does this help?

@usselite
Copy link
Author

usselite commented May 17, 2024

Hi @jekloudaMSFT thanks for asking the dev!

The both links you provided redirect to "review.learn.microsoft.com", I don't think I can access those pages?

There's no public versions: https://review.learn.microsoft.com/en-us/MicrosoftTeams/admin-settings-for-file-drag-drop-to-third-party-storage?branch=pr-en-us-14488

There does seem to be a public article about turn off teams native upload policy: https://learn.microsoft.com/en-us/microsoftteams/turn-off-teams-native-file-upload-policy?branch=pr-en-us-14488, but not sure if the articles are alike?

@jekloudaMSFT
Copy link
Contributor

My apologies, it looks like those sites are only accessible internally at the moment. I've followed up asking for public documentation and will report here when I hear back

@jekloudaMSFT
Copy link
Contributor

@mahimaMSFT
Copy link
Contributor

I was oof for some time, is there anything I can help with?

@usselite
Copy link
Author

Hi @jekloudaMSFT and @mahimaMSFT,

I could use some support with how to determine the right manifest usage for this.

 "composeExtensions": [
        {
            "botId": "xxx",
            "canUpdateConfiguration": false,
            "commands": [
                {
                    "id": "Upload",
                    "description": "Drag and drop",
                    "title": "Drag and drop",
                    "type": "action",
                    "fetchTask": true,
                    "context": [
                        "thirdParty"
                    ]
                },
                {
                    "id": "settings",
                    "description": "Modify the plugin settings",
                    "title": "Settings",
                    "type": "action",
                    "fetchTask": true,
                    "context": [
                        "compose"
                    ]
                }
            ]
        }
    ],

or more like

....
{
                    "id": "Upload",
                    "description": "Drag and drop",
                    "title": "Drag and drop",
                    "type": "action",
                    "fetchTask": true,
                    "commandContext": [
                        "thirdParty"
                    ]
                }

Thanks,

@Prasad-MSFT
Copy link

The correct usage for the ThirdPartyCloudStorage in the manifest's composeExtensions section should follow the Microsoft Teams platform's guidelines. The context property is used within the commands array to specify where the command should be available.

The first example you provided seems to be correct format, where you specify the context for each command.

@usselite
Copy link
Author

Hi @jekloudaMSFT , @mahimaMSFT,

Provided with the answer from @Prasad-MSFT, we're not getting the manifest to validate. The manifest we used would be as summed above:

 "composeExtensions": [
        {
            "botId": "xxx",
            "canUpdateConfiguration": false,
            "commands": [
                {
                    "id": "Upload",
                    "description": "Drag and drop",
                    "title": "Drag and drop",
                    "type": "action",
                    "fetchTask": true,
                    "context": [
                        "thirdParty"
                    ]
                },
                {
                    "id": "settings",
                    "description": "Modify the plugin settings",
                    "title": "Settings",
                    "type": "action",
                    "fetchTask": true,
                    "context": [
                        "compose"
                    ]
                }
            ]
        }
    ],

Would it be possible to get the manifest example from you instead and possibly small code snippets to integrate it within the code?

Thanks,

@Prasad-MSFT
Copy link

Hi @usselite - Apologies! We are checking this with engineering team. We will update this thread once we get any further info. Thanks!

@usselite
Copy link
Author

usselite commented Jul 3, 2024

@Prasad-MSFT @mahimaMSFT any update?

@Prasad-MSFT
Copy link

Prasad-MSFT commented Jul 10, 2024

@usselite - We got below response from engineering team:
"Manifest file is specific to the app. We only require that upload action should be the first action on it.
Suppose if there are 2 actions that an app supports (View and Upload). It this case upload should be confirmed before View in Manifest."

This API is used for below requirement:
When a user drags and drops files in the compose box, the files are stored in OneDrive. We can also enable the user to send files to other third-party storage providers.
If you are a cloud storage provider and want to support this feature, you will use the API to handle files dragged and dropped by users so that they are uploaded to your cloud storage.

We need 2 values:

  1. Thread id (inputthreadId)
  2. ReplyToId (replyChainIdforChats)

which we need to concatenate to get unique id / cache id like below:
const uniqueIdForChats = replyChainIdforChats + inputthreadId;
Send this id along with the callback as defined in below code reference.
image

@usselite
Copy link
Author

Hi @Prasad-MSFT please provide a sample of the manifest file that we should use in order to trigger this.

@Prasad-MSFT
Copy link

Attaching a sample manifest file:

manifest 1.json

@usselite
Copy link
Author

@Prasad-MSFT for my own understanding, there's no mention of "commandContext":"thirdParty" is this correct? Your colleague @jekloudaMSFT mentioned it's needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants