Category Filter
Generate Presigned Upload URL
Generating a presigned upload URL is the first step in the file management lifecycle. This API request starts a file upload process by recording the intended file and returning a time-limited (180 minutes) Amazon S3 presigned PUT URL and a file_uuid. Once this step is complete, you will proceed to upload the actual file to the generated URL and verify it.
| Argument | Type | Description |
|---|---|---|
| file_name | String | Name of the file with extension (e.g., report.pdf) |
| content_type | String | Optional MIME type; defaults to application/octet-stream |
Upload File to Amazon S3
After generating the presigned URL, upload the actual file to Amazon S3. Make sure the Content-Type header matches exactly what you specified during the URL generation step.
Shell Command Example:
Bash
curl -X PUT \
-H “Content-Type: application/pdf” \
-T “/path/to/your/report.pdf” \
“{PRESIGNED_URL_FROM_PREVIOUS_STEP}”
HTTP Request:
|
1 2 3 4 5 6 7 8 9 |
POST https://<portal>.hexnodemdm.com/api/v1/filemanagement/generate-presigned-upload-url/ headers:- Authorization: <api key> Content-Type: application/json Sample Post Data:- { "file_name": "report.pdf", "content_type": "application/pdf" } |
Shell Command:
|
1 |
curl -H "Authorization: <api key>" -H "Content-Type: application/json" -d '{"file_name":"report.pdf","content_type":"application/pdf"}' https://<portal>.hexnodemdm.com/api/v1/filemanagement/generate-presigned-upload-url/ |
HTTP Response:
|
1 2 3 4 5 |
{ "presigned_url": "<S3 presigned PUT URL>", "file_name": "<same as request>", "file_uuid": "<UUID string for subsequent confirm step>" } |