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
(PureBasic) Frame.io - Get Team IDGet your team ID. For more information, see https://docs.frame.io/docs/root-asset-ids
IncludeFile "CkHttp.pb" IncludeFile "CkStringBuilder.pb" IncludeFile "CkJsonObject.pb" Procedure ChilkatExample() ; This example assumes the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. http.i = CkHttp::ckCreate() If http.i = 0 Debug "Failed to create object." ProcedureReturn EndIf success.i ; 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::setCkAuthToken(http, "<FRAME_IO_DEV_TOKEN>") CkHttp::ckSetUrlVar(http,"account_id","b1cd046b-a3bf-4ef8-81a6-0afd74ecc455") sbResponseBody.i = CkStringBuilder::ckCreate() If sbResponseBody.i = 0 Debug "Failed to create object." ProcedureReturn EndIf success = CkHttp::ckQuickGetSb(http,"https://api.frame.io/v2/accounts/{$account_id}/teams",sbResponseBody) If success = 0 Debug CkHttp::ckLastErrorText(http) CkHttp::ckDispose(http) CkStringBuilder::ckDispose(sbResponseBody) ProcedureReturn EndIf jResp.i = CkJsonObject::ckCreate() If jResp.i = 0 Debug "Failed to create object." ProcedureReturn EndIf CkJsonObject::ckLoadSb(jResp,sbResponseBody) CkJsonObject::setCkEmitCompact(jResp, 0) Debug "Response Body:" Debug CkJsonObject::ckEmit(jResp) respStatusCode.i = CkHttp::ckLastStatus(http) Debug "Response Status Code = " + Str(respStatusCode) If respStatusCode >= 400 Debug "Response Header:" Debug CkHttp::ckLastHeader(http) Debug "Failed." CkHttp::ckDispose(http) CkStringBuilder::ckDispose(sbResponseBody) CkJsonObject::ckDispose(jResp) ProcedureReturn EndIf ; 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.s = CkJsonObject::ckStringOf(jResp,"image_64") project_count.i = CkJsonObject::ckIntOf(jResp,"project_count") default_color.s = CkJsonObject::ckStringOf(jResp,"default_color") deleted_at.s = CkJsonObject::ckStringOf(jResp,"deleted_at") image_256.s = CkJsonObject::ckStringOf(jResp,"image_256") background_color.s = CkJsonObject::ckStringOf(jResp,"background_color") font_color.s = CkJsonObject::ckStringOf(jResp,"font_color") email_branding_type.s = CkJsonObject::ckStringOf(jResp,"email_branding._type") email_brandingAccent_color.s = CkJsonObject::ckStringOf(jResp,"email_branding.accent_color") email_brandingBackground_color.s = CkJsonObject::ckStringOf(jResp,"email_branding.background_color") email_brandingDefault_accent_color.s = CkJsonObject::ckStringOf(jResp,"email_branding.default_accent_color") email_brandingDefault_background_color.s = CkJsonObject::ckStringOf(jResp,"email_branding.default_background_color") email_brandingId.s = CkJsonObject::ckStringOf(jResp,"email_branding.id") email_brandingImage.s = CkJsonObject::ckStringOf(jResp,"email_branding.image") email_brandingUpload_url.s = CkJsonObject::ckStringOf(jResp,"email_branding.upload_url") bio.s = CkJsonObject::ckStringOf(jResp,"bio") updated_at.s = CkJsonObject::ckStringOf(jResp,"updated_at") link.s = CkJsonObject::ckStringOf(jResp,"link") default_font_color.s = CkJsonObject::ckStringOf(jResp,"default_font_color") image_128.s = CkJsonObject::ckStringOf(jResp,"image_128") dark_theme.i = CkJsonObject::ckBoolOf(jResp,"dark_theme") disable_sbwm_internally.i = CkJsonObject::ckBoolOf(jResp,"disable_sbwm_internally") account_id.s = CkJsonObject::ckStringOf(jResp,"account_id") name.s = CkJsonObject::ckStringOf(jResp,"name") location.s = CkJsonObject::ckStringOf(jResp,"location") solo.i = CkJsonObject::ckBoolOf(jResp,"solo") watermark.s = CkJsonObject::ckStringOf(jResp,"watermark") file_count.i = CkJsonObject::ckIntOf(jResp,"file_count") duration.i = CkJsonObject::ckIntOf(jResp,"duration") image_32.s = CkJsonObject::ckStringOf(jResp,"image_32") team_image.s = CkJsonObject::ckStringOf(jResp,"team_image") default_background_color.s = CkJsonObject::ckStringOf(jResp,"default_background_color") resource_id.s = CkJsonObject::ckStringOf(jResp,"resource_id") color.s = CkJsonObject::ckStringOf(jResp,"color") frames.i = CkJsonObject::ckIntOf(jResp,"frames") storage.i = CkJsonObject::ckIntOf(jResp,"storage") collaborator_count.i = CkJsonObject::ckIntOf(jResp,"collaborator_count") creator_id.s = CkJsonObject::ckStringOf(jResp,"creator_id") default_session_watermark_template_id.s = CkJsonObject::ckStringOf(jResp,"default_session_watermark_template_id") archived_storage.i = CkJsonObject::ckIntOf(jResp,"archived_storage") slack_webhook.s = CkJsonObject::ckStringOf(jResp,"slack_webhook") upload_url.s = CkJsonObject::ckStringOf(jResp,"upload_url") member_count.i = CkJsonObject::ckIntOf(jResp,"member_count") v_type.s = CkJsonObject::ckStringOf(jResp,"_type") asset_lifecycle_policy.s = CkJsonObject::ckStringOf(jResp,"asset_lifecycle_policy") member_limit.s = CkJsonObject::ckStringOf(jResp,"member_limit") id.s = CkJsonObject::ckStringOf(jResp,"id") storage_limit.s = CkJsonObject::ckStringOf(jResp,"storage_limit") access.s = CkJsonObject::ckStringOf(jResp,"access") inserted_at.s = CkJsonObject::ckStringOf(jResp,"inserted_at") folder_count.i = CkJsonObject::ckIntOf(jResp,"folder_count") CkHttp::ckDispose(http) CkStringBuilder::ckDispose(sbResponseBody) CkJsonObject::ckDispose(jResp) ProcedureReturn EndProcedure |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.