Sample code for 30+ languages & platforms
Delphi DLL

Frame.io - Get Team ID

See more Frame.io Examples

Get your team ID.

Chilkat Delphi DLL Downloads

Delphi DLL
uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Http, StringBuilder, JsonObject;

...

procedure TForm1.Button1Click(Sender: TObject);
var
success: Boolean;
http: HCkHttp;
sbResponseBody: HCkStringBuilder;
jResp: HCkJsonObject;
respStatusCode: Integer;
image_64: PWideChar;
project_count: Integer;
default_color: PWideChar;
deleted_at: PWideChar;
image_256: PWideChar;
background_color: PWideChar;
font_color: PWideChar;
email_branding_type: PWideChar;
email_brandingAccent_color: PWideChar;
email_brandingBackground_color: PWideChar;
email_brandingDefault_accent_color: PWideChar;
email_brandingDefault_background_color: PWideChar;
email_brandingId: PWideChar;
email_brandingImage: PWideChar;
email_brandingUpload_url: PWideChar;
bio: PWideChar;
updated_at: PWideChar;
link: PWideChar;
default_font_color: PWideChar;
image_128: PWideChar;
dark_theme: Boolean;
disable_sbwm_internally: Boolean;
account_id: PWideChar;
name: PWideChar;
location: PWideChar;
solo: Boolean;
watermark: PWideChar;
file_count: Integer;
duration: Integer;
image_32: PWideChar;
team_image: PWideChar;
default_background_color: PWideChar;
resource_id: PWideChar;
color: PWideChar;
frames: Integer;
storage: Integer;
collaborator_count: Integer;
creator_id: PWideChar;
default_session_watermark_template_id: PWideChar;
archived_storage: Integer;
slack_webhook: PWideChar;
upload_url: PWideChar;
member_count: Integer;
v_type: PWideChar;
asset_lifecycle_policy: PWideChar;
member_limit: PWideChar;
id: PWideChar;
storage_limit: PWideChar;
access: PWideChar;
inserted_at: PWideChar;
folder_count: Integer;

begin
success := False;

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

http := CkHttp_Create();

// Implements the following CURL command:

// curl \
//     -H "Authorization: Bearer <FRAME_IO_DEV_TOKEN>" \
//     https://api.frame.io/v2/accounts/<ACCOUNT_ID>/teams

// Use the following online tool to generate HTTP code from a CURL command
// Convert a cURL Command to HTTP Source Code

// Adds the "Authorization: Bearer <FRAME_IO_DEV_TOKEN>" header.
CkHttp_putAuthToken(http,'<FRAME_IO_DEV_TOKEN>');

CkHttp_SetUrlVar(http,'account_id','b1cd046b-a3bf-4ef8-81a6-0afd74ecc455');

sbResponseBody := CkStringBuilder_Create();
success := CkHttp_QuickGetSb(http,'https://api.frame.io/v2/accounts/{$account_id}/teams',sbResponseBody);
if (success = False) then
  begin
    Memo1.Lines.Add(CkHttp__lastErrorText(http));
    Exit;
  end;

jResp := CkJsonObject_Create();
CkJsonObject_LoadSb(jResp,sbResponseBody);
CkJsonObject_putEmitCompact(jResp,False);

Memo1.Lines.Add('Response Body:');
Memo1.Lines.Add(CkJsonObject__emit(jResp));

respStatusCode := CkHttp_getLastStatus(http);
Memo1.Lines.Add('Response Status Code = ' + IntToStr(respStatusCode));
if (respStatusCode >= 400) then
  begin
    Memo1.Lines.Add('Response Header:');
    Memo1.Lines.Add(CkHttp__lastHeader(http));
    Memo1.Lines.Add('Failed.');
    Exit;
  end;

// Sample JSON response:
// (Sample code for parsing the JSON response is shown below)

// {
//   "image_64": null,
//   "project_count": 1,
//   "default_color": "5B53FF",
//   "deleted_at": null,
//   "image_256": null,
//   "background_color": null,
//   "session_watermark_templates": [
//   ],
//   "font_color": null,
//   "email_branding": {
//     "_type": "email_branding",
//     "accent_color": null,
//     "background_color": null,
//     "default_accent_color": "5B53FF",
//     "default_background_color": "F7F8FA",
//     "id": "71cddf30-cdd6-4db9-9f1f-f119c3a6c36d",
//     "image": null,
//     "upload_url": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/email_branding/71c...508199e26038"
//   },
//   "bio": null,
//   "updated_at": "2020-08-18T02:20:14.432078Z",
//   "link": null,
//   "default_font_color": "20222B",
//   "image_128": null,
//   "dark_theme": false,
//   "disable_sbwm_internally": false,
//   "account_id": "b1cd046b-a3bf-4ef8-81a6-0afd74ecc455",
//   "name": "Chilkat's Team",
//   "location": null,
//   "solo": false,
//   "watermark": null,
//   "file_count": 0,
//   "duration": 0,
//   "image_32": null,
//   "team_image": null,
//   "default_background_color": "FFFFFF",
//   "resource_id": "8e32b1ae-86db-4164-83b1-81b37b2e7499",
//   "color": null,
//   "frames": 0,
//   "storage": 0,
//   "collaborator_count": 1,
//   "creator_id": "34b4f98a-7cc9-4159-8f46-c7c3d837fc6f",
//   "default_session_watermark_template_id": null,
//   "archived_storage": 0,
//   "slack_webhook": null,
//   "upload_url": "https://frameio-uploads-production.s3-accelerate.amazonaws.com/teams/95a5fb..a86b2663",
//   "member_count": 1,
//   "_type": "team",
//   "asset_lifecycle_policy": null,
//   "member_limit": null,
//   "id": "95a5fbad-688d-46fc-aef1-2f011dd76c10",
//   "storage_limit": null,
//   "access": "private",
//   "inserted_at": "2020-08-18T02:20:13.171582Z",
//   "folder_count": 0
// }

