Sample code for 30+ languages & platforms
AutoIt

Frame.io - Create a Folder

See more Frame.io Examples

Create a folder asset as a child to the root_asset_id.

Chilkat AutoIt Downloads

AutoIt
Local $bSuccess = False

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

$oHttp = ObjCreate("Chilkat.Http")

; 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"
; }

$oJson = ObjCreate("Chilkat.JsonObject")
$oJson.UpdateString("type","folder")
$oJson.UpdateString("name","Folder at root")

$oHttp.SetRequestHeader "content-type","application/json"
; Adds the "Authorization: Bearer <FRAME_IO_DEV_TOKEN>" header.
$oHttp.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.

$oResp = ObjCreate("Chilkat.HttpResponse")
$bSuccess = $oHttp.HttpJson("POST","https://api.frame.io/v2/assets/4ecb383f-71a8-4233-b665-d8f75136f554/children",$oJson,"application/json",$oResp)
If ($bSuccess = False) Then
    ConsoleWrite($oHttp.LastErrorText & @CRLF)
    Exit
EndIf

$oSbResponseBody = ObjCreate("Chilkat.StringBuilder")
$oResp.GetBodySb($oSbResponseBody)
$oJResp = ObjCreate("Chilkat.JsonObject")
$oJResp.LoadSb($oSbResponseBody)
$oJResp.EmitCompact = False

ConsoleWrite("Response Body:" & @CRLF)
ConsoleWrite($oJResp.Emit() & @CRLF)

Local $iRespStatusCode = $oResp.StatusCode
ConsoleWrite("Response Status Code = " & $iRespStatusCode & @CRLF)
If ($iRespStatusCode >= 400) Then
    ConsoleWrite("Response Header:" & @CRLF)
    ConsoleWrite($oResp.Header & @CRLF)
    ConsoleWrite("Failed." & @CRLF)
    Exit
EndIf

; 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

Local $sTeam_id = $oJResp.StringOf("team_id")
Local $iPublic_item_count = $oJResp.IntOf("public_item_count")
Local $sProperties = $oJResp.StringOf("properties")
Local $sDeleted_at = $oJResp.StringOf("deleted_at")
Local $sFps = $oJResp.StringOf("fps")
Local $sRating = $oJResp.StringOf("rating")
Local $sDescription = $oJResp.StringOf("description")
Local $sUpdated_at = $oJResp.StringOf("updated_at")
Local $sCover_asset_id = $oJResp.StringOf("cover_asset_id")
Local $sArchive_scheduled_at = $oJResp.StringOf("archive_scheduled_at")
Local $subtitle_tracks = $oJResp.StringOf("subtitle_tracks")
Local $sIndex = $oJResp.StringOf("index")
Local $item_count = $oJResp.IntOf("item_count")
Local $sAccount_id = $oJResp.StringOf("account_id")
Local $sName = $oJResp.StringOf("name")
Local $sChecksums = $oJResp.StringOf("checksums")
Local $sAudio_tracks = $oJResp.StringOf("audio_tracks")
Local $sDuration = $oJResp.StringOf("duration")
Local $sLabel = $oJResp.StringOf("label")
Local $bIs_session_watermarked = $oJResp.BoolOf("is_session_watermarked")
Local $sParent_id = $oJResp.StringOf("parent_id")
Local $iVersions = $oJResp.IntOf("versions")
Local $sProject_id = $oJResp.StringOf("project_id")
Local $sResource_id = $oJResp.StringOf("resource_id")
Local $bV_private = $oJResp.BoolOf("private")
Local $iFrames = $oJResp.IntOf("frames")
Local $sAutoversion_id = $oJResp.StringOf("autoversion_id")
Local $sV_type = $oJResp.StringOf("type")
Local $sUploaded_at = $oJResp.StringOf("uploaded_at")
Local $sCreator_id = $oJResp.StringOf("creator_id")
Local $bUser_permissionsCan_download = $oJResp.BoolOf("user_permissions.can_download")
Local $bUser_permissionsCan_modify_template = $oJResp.BoolOf("user_permissions.can_modify_template")
Local $bUser_permissionsCan_public_share_presentation = $oJResp.BoolOf("user_permissions.can_public_share_presentation")
Local $bUser_permissionsCan_public_share_review_link = $oJResp.BoolOf("user_permissions.can_public_share_review_link")
Local $bUser_permissionsCan_share_downloadable_presentation = $oJResp.BoolOf("user_permissions.can_share_downloadable_presentation")
Local $bUser_permissionsCan_share_downloadable_review_link = $oJResp.BoolOf("user_permissions.can_share_downloadable_review_link")
Local $bUser_permissionsCan_share_unwatermarked_presentation = $oJResp.BoolOf("user_permissions.can_share_unwatermarked_presentation")
Local $bUser_permissionsCan_share_unwatermarked_review_link = $oJResp.BoolOf("user_permissions.can_share_unwatermarked_review_link")
Local $bShared = $oJResp.BoolOf("shared")
Local $bIs_360 = $oJResp.BoolOf("is_360")
$sV_type = $oJResp.StringOf("_type")
Local $iComment_count = $oJResp.IntOf("comment_count")
Local $sArchived_at = $oJResp.StringOf("archived_at")
Local $sFiletype = $oJResp.StringOf("filetype")
Local $sId = $oJResp.StringOf("id")
Local $sHard_deleted_at = $oJResp.StringOf("hard_deleted_at")
Local $bCopy = $oJResp.BoolOf("copy")
Local $bIs_hls_required = $oJResp.BoolOf("is_hls_required")
Local $sArchive_status = $oJResp.StringOf("archive_status")
Local $sInserted_at = $oJResp.StringOf("inserted_at")
Local $iFilesize = $oJResp.IntOf("filesize")