Marketing API
Assets
Copy Asset
this api endpoint (post) (post) copies an asset if the request succeeds, it will return an asset object docid\ lrpr7r0iozzuquwvx8xus permissions assets edit note folders cannot be copied note copying an asset increases the storage requirements and might result into extra charges depending on your storage quotas path parameters id the id of the asset to copy body parameters folder id string the id of the folder that you like the copy to be placed in require "uri" require "json" require "net/http" url = uri("https //api tamio com/v2/assets/copy/25213be6 a152 4120 88a8 83e17a3a3ebc") 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 = { folder id "039d7055 2432 46e3 8367 745019302082" } request body = data to json response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/assets/copy/25213be6 a152 4120 88a8 83e17a3a3ebc' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here' \\ \ data raw '{ "folder id" "039d7055 2432 46e3 8367 745019302082" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("authorization", "bearer your token here"); var data = { folder id "039d7055 2432 46e3 8367 745019302082" }; var body = json stringify(data); var requestoptions = { method 'post', headers myheaders, body body }; fetch("https //api tamio com/v2/assets/copy/25213be6 a152 4120 88a8 83e17a3a3ebc", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "status" 200, "asset" { "filename" "copy of new item", "filesize" null, "extension" null, "version" null, "alt text" null, "status" "active", "updated at" 1669251084, "created at" 1669251084, "type" "folder", "id" "c81d1960 71d0 4a4c a99d eba19d481d15", "object" "asset", "folder" "039d7055 2432 46e3 8367 745019302082", "number of children" 0, "number of downloads" 0 } }