Table of Contents

Getting started with TMS FNC Cloud DropBox

Prerequisites

  • TMS FNC Core installed and the runtime package added to the project.
  • TMS FNC Cloud Pack installed.
  • A Dropbox app with an app key, app secret, and a registered redirect URI.

Use the TMS cloud service key guide to locate the provider-specific registration page and credential fields: Cloud service API keys.

Add the component

  1. Drop TTMSFNCCloudDropBox onto a form (or create it in code).
  2. Set the Dropbox app credentials on Authentication (app key, secret, redirect URI).
  3. Call Connect to authenticate, then call Dropbox operations from OnConnected.

Minimal example

Set the credentials, connect, and request the account info once connected:

procedure TForm1.FormCreate(Sender: TObject);
begin
  // Credentials from your Dropbox app (https://www.dropbox.com/developers/apps).
  TMSFNCCloudDropBox1.Authentication.ClientID := 'your-dropbox-app-key';
  TMSFNCCloudDropBox1.Authentication.Secret := 'your-dropbox-app-secret';
  // Must match a redirect URI registered on the Dropbox app.
  TMSFNCCloudDropBox1.Authentication.CallBackURL := 'http://127.0.0.1:8000';

  TMSFNCCloudDropBox1.OnConnected := DropBoxConnected;
  // Opens the Dropbox consent page in the browser and exchanges the code for tokens.
  TMSFNCCloudDropBox1.Connect;
end;

procedure TForm1.DropBoxConnected(Sender: TObject);
begin
  // Tokens (including a refresh token) are now available on Authentication.
  TMSFNCCloudDropBox1.GetAccountInfo;
end;

Next steps