Skip to main content
POST
/
file
/
upload-from-drive
Upload File from Google Drive
curl --request POST \
  --url https://api.royalti.io/file/upload-from-drive \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "driveLink": "https://drive.google.com/file/d/1234567890/view",
  "category": "royalty",
  "identifier": "monthly_report",
  "fileMetaData": {
    "originalname": "royalty.csv",
    "mimetype": "text/csv"
  }
}
'
{
  "success": true,
  "message": "File uploaded from Google Drive",
  "data": {
    "id": "file-uuid-123",
    "status": "pending",
    "name": "royalty.csv"
  }
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Code Examples

const response = await fetch('https://api.royalti.io/file/upload-from-drive', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "driveLink": "sample-driveLink",
    "category": "sample-category",
    "identifier": "sample-identifier",
    "fileMetaData": {
      "originalname": "sample-originalname",
      "mimetype": "sample-mimetype"
    }
  })
});

const data = await response.json();
console.log(data);

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"

Body

application/json

Google Drive shareable link or file URL

fileMetaData
object
required
category
string

File category (optional)

identifier
string

File identifier (optional)

Response

File uploaded from Google Drive

success
boolean
default:true
message
string
data
object