You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

NJ-Gonzo's avatar
NJ-Gonzo
Explorer | Level 3
2 years ago

Embedder opens a blank page with Error: appkey must be provided

Im trying to open a popup window with an embedded Dropbox folder when a user hits a button. When I hit the button, it opens a blank popup. When I turn on the Developer > Javascript console (in safa...
  • Здравко's avatar
    Здравко
    2 years ago

    NJ-Gonzo wrote:

    ... but I need a way to embed the dropbox folder on the page after they log in.

    ...


    Hm.. All good, but what you're doing in code posted in OP doesn't meet "embed the dropbox folder on the page"! To be able embed something (your folder) somewhere (on any page including yours), you need to select place in the target page and embed there, not to open new page and try "embed" (if could be said so). There are 2 ways and which one is better depends on where you get your folder link (server side or client side). If you received the link on server side, it becomes easy - just put on the place where your folder should appear "a" tag with link put there. I.e. something like:

    <script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="xxxxxxxxxxxxxxx"></script>
    <a href="[@field:Digital_File_link]" class="dropbox-embed" data-height="800px" data-width="1200px"></a>

    That's enough. 😉 The Dropbox' script will take care to replace the "a" node to content of the mentioned link ([@field:Digital_File_link]) automated.

    If you're receiving link in dynamic way (after page load), then you have to use 'Dropbox.embed' when the link becomes available (cause you cannot embed it in page in advance as shown above). You still have to denote a place where your folder will appear (or create such in dynamic way). After the link is ready, you have to pass a reference to desired element (not a window!!!) to 'Dropbox.embed'. I.e. something like:

    <script type="text/javascript" src="https://www.dropbox.com/static/api/2/dropins.js" id="dropboxjs" data-app-key="xxxxxxxxxxxxxxx"></script>​
    <div id="dropboxContainer" style="width: 1200px;height: 800px;"></div>
    ...
    var element = document.getElementById("dropboxContainer");
    var options = {link: LinkID, folder: {view: "list", headerSize: "normal"}};
    Dropbox.embed(options, element);

    Hope it's a bit more clear now. 😉

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

5,910 PostsLatest Activity: 4 days ago
333 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!