Sample code for 30+ languages & platforms
Unicode C

Frame.io - Get Team ID

See more Frame.io Examples

Get your team ID.

Chilkat Unicode C Downloads

Unicode C
#include <C_CkHttpW.h>
#include <C_CkStringBuilderW.h>
#include <C_CkJsonObjectW.h>

void ChilkatSample(void)
    {
    BOOL success;
    HCkHttpW http;
    HCkStringBuilderW sbResponseBody;
    HCkJsonObjectW jResp;
    int respStatusCode;
    const wchar_t *image_64;
    int project_count;
    const wchar_t *default_color;
    const wchar_t *deleted_at;
    const wchar_t *image_256;
    const wchar_t *background_color;
    const wchar_t *font_color;
    const wchar_t *email_branding_type;
    const wchar_t *email_brandingAccent_color;
    const wchar_t *email_brandingBackground_color;
    const wchar_t *email_brandingDefault_accent_color;
    const wchar_t *email_brandingDefault_background_color;
    const wchar_t *email_brandingId;
    const wchar_t *email_brandingImage;
    const wchar_t *email_brandingUpload_url;
    const wchar_t *bio;
    const wchar_t *updated_at;
    const wchar_t *link;
    const wchar_t *default_font_color;
    const wchar_t *image_128;
    BOOL dark_theme;
    BOOL disable_sbwm_internally;
    const wchar_t *account_id;
    const wchar_t *name;
    const wchar_t *location;
    BOOL solo;
    const wchar_t *watermark;
    int file_count;
    int duration;
    const wchar_t *image_32;
    const wchar_t *team_image;
    const wchar_t *default_background_color;
    const wchar_t *resource_id;
    const wchar_t *color;
    int frames;
    int storage;
    int collaborator_count;
    const wchar_t *creator_id;
    const wchar_t *default_session_watermark_template_id;
    int archived_storage;
    const wchar_t *slack_webhook;
    const wchar_t *upload_url;
    int member_count;
    const wchar_t *v_type;
    const wchar_t *asset_lifecycle_policy;
    const wchar_t *member_limit;
    const wchar_t *id;
    const wchar_t *storage_limit;
    const wchar_t *access;
    const wchar_t *inserted_at;
    int folder_count;

    success = FALSE;

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

    http = CkHttpW_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.
    CkHttpW_putAuthToken(http,L"<FRAME_IO_DEV_TOKEN>");

    CkHttpW_SetUrlVar(http,L"account_id",L"b1cd046b-a3bf-4ef8-81a6-0afd74ecc455");

    sbResponseBody = CkStringBuilderW_Create();
    success = CkHttpW_QuickGetSb(http,L"https://api.frame.io/v2/accounts/{$account_id}/teams",sbResponseBody);
    if (success == FALSE) {
        wprintf(L"%s\n",CkHttpW_lastErrorText(http));
        CkHttpW_Dispose(http);
        CkStringBuilderW_Dispose(sbResponseBody);
        return;
    }

    jResp = CkJsonObjectW_Create();
    CkJsonObjectW_LoadSb(jResp,sbResponseBody);
    CkJsonObjectW_putEmitCompact(jResp,FALSE);

    wprintf(L"Response Body:\n");
    wprintf(L"%s\n",CkJsonObjectW_emit(jResp));

    respStatusCode = CkHttpW_getLastStatus(http);
    wprintf(L"Response Status Code = %d\n",respStatusCode);
    if (respStatusCode >= 400) {
        wprintf(L"Response Header:\n");
        wprintf(L"%s\n",CkHttpW_lastHeader(http));
        wprintf(L"Failed.\n");
        CkHttpW_Dispose(http);
        CkStringBuilderW_Dispose(sbResponseBody);
        CkJsonObjectW_Dispose(jResp);
        return;
    }

    // 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

    // Chilkat functions returning "const char *" return a pointer to temporary internal memory owned and managed by Chilkat.
    // See this example explaining how this memory should be used: const char * functions.

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


    CkHttpW_Dispose(http);
    CkStringBuilderW_Dispose(sbResponseBody);
    CkJsonObjectW_Dispose(jResp);

    }