Api session event editor projectasset add: Difference between revisions
Jump to navigation
Jump to search
Created page with "API Event to Upload a new image as a Project asset. {|class=wikitable !Name !Importance !Type !Description !Values |- |0 |REQUIRED |(String) |Directory to upload to | |- |1 |REQUIRED |(String) |Filename. This should a simple file name, including extension | |- |2 |REQUIRED |(byte or multiple values in array [a, b, c]) |File data | |} ===Response Codes=== {|class=wikitable !Response Code: !Description |- |200 |Integer (Project Asset ID) |- |300-600 |Codes Overview |} ===E..." |
No edit summary |
||
| (12 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
API | API Endpoint: api/session/event/editorprojectasset/add/ | ||
Description: Upload a new image as a [[Project Asset]]. | |||
{|class=wikitable | {|class=wikitable | ||
! | !Index | ||
!Importance | !Importance | ||
!Type | !Type | ||
| Line 7: | Line 10: | ||
!Values | !Values | ||
|- | |- | ||
|0 | | 0 | ||
|REQUIRED | | REQUIRED | ||
|(String) | | (String) | ||
|Directory to upload to | | Directory to upload to | ||
| | | | ||
|- | |- | ||
|1 | | 1 | ||
|REQUIRED | | REQUIRED | ||
|(String) | | (String) | ||
|Filename. This should a simple file name, including extension | | Filename. This should a simple file name, including extension | ||
| | | | ||
|- | |- | ||
|2 | | 2 | ||
|REQUIRED | | REQUIRED | ||
|(byte or multiple values in array [a, b, c]) | | (byte or multiple values in array [a, b, c]) | ||
|File data | | File data | ||
| | | | ||
|} | |} | ||
===Response Codes=== | ===Response Codes=== | ||
| Line 30: | Line 33: | ||
!Description | !Description | ||
|- | |- | ||
|200 | | 200 | ||
|Integer (Project Asset ID) | | Integer (Project Asset ID) | ||
|- | |- | ||
|300-600 | | 300-600 | ||
|Codes Overview | | Codes Overview | ||
|} | |} | ||
===Example POST=== | ===Example POST=== | ||
Curl example POST | |||
<syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editorprojectasset/add/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ "Directory to upload to", "Filename. This should a simple file name, including extension", 1 ]' | |||
</syntaxhighlight> | |||
< | Curl example multi item POST | ||
</ | <syntaxhighlight lang="text" copy>curl 'https://engine.tygron.com/api/session/event/editorprojectasset/add/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ "Directory to upload to", "Filename. This should a simple file name, including extension", [ 1, 2, 3 ] ]' | ||
{{article end|seealso=*[[ | </syntaxhighlight> | ||
JavaScript example POST | |||
<syntaxhighlight lang="text" copy>var options = { | |||
method: "POST", | |||
headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" }, | |||
body: '[ "Directory to upload to", "Filename. This should a simple file name, including extension", 1 ]' | |||
}; | |||
fetch("https://engine.tygron.com/api/session/event/editorprojectasset/add/", options) | |||
.then(response => response.text()) | |||
.then(result => console.log(result)) | |||
.catch(error => console.log('error', error)); | |||
</syntaxhighlight> | |||
{{article end|seealso=*[[Api session event editor projectasset]] | |||
*[[Api session items projectassets]] | |||
}} | |||
[[Category:API]] | [[Category:API]] | ||
Latest revision as of 12:06, 15 June 2026
API Endpoint: api/session/event/editorprojectasset/add/
Description: Upload a new image as a Project Asset.
| Index | Importance | Type | Description | Values |
|---|---|---|---|---|
| 0 | REQUIRED | (String) | Directory to upload to | |
| 1 | REQUIRED | (String) | 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 |
|---|---|
| 200 | Integer (Project Asset ID) |
| 300-600 | Codes Overview |
Example POST
Curl example POST
curl 'https://engine.tygron.com/api/session/event/editorprojectasset/add/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ "Directory to upload to", "Filename. This should a simple file name, including extension", 1 ]'Curl example multi item POST
curl 'https://engine.tygron.com/api/session/event/editorprojectasset/add/' -H 'Content-Type: application/json' -H 'Authorization: Bearer API_TOKEN' -d '[ "Directory to upload to", "Filename. This should a simple file name, including extension", [ 1, 2, 3 ] ]'JavaScript example POST
var options = {
method: "POST",
headers: { "Content-Type": "application/json", "Authorization": "Bearer API_TOKEN" },
body: '[ "Directory to upload to", "Filename. This should a simple file name, including extension", 1 ]'
};
fetch("https://engine.tygron.com/api/session/event/editorprojectasset/add/", options)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));