Connect to Dropbox's API using AWS Lambda.
Create an app from 'https://www.dropbox.com/developers/apps'
Set Redirect URI as 'http://localhost:9999/dropbox/callback'
Get ClientId , ClientSecret , CallbackUrl and paste it into /config/default.yml
npm install
npm run dev
Go To `http://localhost:9999/dropbox/'
Authenticate and Authorize
Copy the Access Token
Make the final request to dropbox api (To generate a temprory link of a file)
curl -X POST \
https://api.dropboxapi.com/2/files/get_temporary_link \
-H 'Authorization: Bearer <token> ' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-d '{
"path" : "/temp.rtf"
}'
P.S :- add your access token in Authorization header after Bearer eg :- [Bearer aklfbakbjkasbcbvkcjba] and make sure there exists the temp.rtf file in your dropbox root directory
default_test.yml
npm run test
Follow the same procedure for deploying it on AWS just make the necessary changes in the following files
config/stage.yml
config/stage_test.yml
test/test.js (link to stage_test.yml)
Latest commit b2f54ec on Sep 24, 2017