Marketing API
Assets
Create Asset
this api endpoint (post) (post) creates a link that you can use to upload a file to your tamio storage from your system if the request succeeds, it will return an asset object docid\ lrpr7r0iozzuquwvx8xus each generated link has a lifespan of 15 seconds, so use this endpoint when you are ready to upload the file from your application permissions assets create body parameters filesize integer the size of the file that you intend to upload in bytes the maximum filesize is 1 5gb for files and 5mb for images filename string the name of the file special characters and spaces are not allowed folder id string the id of the folder that you like this asset to be located in type string this attribute affects images the possible values are public and private the default value is private public images can be used on products, affiliate programs and tamio sites please note that if you choose to make your asset public it will be availabe on the internet and distributed via the tamio cdn you can always make the asset public ( make public docid\ naqfiwah1xaer3shks2la ) at a later stage public assets generate thumbnails and have additional storage requirements that might affect the cost of your billing plan require "uri" require "json" require "net/http" url = uri("https //api tamio com/v2/assets/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 = { filename "cool image jpg", filesize 258775 } request body = data to json response = https request(request) puts response read bodycurl location request post 'https //api tamio com/v2/assets/create' \\ \ header 'accept application/json' \\ \ header 'authorization bearer your token here' \\ \ data raw '{ filename "cool image jpg", filesize 258775 }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("authorization", "bearer your token here"); var data = { filename "cool image jpg", filesize 258775 }; var body = json stringify(data); var requestoptions = { method 'post', headers myheaders, body body }; fetch("https //api tamio com/v2/assets/create", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));{ "status" 200, "url" "https //files tamio com/cool image jpg?x amz algorithm=aws4 hmac sha256\&x amz content sha256=60303ae22b998861bce3b28f33eec1be758a213c86c93c076dbe9f558c11c752\&x amz credential=6nl4fgi9an352rjemo1i%2f20221123%2fnl%2fs3%2faws4 request\&x amz date=20221123t195224z\&x amz expires=86400\&x amz signedheaders=host\&x amz signature=b756b9df7ba2db4b3f514b427bf469e74367af5b8c4b0b2cff586451fdca715b", "asset" { "filename" "cool image jpg", "filesize" 258775, "extension" "jpg", "version" null, "updated at" 1669233144, "created at" 1669233144, "type" "file", "id" "e60924e9 4510 4f6d adf8 9ee7659ec1ad", "object" "asset", "number of downloads" 0 } }