Jadir Hervias
- Visit the following URL and get your credentials.json file: https://developers.google.com/drive/api/v3/quickstart/nodejs
# Copy the credentials.json into the .google directory in order to use the Google Drive API
# Copy the env variables from the example
cat .env.example > .env
# Install dependencies
npm i
# Run in development mode
npm run dev
# Run in production mode
npm run start
-
Go to the next URL:
-
Step 1: Select the following scopes:
-
Step 2: Exchange authorization code for tokens
You got the access_token and refresh_token
- API endpoint in default port 3000
Upload a .ppt or .pptx file
-
Method: POST
-
Authorization Header: Bearer {access_token}
-
Form-data:
key/name: slide
value: .ppt or .pptx file
{
"data": {
"url": "https://docs.google.com/presentation/d/1z18xkeC-nFCHR0twpt4znTfHPsDWmgkFZMCrzQKh9AE/preview?ouid=110848733261583573509",
"data": {
"kind": "drive#file",
"id": "1z18xkeC-nFCHR0twpt4znTfHPsDWmgkFZMCrzQKh9AE",
"name": "slidePPT9999",
"mimeType": "application/vnd.google-apps.presentation"
}
},
"message": "File uploaded succesfully",
"status": 200
}