Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katydorjee/9bb4a6fb4ee46ffe981c4220e7c3efca to your computer and use it in GitHub Desktop.
Save katydorjee/9bb4a6fb4ee46ffe981c4220e7c3efca to your computer and use it in GitHub Desktop.
Dropbox - SFMC CloudPage Consume content from Dropbox
<h1 style="text-align: center;">Debug mode: ON 🟢</h1><br>
<script runat='server'>
Platform.Load('Core','1');
try{
</script>
%%=TreatAsContent(HTTPGet('https://dl.dropbox.com/s/dropbox_file_Id/fileName.html'))=%%
<script runat='server'>
}catch (ex){
Write(Stringify(ex));
}
</script>
@katydorjee
Copy link
Author

There has been an update in the Dropbox shared URL pattern. The new pattern includes a security key in the query string, which also needs to be added to the Ampscript, as demonstrated below.

URL: https://www.dropbox.com/scl/fi/dropbox_file_Id/fileName.html?rlkey=keyInQueryString&dl=0

Sample code:
%%=TreatAsContent(HTTPGet('https://dl.dropbox.com/s/dropbox_file_Id/fileName.html?dl=0&rlkey=keyInQueryString'))=%%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment