Lists all attachments associated with a specific document (workflow). Users can attach both files and folders to a workflow in any project language.
URL
Code Block |
---|
(GETPOST) /api/projectsmedia/{pid}/workflows/{did}/attachments/{locale} |
PARAMETERS
The URL parameters are:
...
pid
...
The project ID
...
int, Mandatory
...
did
...
The document ID
...
int, Mandatory
...
locale
...
Source or target language code
...
string, Mandatory
RESULTS
The JSON result includes a list of attached files and folders. In the example below, we see 2 files and 1 folder:
Code Block |
---|
[ { "name": "instructions.html", "folder": false, "date": "2024-03-28T09:41:03.0291708Z", "size": 4368 }, { "name": "supplement\\Additional Content.html", "folder": false, "date": "2024-03-28T09:41:03.0291708Z", "size": 2268 }, { "name": "supplement",upload/multi |
PARAMETERS
Include the file or files in the BODY:
Files need to be uploaded using the
multipart/form-data
content type.
An example using curl
:
curl -F "one.html=@path_first_file" -F "two.html=@path_second_file" https://...media/upload/multi
Further down we show how to do it with Postman.
RESULTS
A JSON array with the tokens, one per file. You can then pass those tokens for consumption by other API methods. Example:
Code Block |
---|
{ "tokens": [ "folder73be1612c8344df5bbebe1c00f6fc953": true, "date8e40e1b84f144c878a770e77914c510b": "2024-03-28T10:36:03.401092Z", "size": null } ] |
The properties are:
...
name: File or folder name
...
folder: False if a file. True if a folder.
...
date: Date of last modification.
...
]
} |
The tokens show up in the order of the files in the HTTP request.
POSTMAN
Uploading multiple files with Postman requires configuration of the “body”:
...