Api session event editor projectasset add texture

From Tygron Support wiki
Jump to navigation Jump to search

API Event to Upload new Texture as a Project assets, auto rescaled to small, medium, large.

Name Importance Type Description Values
0 REQUIRED (String or multiple values in array ["a", "b", "c"]) Directory to upload to
1 REQUIRED (String or multiple values in array ["a", "b", "c"]) Filename. This should a simple file name, including extension
2 REQUIRED (byte or multiple values in array [a, b, c]) File data

Response Codes

Response Code: Description
204 No Content
300-600 Codes Overview

Example POST

Curl Example POST:

curl 'https://development.tygron.com/api/session/event/editorprojectasset/add_texture/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ "Directory to upload to 1", "Filename. This should a simple file name, including extension 1", [ 1, 2 ] ]'

Curl Example multi item POST:

curl 'https://development.tygron.com/api/session/event/editorprojectasset/add_texture/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ [ "Directory to upload to 1", "Directory to upload to 2", "Directory to upload to 3" ], [ "Filename. This should a simple file name, including extension 1", "Filename. This should a simple file name, including extension 2", "Filename. This should a simple file name, including extension 3" ], [ [ 1, 2 ], [ 3, 4 ], [ 5, 6 ] ] ]'

JavaScript Example POST:

var options = {
 method: "POST",
 headers: { "Content-Type": "application/json", "Authorization": "Bearer 31410104zAuxtcJo8WGhL6iYlCDnU5hd" },
 body: '[ "Directory to upload to 1", "Filename. This should a simple file name, including extension 1", [ 1, 2 ] ]'
};
fetch("https://development.tygron.com/api/session/event/editorprojectasset/add_texture/", options)
 .then(response => response.text())
 .then(result => console.log(result))
 .catch(error => console.log('error', error));