-
Notifications
You must be signed in to change notification settings - Fork 181
Gold File Api
MM Gold is a storage API used for server-side exports and sharing. Physically, it consists of two components:
- Amazon S3 file storage
- HTTP(S) API to obtain security tokens for the file storage
There are several JavaScript objects available in the MindMup source code that wrap the workflows and APIs presented here.
- GoldApi class wraps the HTTP(S) api into a convenient JavaScript object
- GoldLicenseManager is a utility that GoldApi uses to store and retrieve the account license
- S3Api wraps the Amazon S3 response formats and polling into a utility class
- The LayoutExport class wraps the file export workflow (polling etc)
Please note that although the HTTP interface is ready to be used as a public API, the JavaScript object might change in the future without notice, so use the JS object just as an example (or write good tests for your code to catch any potential unexpected changes). All the objects are well tested with unit tests so check those out for example usage. For how to link them, see the main config file
There are two HTTP endpoints you can use for your code
http://gold-staging.mindmup.com
To order exports from the service, you should:
- Call the HTTPS api to get a file upload token and result polling URLs
- Send the file to S3 using the upload token (note that some export types require a layout, some require the map file)
- Poll the result and error URLs periodically until one of them resolves with a file
- Present or send the file from the result URL to the users in case of success, or report an error