TutorialsUsing the GDShine REST API
apiintermediate

Using the GDShine REST API

Integrate file sharing into your own apps with API keys, endpoints, and code examples.

7 min read6 steps
1

Generate an API key

Go to API Keys in your dashboard. Click Generate New Key.

Choose permission level:

  • Read — list files, get metadata
  • Write — everything in Read, plus creating shares and files
  • Admin — full account access (be careful)

Copy the key immediately — you won't see it again. Store it securely (use environment variables, never commit to git).

2

Make your first API call

Use any HTTP client. Here's the most common test — fetch your user info:

curl https://api.gdshine.com/api/auth/me \
  -H "Authorization: Bearer YOUR_API_KEY"

You should get back a JSON response with your user ID, email, role, and quota info.

3

List your files

Fetch all files you've shared:

curl "https://api.gdshine.com/api/files?page=1&per_page=20" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response includes file IDs, names, sizes, download counts, and backup status. Use pagination (page + per_page) for large lists.

4

Create a share link

Generate an encrypted share URL programmatically:

curl -X POST https://api.gdshine.com/api/share \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"fileId": "FILE_ID_HERE"}'

Returns a new share token. Each token is unique and can be tracked or revoked independently.

5

Register a new file

Add a Google Drive file to GDShine via API:

curl -X POST https://api.gdshine.com/api/files \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://drive.google.com/file/d/.../view"}'

GDShine extracts metadata automatically and queues the file for backup.

6

Handle rate limits

Each API key has a rate limit based on the user's plan:

  • Free: 100 requests/minute
  • Pro: 500/minute
  • Contributor/Admin: 1,000/minute

If you hit the limit, the API returns 429 Too Many Requests. Implement exponential backoff — wait 1s, then 2s, then 4s, etc. up to 3 retries.

You're done!

You've completed all 6 steps. Questions? Reach out to support.