Start by including filespin.js just before the closing body
tag in your HTML.
<script type="text/javascript"
src="<<JS_HOST>>/embed/dist/filespin.min.js"></script>
Then, initialize Connector with Service Token. For obtaining a ServiceToken, see below Get Service Token section.
FileSpin.initConnector({
serviceToken: "INSERT_YOUR_SERVICE_TOKEN",
});
Please visit the Developer Playground to try out and learn more about FileSpin Web Connector
How to get the ServiceToken
serviceToken
is a short-lived token that must be retrieved using a API call to FileSpin.io Service. Call the API by supplying your API_KEY
and scope=READ_ASSET
. cURL example is shown below:-
curl -X "GET" \
"<<API_HOST>>/api/v1/authentication/service_token?scope=READ_ASSET" \
-H "X-FileSpin-Api-Key:API_KEY"
The following code sample shows how to use ServiceToken to initialize the connector.
FileSpin.initConnector({
serviceToken: "INSERT_YOUR_SERVICE_TOKEN",
});