Marketing API
Assets
Create Folder
this api endpoint (post) (post) creates a folder if the request succeeds, it will return an asset object docid\ lrpr7r0iozzuquwvx8xus permissions assets create body parameters label string the label of the folder folder id string the id of the folder that you like the asset to be created in require "uri" require "json" require "net/http" url = uri("https //api tamio com/v2/assets/folders/create") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["authorization"] = "bearer your token here" data = { label "new folder" } request body = data to json response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/assets/folders/create' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here' \\ \ data raw '{ "label" "new folder" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("authorization", "bearer your token here"); var data = { label "new folder" }; var body = json stringify(data); var requestoptions = { method 'post', headers myheaders, body body }; fetch("https //api tamio com/v2/assets/folders/create", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "status" 200, "asset" { "filename" "new folder", "filesize" null, "extension" null, "status" "active", "version" null, "updated at" 1669251084, "created at" 1669251084, "type" "folder", "id" "25213be6 a152 4120 88a8 83e17a3a3ebc", "object" "asset", "folder" "618c5e17 4b22 4a1b 989b 9fd47112deee", "number of children" 0 } }