Table of Contents

Getting started with TMS FNC Cloud Box

Prerequisites

  • TMS FNC Core installed and the runtime package added to the project.
  • TMS FNC Cloud Pack installed.
  • A Box developer app with a client ID, client secret, and a registered redirect URI.

Add the component

  1. Drop TTMSFNCCloudBox onto a form (or create it in code).
  2. Set the Box app credentials on Authentication (client ID, secret, redirect URI).
  3. Call Connect to authenticate, then call Box 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 Box developer app (https://developer.box.com/).
  TMSFNCCloudBox1.Authentication.ClientID := 'your-box-client-id';
  TMSFNCCloudBox1.Authentication.Secret := 'your-box-client-secret';
  // Must match a redirect URI registered on the Box app.
  TMSFNCCloudBox1.Authentication.CallBackURL := 'http://127.0.0.1:8000';

  TMSFNCCloudBox1.OnConnected := BoxConnected;
  // Opens the Box consent page in the browser and exchanges the code for tokens.
  TMSFNCCloudBox1.Connect;
end;

procedure TForm1.BoxConnected(Sender: TObject);
begin
  // Tokens are now available on Authentication; safe to call Box operations.
  TMSFNCCloudBox1.GetAccountInfo;
end;

Next steps