Marketing API
Assets
Rename Asset
this api endpoint (post) (post) renames an asset if the request succeeds, it will return an asset object docid\ lrpr7r0iozzuquwvx8xus ; otherwise, it will return an error permissions assets edit note folders cannot be renamed path parameters id the id of the asset to rename body parameters name string the new filename spaces or special characters are not supported require "uri" require "json" require "net/http" url = uri("https //api tamio com/v2/assets/rename/fd2b7195 1a40 46c1 ae44 a0c100272389") 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 = { name "new filename" } request body = data to json response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/assets/rename/fd2b7195 1a40 46c1 ae44 a0c100272389' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here' \\ \ data raw '{ "name" "new filename" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("authorization", "bearer your token here"); var data = { name "new filename" }; var body = json stringify(data); var requestoptions = { method 'post', headers myheaders, body body }; fetch("https //api tamio com/v2/assets/rename/fd2b7195 1a40 46c1 ae44 a0c100272389", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "status" 200, "asset" { "filename" "new filename png", "filesize" 26496, "extension" "png", "version" null, "updated at" 1669253854, "created at" 1668380210, "type" "image", "status" "active", "thumbnails" \[], "id" "fd2b7195 1a40 46c1 ae44 a0c100272389", "object" "asset", "folder" "618c5e17 4b22 4a1b 989b 9fd47112deee", "number of children" 0, "number of downloads" 0 } }