Dropsite Delivery Controller
Introduction
Dropsites are one of the multiple ways to upload media into AdmiralCloud. It is a low-threshold upload.
How to upload via Dropsite
In order to upload a media item via AdmiralCloud's Dropsites, please follow this guide.
Before you start, make sure to that you have a device identifier. If you don't have one, please create one or fetch one using TBC. Set the appropriate header for X-AdmiralCloud-Device.
Step 1 – Dropsite delivery
The first step is to fetch the dropsite content using Deliver Dropsite call. The response contains a clientId and a code. Please note, that the code has a limited timespan.
Make sure to set the clientId header based on the one you obtain from the response.
Step 2 – Generate token
Just prior to the upload, and only then, you should exchange the code for the token. If the code has expired please make the Dropsite deliver call again and retrieve a fresh code. If you request the dropsite token for the first time, you can decide whether to use the real user data for email, firstname and lastname or to generate random user data. The email address will returned and should be stored in your browser. This way subsequent Dropsite uploads will be linked to the same user.
If you already have an email address stored, just send it with the generate token request and the AdmiralCloud API will identify your user and return the appropriate session.
Please note, that session tokens have a limited timespan. Make sure to request a fresh token before this one times out. Please also note, that the session will be invalidated after you make the uploadComplete call.
Before you continue, make sure to set the provided access token as bearer header.
Step 3 – Create an upload document
Use S3.createUpload call to initiate an upload. Use the response to upload your media to the given destination. Make sure to call S3.success after every uploaded item and finally, after you have uploaded all items, call S3.uploadComplete.
In order to give visual feedback to logged in users (waiting for your upload), you might want to create and update activities (see Activity Controller).
Please remember – as soon as you make the S3.uploadComplete call, your token is invalidated and you can no longer sends data to our API. Please note that it is important to send this S3.uploadComplete call – otherwise the uploaded media items will be marked as "unsuccessful upload" and be automatically deleted.