Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
MangoApps + Box
Technical Integration Guide
PROPRIETARY AND CONFIDENTIAL ©2016 MangoApps, Inc.
Table of Contents 1. Box Integration Overview .............................................................................................................................................. 3
2. Authentication Model .................................................................................................................................................... 4
3. Enterprise Box Configuration ......................................................................................................................................... 6
4. MangoApps Configuration ............................................................................................................................................. 7
5. 2-‐Way Information Sync Model ..................................................................................................................................... 9
6. Functional Integration ................................................................................................................................................. 11
7. Box Viewer Integration ................................................................................................................................................ 14
8. Box Search Integration ................................................................................................................................................ 15
9. Permission Management ............................................................................................................................................. 16
10. Event Monitoring ....................................................................................................................................................... 17
PROPRIETARY AND CONFIDENTIAL ©2016 MangoApps, Inc.
1. Box Integration Overview
Box provides great way for an enterprise to store, manage and collaborate content with simplicity and high security. With MangoApps and Box integration, enterprises can use advance features of MangoApps Team Collaboration and Social intranet platform with Box as their storage for content.
You can work in MangoApps for sharing and collaborating on files stored in Box. Or you can work directly in Box. Either way, all files & folders are synchronised across the two platforms. It really is a best-of-both worlds solution: secure, enterprise- class content sharing and comprehensive, anytime/anywhere collaboration for you and your team.
MangoApps provides easy way to collaborate existing Box files by simply moving them into MangoApps folder. Additionally any content that gets uploaded to MangoApps folder in Box is instantly available for collaboration and sharing in the MangoApps portal.
PROPRIETARY AND CONFIDENTIAL ©2016 MangoApps, Inc.
2. Authentication Model MangoApps uses OAuth 2 to authenticate with Box for all users. MangoApps keeps record of every user's auth token and refresh token. These tokens are securely encrypted and stored in MangoApps database. Each of these tokens are automatically refreshed by the system. Once logged in, users always remain authenticated with Box and don’t need to re-authenticate (until explicitly revoked from box end) make it super easy to sharing and view files in MangoApps.
2.1 Box admin authentication Here is a flow diagram, which explains how Box admin authentication is done. The diagram also explains the uses of the admin authentication token in MangoApps.
PROPRIETARY AND CONFIDENTIAL ©2016 MangoApps, Inc.
2.2 Box user authentication
Here is a flow diagram that explains how Box user authentication is done. This diagram also explains how the every user authentication & authorization with box happens.
PROPRIETARY AND CONFIDENTIAL ©2016 MangoApps, Inc.
3. Enterprise Box Configuration
In order to setup MangoApps-Box integration following are the pre-requisites 1. A valid “Enterprise” box account is required – See here for more details on it - https://www.box.com/pricing/ 2. A Box Admin account requires the following specific permissions enabled.
PROPRIETARY AND CONFIDENTIAL ©2016 MangoApps, Inc.
4. MangoApps Configuration
4.1. Configuration by the Admin
To start using Box as a storage, MangoApps Admin needs to configure Box on MangoApps admin portal. A Box Admin or co-Admin account is required for this step. The configuration is done based on the authentication explained in point 3. Here are the steps to configure Box for a MangoApps admin 1. Go to admin portal 2. Select Modules > Files > File Storage 3. Select Box option and configure
Why is the admin account configuration required?
1. Content migration: All files and folders in MangoApps are under a folder structure eg.
Team files, Network Drive & My Drive etc. So when the Box account is configured as storage, MangoApps uses the admin account configuration to create this folder structure in Box.
2. Reverse sync of Box events into MangoApps: MangoApps provides two way sync of any action or event taken on a MangoApps files and folders inside Box. This requires timely fetching of Box enterprise events into MangoApps and keeping the 2 systems in sync. These events are fetched using this admin account.
PROPRIETARY AND CONFIDENTIAL ©2016 MangoApps, Inc.
4.2. Configuration by a User
A MangoApps user must have a seat in the enterprise Box account. Every MangoApps user is mapped one to one with a Box user with the same email ID. A user needs to authenticate & authorize with Box from MangoApps to access the files from box. Here are the steps a user follows to authenticate & authorize with box from MangoApps:
1. Click on top right user profile icon 2. Click on 'Login to Box' button
Why does every user need to authenticate/authorize with Box in MangoApps? 1. To give the user access to the files & folders with appropriate permissions 2. To track when a file/folder is accessed, viewed, downloaded or shared.
PROPRIETARY AND CONFIDENTIAL ©2016 MangoApps, Inc.
5. 2-‐Way Information Sync Model
Any changes made to files & folders in MangoApps are reflected in box and any changes made in Box are reflected back in MangoApps in close to real time. Teams (groups, projects, departments, opportunities) in MangoApps become folders and groups in Box. Team membership in MangoApps is kept in sync with Box group membership. The 2 systems are kept in sync – across version history and tracking. This deep integration keeps all files and their permissions up-to-date, regardless of what device the user is using or the business application they are in (i.e., MangoApps or Box). This means that you can access all your box files from any device running MangoApps as per the permissions you have on them on Box. Here is a flow diagram of how a file upload action from any of the MangoApps clients (web, mobile and desktops) is reflected in both Box and MangoApps.
PROPRIETARY AND CONFIDENTIAL ©2016 MangoApps, Inc.
And here is a flow diagram of how a file uploaded in Box is synced back to MangoApps.
PROPRIETARY AND CONFIDENTIAL ©2016 MangoApps, Inc.
6. Functional Integration MangoApps supports variety of operations on a File or Folder. As mentioned above, all these operations are synced 2 way between MangoApps and Box. MangoApps uses Box Content APIs to perform operations on files and folders. Following section captures the APIs calls from MangoApps
6.1 Folder Flows 6.1.1 Create Folder
curl https://api.box.com/2.0/folders \ -H "Authorization: Bearer ACCESS_TOKEN" \ -d '{"name":"New Folder", "parent": {"id": "0"}}' \ -X POST
6.1.2 Edit Folder
curl https://api.box.com/2.0/folders/FOLDER_ID \ -H "Authorization: Bearer ACCESS_TOKEN" \ -d '{"name":"New Folder Name!"}' \ -X PUT
6.1.3 Delete Folder
curl https://api.box.com/2.0/folders/FOLDER_ID?recursive=true \ -H "Authorization: Bearer ACCESS_TOKEN" \ -X DELETE
6.1.4 Rename Folder
curl https://api.box.com/2.0/folders/FOLDER_ID \ -H "Authorization: Bearer ACCESS_TOKEN" \ -d '{"name":"New Folder Name!"}' \ -X PUT
6.1.5 Move Folder
PROPRIETARY AND CONFIDENTIAL ©2016 MangoApps, Inc.
curl https://api.box.com/2.0/folders/FOLDER_ID \ -H "Authorization: Bearer ACCESS_TOKEN" \ -d '{"parent": {"id": "0"}}' \ -X PUT
6.1.6 Share a Folder
curl https://api.box.com/2.0/collaborations/COLLAB_ID \ -H "Authorization: Bearer ACCESS_TOKEN" \ -d '{"role": "viewer"} ' \ -X PUT
6.2 File Flows
6.2.1 Upload New File
curl https://upload.box.com/api/2.0/files/content \ -H "Authorization: Bearer ACCESS_TOKEN" -X POST \ -F attributes='{"name":"tigers.jpeg", "parent":{"id":"11446498"}}' \ -F [email protected]
6.2.2 Upload New Version
curl https://upload.box.com/api/2.0/files/FILE_ID/content \ -H "Authorization: Bearer ACCESS_TOKEN" \ -H "If-Match: ETAG_OF_ORIGINAL" \ -F filename=@file_name
6.2.3 Rename File
curl https://upload.box.com/api/2.0/files/FILE_ID/content \ -H "Authorization: Bearer ACCESS_TOKEN" \ -H "If-Match: ETAG_OF_ORIGINAL" \ -F filename=@file_name
6.2.4 Move File
curl https://upload.box.com/api/2.0/files/FILE_ID/content \ -H "Authorization: Bearer ACCESS_TOKEN" \ -d '{"parent": {"id": "0"}}' \ -X PUT
PROPRIETARY AND CONFIDENTIAL ©2016 MangoApps, Inc.
6.2.5 Delete File
curl https://api.box.com/2.0/files/FILE_ID \ -H "Authorization: Bearer ACCESS_TOKEN" \ -H "If-Match: a_unique_value" \ -X DELETE
6.2.6 Share a File curl https://api.box.com/2.0/collaborations/COLLAB_ID \ -H "Authorization: Bearer ACCESS_TOKEN" \ -d '{"role": "viewer"} ' \ -X PUT
6.3 Group Flows 6.3.1 Add Member to a Group
curl https://api.box.com/2.0/group_memberships \ -H "Authorization: Bearer ACCESS_TOKEN" \ -d '{ "user": { "id": "1992432"}, "group": { "id": "1992432" } }' \ -X POST 6.3.2 Remove Member from a Group
curl https://api.box.com/2.0/group_memberships/GROUP_MEMBERSHIP_ID \ -H "Authorization: Bearer ACCESS_TOKEN" \ -X DELETE
PROPRIETARY AND CONFIDENTIAL ©2016 MangoApps, Inc.
7. Box Viewer Integration
To provide an integrated experience and use power of Box, all the files opened for viewing in MangoApps web, desktop or mobile interface use the Box viewer. Here is how file viewing works in MangoApps.
PROPRIETARY AND CONFIDENTIAL ©2016 MangoApps, Inc.
8. Box Search Integration
MangoApps provides full content search using the Box search APIs to it’s users. When you search content in Box, you are running a search across not only the folder and file names, but also the text within a document based on your access & permissions Here is a flow diagram, which shows how file search works in MangoApps
PROPRIETARY AND CONFIDENTIAL ©2016 MangoApps, Inc.
9. Permission Management
In MangoApps, teams i.e., groups, projects, departments and opportunities are workspaces where multiple users can collaborate.
Every team has a set of members. Every member has a role - team admin, network user or a guest user being the 3 primary roles. File permissions can be granted based on the roles. For e.g., Owner permission for admins, editor permission for rest of the team members.
A folder is created for every team. eg. 'Sales' is a project. For this project a folder will be created in /Project Files/Sales/. When the Box storage is configured, similar folder structure is created inside Box.
How does Team permissions work with Box integration?
For 'Sales' project in MangoApps following two groups are created in Box. mangoapps-mycompany-sales-all-admins – This has all Project admin users. This group can have Owner Permission. mangoapps-mycompany -sales-all-members - This has all non Project admin users. A folder 'Sales' will have above two collaborator groups. This is how MangoApps Team members are associated with appropriate permissions in a Team.
Here is the screenshot of collaborators of Sales Project folder is Box. Arrows point to two Box groups created by MangoApps.
PROPRIETARY AND CONFIDENTIAL ©2016 MangoApps, Inc.
10. Event Monitoring
Event monitoring is the mechanism built in MangoApps to fetch latest updates from Box. These events are fetched from Box and then filtered as per MangoApps folder structure. After the filtering, each event is reflected in MangoApps DB as a new entry (eg. new file upload) or an update of an existing entry (e.g. new version of an existing file) MangoApps requests the following events from box: UPLOAD – This is generated when a user uploads a new file. This is used by MangoApps for creating new file entry, updating the metadata and access tracking. DOWNLOAD – This is generated when a user downloads a file. This is used by MangoApps for access tracking. EDIT – This is generated when a user edits a file. This is used by MangoApps for updating the metadata and access tracking. LOCK – This is generated when a user locks a file. This is used by MangoApps for updating the metadata and access tracking. UNLOCK – This is generated when a user unlocks a file. This is used by MangoApps for updating the metadata and access tracking. MOVE – This is generated when a file gets moved to a new location. This is used by MangoApps for updating the metadata and access tracking. PREVIEW – This is generated when a user views a file. This is used by MangoApps for access tracking. RENAME – This is generated when a user renames a file. This is used by MangoApps for updating the metadata and access tracking. COPY – This is generated when a user copies a file. This is used by MangoApps for access tracking. DELETE – This is generated when a user deletes a file. This is used by MangoApps for updating the records and access tracking.
PROPRIETARY AND CONFIDENTIAL ©2016 MangoApps, Inc.
UNDELETE – This is generated when a file is restored from trash. This is used by MangoApps for updating the metadata and access tracking. COLLABORATION_ROLE_CHANGE – This is generated when user's role has been changed in collaboration. This is used by MangoApps for updating the permissions for the specific user. COLLABORATION_REMOVE – This is generated when user or a group has been removed from collaboration. This is used by MangoApps for updating the permissions for the specific folder. COLLABORATION_INVITE – This is generated when user or a group has been added for collaboration. This is used by MangoApps for updating the permissions for the specific folder. SHARE – This is generated when a user shares a file. This is used by MangoApps for updating the metadata and access tracking. UNSHARE –This is generated when a user unshared a file. This is used by MangoApps for updating the permissions for the specific folder. Here is a flow diagram of how Box events monitoring works in MangoApps.
PROPRIETARY AND CONFIDENTIAL ©2016 MangoApps, Inc.