The Dropbox JavaScript SDK returns the API call results asynchronously, not in the return value of the method call.
You can see an example of how to set up the callbacks for the result and error, using then
and catch
, respectively, here:
https://github.com/dropbox/dropbox-sdk-js/blob/master/examples/javascript/basic/index.html#L54
So, for example, your code should look something like this:
var ACCESS_TOKEN = "access_token";
var filePath = "/example/example.doc";
var dbx = new Dropbox({ accessToken: ACCESS_TOKEN });
dbx.sharingCreateSharedLinkWithSettings({path: filePath})
.then(function(response) {
console.log(response);
})
.catch(function(error) {
console.log(error);
});