I'm trying to list the folder structure of my Dropbox account through the following code in Vue:
<script>
export default {
data() {
return {
accessToken:
"XXXX",
};
},
methods: {
dropbox() {
return new Dropbox.Dropbox({
accessToken: this.accessToken,
});
},
getFolderStructure(){
this.dropbox().filesListFolder({path: ''}).then(response => {
console.log(response.result.entries)
})
.catch(error => {
console.error(error);
})
}
},
computed: {
},
mounted() {
this.getFolderStructure()
},
};
</script>
But this returns the following error in the console:
POST https://api.dropboxapi.com/2/files/list_folder 400
DropboxResponseError: Response failed with a 400 code
I have double checked that the token has permissions for this and I've regenerated the token several times after double checking. I've also entered http://localhost:8081that is the URL I'm currently developing locally in the list of Redirect URIs in the app settings on Dropbox, but I'm still getting this message.
What could be causing this?