Hey I haven't been able to find any information this but what I'm trying to achieve is using an express/node rest API that would use Dropbox JS SDK to send files to different applications mainly PHP, is this possible? I've been toying around with it and not sure I'm on the best path
API code
router.post('/', async (req, res) => {
var dbx = new Dropbox({ accessToken: '<key>', fetch: fetch });
dbx.filesDownload({path: "/large_vid.mp4"})
.then(function (resp) {
let data = resp[Object.keys(resp)[11]];
res.status(201).send(data);
})
.catch(function (errs) {
console.log(errs);
res.status(203).send(errs);
});
});
module.exports = router;
PHP code
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($postData))
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = base64(curl_exec($ch));