| ... | ... | @@ -36,11 +36,10 @@ Currently, three types of "file" attributes are supported: file, picture, video. |
|
|
|
|
|
|
|
In the universe, an attribute which needs to be handled by uploading a file has
|
|
|
|
|
|
|
|
```
|
|
|
|
```json
|
|
|
|
"baseDataType": "file"
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
https://git.ironapi.com/ironapi/api/-/wikis/API/Form-Input-Types
|
|
|
|
|
|
|
|
## Upload
|
| ... | ... | @@ -49,8 +48,9 @@ To set (upload) a file, it needs to be packed into the json request of any trans |
|
|
|
|
|
|
|
The attribute must be set to the original file name and the base64 encoded file data, seperated by a semi-colon. In the following example "attachment" is the name of the attribute and a file called "test.txt" is being uploaded:
|
|
|
|
|
|
|
|
```
|
|
|
|
#/data/helpdesk/ticket/transitions/create
|
|
|
|
`/data/helpdesk/ticket/transitions/create`
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"category" : 1,
|
|
|
|
"subject" : "test",
|
| ... | ... | @@ -60,7 +60,7 @@ The attribute must be set to the original file name and the base64 encoded file |
|
|
|
|
|
|
|
As seen in the reply, the attribute will be replaced with meta data needed to store and retrieve the file.
|
|
|
|
|
|
|
|
```
|
|
|
|
```json
|
|
|
|
"data": {
|
|
|
|
"modification_time": "2019-06-05T12:00:58.580746",
|
|
|
|
"cost_bearing_department": null,
|
| ... | ... | @@ -90,13 +90,25 @@ As stated in the universe, the file itself can be downloaded via a seperate url: |
|
|
|
|
|
|
|
Permission to do so will be the same as a permission to view the instance.
|
|
|
|
|
|
|
|
## Update
|
|
|
|
|
|
|
|
To upload a different file, just update the attribute with a new file:
|
|
|
|
|
|
|
|
`POST /data/helpdesk/ticket/3/transitions/edit`
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"attachment" : "test1.txt;Ymxh"
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Delete
|
|
|
|
|
|
|
|
To delete the file, just set the attribute to an empty value:
|
|
|
|
|
|
|
|
`POST /data/helpdesk/ticket/3/transitions/edit`
|
|
|
|
|
|
|
|
```
|
|
|
|
```json
|
|
|
|
{
|
|
|
|
"attachment" : null
|
|
|
|
}
|
| ... | ... | |