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
(SQL Server) Frame.io - Create a FolderCreate a folder asset as a child to the root_asset_id. For more information, see https://docs.frame.io/docs/root-asset-ids
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls. -- CREATE PROCEDURE ChilkatSample AS BEGIN DECLARE @hr int DECLARE @iTmp0 int -- Important: Do not use nvarchar(max). See the warning about using nvarchar(max). DECLARE @sTmp0 nvarchar(4000) -- This example assumes the Chilkat API to have been previously unlocked. -- See Global Unlock Sample for sample code. DECLARE @http int -- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT IF @hr <> 0 BEGIN PRINT 'Failed to create ActiveX component' RETURN END DECLARE @success int -- Implements the following CURL command: -- curl --request POST \ -- --url https://api.frame.io/v2/assets/<root_asset_id>/children \ -- --header 'authorization: Bearer <FRAME_IO_DEV_TOKEN>' \ -- --header 'content-type: application/json' \ -- --data '{"type":"folder", "name": "Folder at root"}' -- Use the following online tool to generate HTTP code from a CURL command -- Convert a cURL Command to HTTP Source Code -- Use this online tool to generate code from sample JSON: -- Generate Code to Create JSON -- The following JSON is sent in the request body. -- { -- "type": "folder", -- "name": "Folder at root" -- } DECLARE @json int -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @json OUT EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'type', 'folder' EXEC sp_OAMethod @json, 'UpdateString', @success OUT, 'name', 'Folder at root' EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'content-type', 'application/json' -- Adds the "Authorization: Bearer <FRAME_IO_DEV_TOKEN>" header. EXEC sp_OASetProperty @http, 'AuthToken', '<FRAME_IO_DEV_TOKEN>' -- Our root_asset_id = 4ecb383f-71a8-4233-b665-d8f75136f554 -- You'll need to modify the following line to use your root asset ID. DECLARE @resp int EXEC sp_OAMethod @http, 'PostJson3', @resp OUT, 'https://api.frame.io/v2/assets/4ecb383f-71a8-4233-b665-d8f75136f554/children', 'application/json', @json EXEC sp_OAGetProperty @http, 'LastMethodSuccess', @iTmp0 OUT IF @iTmp0 = 0 BEGIN EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT PRINT @sTmp0 EXEC @hr = sp_OADestroy @http EXEC @hr = sp_OADestroy @json RETURN END DECLARE @sbResponseBody int -- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbResponseBody OUT EXEC sp_OAMethod @resp, 'GetBodySb', @success OUT, @sbResponseBody DECLARE @jResp int -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @jResp OUT EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody EXEC sp_OASetProperty @jResp, 'EmitCompact', 0 PRINT 'Response Body:' EXEC sp_OAMethod @jResp, 'Emit', @sTmp0 OUT PRINT @sTmp0 DECLARE @respStatusCode int EXEC sp_OAGetProperty @resp, 'StatusCode', @respStatusCode OUT PRINT 'Response Status Code = ' + @respStatusCode IF @respStatusCode >= 400 BEGIN PRINT 'Response Header:' EXEC sp_OAGetProperty @resp, 'Header', @sTmp0 OUT PRINT @sTmp0 PRINT 'Failed.' EXEC @hr = sp_OADestroy @resp EXEC @hr = sp_OADestroy @http EXEC @hr = sp_OADestroy @json EXEC @hr = sp_OADestroy @sbResponseBody EXEC @hr = sp_OADestroy @jResp RETURN END EXEC @hr = sp_OADestroy @resp -- Sample JSON response: -- (Sample code for parsing the JSON response is shown below) -- { -- "team_id": "95a5fbad-688d-46fc-aef1-2f011dd76c10", -- "public_item_count": 0, -- "properties": null, -- "deleted_at": null, -- "fps": null, -- "rating": null, -- "description": null, -- "updated_at": "2020-08-18T03:31:59.699011Z", -- "cover_asset_id": null, -- "archive_scheduled_at": null, -- "subtitle_tracks": null, -- "index": -7.0, -- "item_count": 0, -- "account_id": "b1cd046b-a3bf-4ef8-81a6-0afd74ecc455", -- "name": "FolderA", -- "checksums": null, -- "audio_tracks": null, -- "duration": null, -- "label": "none", -- "is_session_watermarked": false, -- "parent_id": "4ecb383f-71a8-4233-b665-d8f75136f554", -- "versions": 0, -- "project_id": "e76653c4-6cc0-4c47-936b-f7885b477dc0", -- "resource_id": null, -- "private": false, -- "frames": 0, -- "autoversion_id": null, -- "type": "folder", -- "uploaded_at": "2020-08-18T03:31:59.697174Z", -- "creator_id": "34b4f98a-7cc9-4159-8f46-c7c3d837fc6f", -- "user_permissions": { -- "can_download": true, -- "can_modify_template": false, -- "can_public_share_presentation": true, -- "can_public_share_review_link": true, -- "can_share_downloadable_presentation": true, -- "can_share_downloadable_review_link": true, -- "can_share_unwatermarked_presentation": true, -- "can_share_unwatermarked_review_link": true -- }, -- "shared": false, -- "is_360": false, -- "_type": "folder", -- "comment_count": 0, -- "archived_at": null, -- "filetype": null, -- "id": "039845e8-bffe-4d6b-88d3-c780bae06342", -- "hard_deleted_at": null, -- "copy": false, -- "is_hls_required": false, -- "archive_status": null, -- "inserted_at": "2020-08-18T03:31:59.699011Z", -- "filesize": 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 DECLARE @team_id nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @team_id OUT, 'team_id' DECLARE @public_item_count int EXEC sp_OAMethod @jResp, 'IntOf', @public_item_count OUT, 'public_item_count' DECLARE @properties nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @properties OUT, 'properties' DECLARE @deleted_at nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @deleted_at OUT, 'deleted_at' DECLARE @fps nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @fps OUT, 'fps' DECLARE @rating nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @rating OUT, 'rating' DECLARE @description nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @description OUT, 'description' DECLARE @updated_at nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @updated_at OUT, 'updated_at' DECLARE @cover_asset_id nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @cover_asset_id OUT, 'cover_asset_id' DECLARE @archive_scheduled_at nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @archive_scheduled_at OUT, 'archive_scheduled_at' DECLARE @subtitle_tracks nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @subtitle_tracks OUT, 'subtitle_tracks' DECLARE @index nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @index OUT, 'index' DECLARE @item_count int EXEC sp_OAMethod @jResp, 'IntOf', @item_count OUT, 'item_count' DECLARE @account_id nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @account_id OUT, 'account_id' DECLARE @name nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @name OUT, 'name' DECLARE @checksums nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @checksums OUT, 'checksums' DECLARE @audio_tracks nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @audio_tracks OUT, 'audio_tracks' DECLARE @duration nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @duration OUT, 'duration' DECLARE @label nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @label OUT, 'label' DECLARE @is_session_watermarked int EXEC sp_OAMethod @jResp, 'BoolOf', @is_session_watermarked OUT, 'is_session_watermarked' DECLARE @parent_id nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @parent_id OUT, 'parent_id' DECLARE @versions int EXEC sp_OAMethod @jResp, 'IntOf', @versions OUT, 'versions' DECLARE @project_id nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @project_id OUT, 'project_id' DECLARE @resource_id nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @resource_id OUT, 'resource_id' DECLARE @v_private int EXEC sp_OAMethod @jResp, 'BoolOf', @v_private OUT, 'private' DECLARE @frames int EXEC sp_OAMethod @jResp, 'IntOf', @frames OUT, 'frames' DECLARE @autoversion_id nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @autoversion_id OUT, 'autoversion_id' DECLARE @v_type nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @v_type OUT, 'type' DECLARE @uploaded_at nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @uploaded_at OUT, 'uploaded_at' DECLARE @creator_id nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @creator_id OUT, 'creator_id' DECLARE @user_permissionsCan_download int EXEC sp_OAMethod @jResp, 'BoolOf', @user_permissionsCan_download OUT, 'user_permissions.can_download' DECLARE @user_permissionsCan_modify_template int EXEC sp_OAMethod @jResp, 'BoolOf', @user_permissionsCan_modify_template OUT, 'user_permissions.can_modify_template' DECLARE @user_permissionsCan_public_share_presentation int EXEC sp_OAMethod @jResp, 'BoolOf', @user_permissionsCan_public_share_presentation OUT, 'user_permissions.can_public_share_presentation' DECLARE @user_permissionsCan_public_share_review_link int EXEC sp_OAMethod @jResp, 'BoolOf', @user_permissionsCan_public_share_review_link OUT, 'user_permissions.can_public_share_review_link' DECLARE @user_permissionsCan_share_downloadable_presentation int EXEC sp_OAMethod @jResp, 'BoolOf', @user_permissionsCan_share_downloadable_presentation OUT, 'user_permissions.can_share_downloadable_presentation' DECLARE @user_permissionsCan_share_downloadable_review_link int EXEC sp_OAMethod @jResp, 'BoolOf', @user_permissionsCan_share_downloadable_review_link OUT, 'user_permissions.can_share_downloadable_review_link' DECLARE @user_permissionsCan_share_unwatermarked_presentation int EXEC sp_OAMethod @jResp, 'BoolOf', @user_permissionsCan_share_unwatermarked_presentation OUT, 'user_permissions.can_share_unwatermarked_presentation' DECLARE @user_permissionsCan_share_unwatermarked_review_link int EXEC sp_OAMethod @jResp, 'BoolOf', @user_permissionsCan_share_unwatermarked_review_link OUT, 'user_permissions.can_share_unwatermarked_review_link' DECLARE @shared int EXEC sp_OAMethod @jResp, 'BoolOf', @shared OUT, 'shared' DECLARE @is_360 int EXEC sp_OAMethod @jResp, 'BoolOf', @is_360 OUT, 'is_360' EXEC sp_OAMethod @jResp, 'StringOf', @v_type OUT, '_type' DECLARE @comment_count int EXEC sp_OAMethod @jResp, 'IntOf', @comment_count OUT, 'comment_count' DECLARE @archived_at nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @archived_at OUT, 'archived_at' DECLARE @filetype nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @filetype OUT, 'filetype' DECLARE @id nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @id OUT, 'id' DECLARE @hard_deleted_at nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @hard_deleted_at OUT, 'hard_deleted_at' DECLARE @copy int EXEC sp_OAMethod @jResp, 'BoolOf', @copy OUT, 'copy' DECLARE @is_hls_required int EXEC sp_OAMethod @jResp, 'BoolOf', @is_hls_required OUT, 'is_hls_required' DECLARE @archive_status nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @archive_status OUT, 'archive_status' DECLARE @inserted_at nvarchar(4000) EXEC sp_OAMethod @jResp, 'StringOf', @inserted_at OUT, 'inserted_at' DECLARE @filesize int EXEC sp_OAMethod @jResp, 'IntOf', @filesize OUT, 'filesize' EXEC @hr = sp_OADestroy @http EXEC @hr = sp_OADestroy @json EXEC @hr = sp_OADestroy @sbResponseBody EXEC @hr = sp_OADestroy @jResp END GO |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.