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

Closed
usselite opened this issue May 14, 2024 · 36 comments
Closed

Documentation ThirdPartyCloudStorage #2325

usselite opened this issue May 14, 2024 · 36 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?

@Prasad-MSFT
Copy link

Hi @usselite, apologies. We understand the concern. We are checking this with engineering team internally and will get back to you.

@usselite
Copy link
Author

@Prasad-MSFT any update?

@Wajeed-msft
Copy link
Contributor

@usselite - ThirdPartyCloudStorage is beta API which is not yet documented, we will share the details steps for you to follow in order implement this functionality soon. We will also work on updating Dev Docs to include same steps for other developers to follow.

@usselite
Copy link
Author

@Wajeed-msft Do you have a timeline for this? Because there is limited documentation right now, looks like we're missing a part only at this moment. https://learn.microsoft.com/en-us/microsoftteams/admin-settings-for-file-drag-drop-to-third-party-storage#documentation-for-developers-third-party-storage-apps

@Prasad-MSFT
Copy link

Prasad-MSFT commented Jul 29, 2024

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

Regarding doubts on: "commandContext":"thirdParty"

This value will be present in the payload of application context:
image

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.

@usselite
Copy link
Author

@Prasad-MSFT, thanks will take a look at it.

@Prasad-MSFT
Copy link

Prasad-MSFT commented Jul 29, 2024

Detailed steps on the implementation:

User drags and drops the file in teams compose box ---> it will auto open the app
(Refer prerequisites to configure your app to open programmatically)
https://learn.microsoft.com/en-us/microsoftteams/admin-settings-for-file-drag-drop-to-third-party-storage#documentation-for-developers-third-party-storage-apps

When you click on submit, in network tab (dev tools) we can see we are sending a payload with some information.
image
This payload we are getting in our app's application context (refer below code)
image
image

From above payload we will need 2 values:

  • Thread id
  • ReplyToId

We 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 as defined in below code reference.
image

@usselite
Copy link
Author

Hi @Prasad-MSFT the 1st image is not read-able (low-res).

@Prasad-MSFT
Copy link

Hi @Prasad-MSFT the 1st image is not read-able (low-res).

Updated images.

@usselite
Copy link
Author

@Prasad-MSFT would it be possible to show us the manifest you use?

@Prasad-MSFT
Copy link

Attaching a sample manifest file:

manifest 1.json

FYI @usselite

@Prasad-MSFT
Copy link

Hi @usselite, could you please share the Teams app name you own?

@usselite
Copy link
Author

Hi @Prasad-MSFT we haven't had the time to dive deeper into it so far. But it looks like the manifest you shared (31st july) is the same one from the 10th of july. With that manifest we we're not able to get the trigger going, so we're not entirely sure what we're doing wrong.

Do we need something specific in the manifest at all?

Our app name is 'Sendent', however, it's not available in the app-source due the way how our solution run by customers.

@mahimaMSFT
Copy link
Contributor

mahimaMSFT commented Aug 14, 2024

Hi,
Could you please help me to understand how is your app integrated with teams?
Are you able to open your app using the "+" icon in the compose box, and upload files from there?
I am happy to connect over a call and discuss all the doubts.

@usselite
Copy link
Author

Hi @mahimaMSFT what is the best way to connect with you to schedule a call? We're situated in the Amsterdam Timezone.

We tried the '+' icon for a manual upload, but it didn't work unfortunately.

@Prasad-MSFT
Copy link

@usselite , could you please send email to microsoftteamsdev@microsoft.com ?

@Prasad-MSFT
Copy link

Hi @usselite, i hope your issue has been resolved via the scheduled call. Please feel free to close this issue by sharing the final results of the discussion.

@usselite
Copy link
Author

usselite commented Sep 3, 2024

Hi @Prasad-MSFT the issue is still being investigated

@usselite
Copy link
Author

The issue has been solved. The problem was we'd have to use the literal app-id. This is not the ID from the manifest (or external app id). It's the id you get after your app has been uploaded to teams admin center.

Copy link
Contributor

Tell us about your experience!

Hi usselite! We have closed this issue in our system, but we would love to hear your feedback. To let us know how we did, simply use one of the following emoji icons: 👍 for resolved, 👎 for unresolved, or ❤️ for a great experience on this message. Please use the link for more detailed feedback.

Best regards,
Teams Platform

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

6 participants