Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • A api
  • Project information
    • Project information
    • Activity
    • Members
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Wiki
    • Wiki
  • Activity
Collapse sidebar
  • ironapi
  • api
  • Wiki
  • Api
  • Storing Files

Storing Files · Changes

Page history
Update Storing Files authored Dec 03, 2021 by Andrea Pavlovic's avatar Andrea Pavlovic
Hide whitespace changes
Inline Side-by-side
API/Storing-Files.md
View page @ ee913562
...@@ -36,11 +36,10 @@ Currently, three types of "file" attributes are supported: file, picture, video. ...@@ -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 In the universe, an attribute which needs to be handled by uploading a file has
``` ```json
"baseDataType": "file" "baseDataType": "file"
``` ```
https://git.ironapi.com/ironapi/api/-/wikis/API/Form-Input-Types https://git.ironapi.com/ironapi/api/-/wikis/API/Form-Input-Types
## Upload ## Upload
...@@ -49,8 +48,9 @@ To set (upload) a file, it needs to be packed into the json request of any trans ...@@ -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: 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, "category" : 1,
"subject" : "test", "subject" : "test",
...@@ -60,7 +60,7 @@ The attribute must be set to the original file name and the base64 encoded file ...@@ -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. As seen in the reply, the attribute will be replaced with meta data needed to store and retrieve the file.
``` ```json
"data": { "data": {
"modification_time": "2019-06-05T12:00:58.580746", "modification_time": "2019-06-05T12:00:58.580746",
"cost_bearing_department": null, "cost_bearing_department": null,
...@@ -90,13 +90,25 @@ As stated in the universe, the file itself can be downloaded via a seperate url: ...@@ -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. 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 ## Delete
To delete the file, just set the attribute to an empty value: To delete the file, just set the attribute to an empty value:
`POST /data/helpdesk/ticket/3/transitions/edit` `POST /data/helpdesk/ticket/3/transitions/edit`
``` ```json
{ {
"attachment" : null "attachment" : null
} }
......
Clone repository
  • API
    • Available Endpoints
    • Changing Passwords
    • Form Input Types
    • Introduction
    • Logout
    • Plugins
    • Queries
    • Queries
      • Attributes
      • Context
      • Query Examples
      • Query Search Options
      • Referenced Instances
      • Saved Queries
    • Schema_Changes
    • Storing Files
View All Pages