Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(C) Frame.io - Get Team IDGet your team ID. For more information, see https://docs.frame.io/docs/root-asset-ids
#include <C_CkHttp.h> #include <C_CkStringBuilder.h> #include <C_CkJsonObject.h> void ChilkatSample(void) { HCkHttp http; BOOL success; HCkStringBuilder sbResponseBody; HCkJsonObject jResp; int respStatusCode; const char *image_64; int project_count; const char *default_color; const char *deleted_at; const char *image_256; const char *background_color; const char *font_color; const char *email_branding_type; const char *email_brandingAccent_color; const char *email_brandingBackground_color; const char *email_brandingDefault_accent_color; const char *email_brandingDefault_background_color; const char *email_brandingId; const char *email_brandingImage; const char *email_brandingUpload_url; const char *bio; const char *updated_at; const char *link; const char *default_font_color; const char *image_128; BOOL dark_theme; BOOL disable_sbwm_internally; const char *account_id; const char *name; const char *location; BOOL solo; const char *watermark; int file_count; int duration; const char *image_32; const char *team_image; const char *default_background_color; const char *resource_id; const char *color; int frames; int storage; int collaborator_count; const char *creator_id; const char *default_session_watermark_template_id; int archived_storage; const char *slack_webhook; const char *upload_url; int member_count; const char *v_type; const char *asset_lifecycle_policy; const char *member_limit; const char *id; const char *storage_limit; const char *access; const char *inserted_at; int folder_count; // 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) { printf("%s\n",CkHttp_lastErrorText(http)); CkHttp_Dispose(http); CkStringBuilder_Dispose(sbResponseBody); return; } jResp = CkJsonObject_Create(); CkJsonObject_LoadSb(jResp,sbResponseBody); CkJsonObject_putEmitCompact(jResp,FALSE); printf("Response Body:\n"); printf("%s\n",CkJsonObject_emit(jResp)); respStatusCode = CkHttp_getLastStatus(http); printf("Response Status Code = %d\n",respStatusCode); if (respStatusCode >= 400) { printf("Response Header:\n"); printf("%s\n",CkHttp_lastHeader(http)); printf("Failed.\n"); CkHttp_Dispose(http); CkStringBuilder_Dispose(sbResponseBody); CkJsonObject_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 = 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); } |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.