// Sample code for parsing the JSON response...
// Use the following online tool to generate parsing code from sample JSON:
// Generate Parsing Code from JSON

image_64 := CkJsonObject__stringOf(jResp,'image_64');
project_count := CkJsonObject_IntOf(jResp,'project_count');
default_color := CkJsonObject__stringOf(jResp,'default_color');
deleted_at := CkJsonObject__stringOf(jResp,'deleted_at');
image_256 := CkJsonObject__stringOf(jResp,'image_256');
background_color := CkJsonObject__stringOf(jResp,'background_color');
font_color := CkJsonObject__stringOf(jResp,'font_color');
email_branding_type := CkJsonObject__stringOf(jResp,'email_branding._type');
email_brandingAccent_color := CkJsonObject__stringOf(jResp,'email_branding.accent_color');
email_brandingBackground_color := CkJsonObject__stringOf(jResp,'email_branding.background_color');
email_brandingDefault_accent_color := CkJsonObject__stringOf(jResp,'email_branding.default_accent_color');
email_brandingDefault_background_color := CkJsonObject__stringOf(jResp,'email_branding.default_background_color');
email_brandingId := CkJsonObject__stringOf(jResp,'email_branding.id');
email_brandingImage := CkJsonObject__stringOf(jResp,'email_branding.image');
email_brandingUpload_url := CkJsonObject__stringOf(jResp,'email_branding.upload_url');
bio := CkJsonObject__stringOf(jResp,'bio');
updated_at := CkJsonObject__stringOf(jResp,'updated_at');
link := CkJsonObject__stringOf(jResp,'link');
default_font_color := CkJsonObject__stringOf(jResp,'default_font_color');
image_128 := CkJsonObject__stringOf(jResp,'image_128');
dark_theme := CkJsonObject_BoolOf(jResp,'dark_theme');
disable_sbwm_internally := CkJsonObject_BoolOf(jResp,'disable_sbwm_internally');
account_id := CkJsonObject__stringOf(jResp,'account_id');
name := CkJsonObject__stringOf(jResp,'name');
location := CkJsonObject__stringOf(jResp,'location');
solo := CkJsonObject_BoolOf(jResp,'solo');
watermark := CkJsonObject__stringOf(jResp,'watermark');
file_count := CkJsonObject_IntOf(jResp,'file_count');
duration := CkJsonObject_IntOf(jResp,'duration');
image_32 := CkJsonObject__stringOf(jResp,'image_32');
team_image := CkJsonObject__stringOf(jResp,'team_image');
default_background_color := CkJsonObject__stringOf(jResp,'default_background_color');
resource_id := CkJsonObject__stringOf(jResp,'resource_id');
color := CkJsonObject__stringOf(jResp,'color');
frames := CkJsonObject_IntOf(jResp,'frames');
storage := CkJsonObject_IntOf(jResp,'storage');
collaborator_count := CkJsonObject_IntOf(jResp,'collaborator_count');
creator_id := CkJsonObject__stringOf(jResp,'creator_id');
default_session_watermark_template_id := CkJsonObject__stringOf(jResp,'default_session_watermark_template_id');
archived_storage := CkJsonObject_IntOf(jResp,'archived_storage');
slack_webhook := CkJsonObject__stringOf(jResp,'slack_webhook');
upload_url := CkJsonObject__stringOf(jResp,'upload_url');
member_count := CkJsonObject_IntOf(jResp,'member_count');
v_type := CkJsonObject__stringOf(jResp,'_type');
asset_lifecycle_policy := CkJsonObject__stringOf(jResp,'asset_lifecycle_policy');
member_limit := CkJsonObject__stringOf(jResp,'member_limit');
id := CkJsonObject__stringOf(jResp,'id');
storage_limit := CkJsonObject__stringOf(jResp,'storage_limit');
access := CkJsonObject__stringOf(jResp,'access');
inserted_at := CkJsonObject__stringOf(jResp,'inserted_at');
folder_count := CkJsonObject_IntOf(jResp,'folder_count');

CkHttp_Dispose(http);
CkStringBuilder_Dispose(sbResponseBody);
CkJsonObject_Dispose(jResp);

end;