Api session event editor projectasset add texture: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
API | API Endpoint: editorprojectasset/add_texture. | ||
Description: Upload new [[Texture]] as a Project assets, auto rescaled to small, medium, large. | |||
{|class=wikitable | {|class=wikitable | ||
!Name | !Name | ||
| Line 37: | Line 40: | ||
|} | |} | ||
===Example POST=== | ===Example POST=== | ||
Curl | Curl example POST: | ||
<syntaxhighlight lang="text" copy>curl 'https:// | <syntaxhighlight lang="text" copy>curl 'https://engine.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 ] ]' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Curl | Curl example multi item POST: | ||
<syntaxhighlight lang="text" copy>curl 'https:// | <syntaxhighlight lang="text" copy>curl 'https://engine.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 ] ] ]' | ||
</syntaxhighlight> | </syntaxhighlight> | ||
JavaScript | JavaScript example POST: | ||
<syntaxhighlight lang="text" copy>var options = { | <syntaxhighlight lang="text" copy>var options = { | ||
| Line 52: | Line 55: | ||
body: '[ "Directory to upload to 1", "Filename. This should a simple file name, including extension 1", [ 1, 2 ] ]' | body: '[ "Directory to upload to 1", "Filename. This should a simple file name, including extension 1", [ 1, 2 ] ]' | ||
}; | }; | ||
fetch("https:// | fetch("https://engine.tygron.com/api/session/event/editorprojectasset/add_texture/", options) | ||
.then(response => response.text()) | .then(response => response.text()) | ||
.then(result => console.log(result)) | .then(result => console.log(result)) | ||
Latest revision as of 13:39, 14 April 2026
API Endpoint: editorprojectasset/add_texture.
Description: 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://engine.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://engine.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 API_TOKEN" },
body: '[ "Directory to upload to 1", "Filename. This should a simple file name, including extension 1", [ 1, 2 ] ]'
};
fetch("https://engine.tygron.com/api/session/event/editorprojectasset/add_texture/", options)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));