とりあえず動いた喜びとメモ帳書きとして
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>Dropbox Test</title>
<script src="https://unpkg.com/dropbox/dist/Dropbox-sdk.min.js"></script>
</head>
<body>
<h1>DropBox Test</h1>
<script>
let accessToken = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
let dbx = new Dropbox.Dropbox({accessToken: accessToken});
dbx.usersGetCurrentAccount()
.then(function (response) {
console.log(JSON.stringify(response, null, 4));
})
.catch(function (error) {
console.error(error);
});
let dir_path = "/document"
dbx.filesListFolder({path: dir_path})
.then(function (response) {
console.log(JSON.stringify(response, null, 4));
})
.catch(function (error) {
console.error("error " + error);
});
</script>
</body>
</html>
参考
知識ゼロだけど、Dropbox APIを使用したい
https://qiita.com/Ella_Engelhardt/items/c33f08b6b427eab8b310