Update Media File
1 |
PUT /api/1/media/{id} |
Parameters
Name | Parameter Type |
Allow Multiple |
Required/ Optional |
Data Type | Description |
---|---|---|---|---|---|
Authorization: | Header | False | Required | String (Bearer {access token}) | Pass the authentication token that was granted when you authorized access. |
id | Path | False | Required | String | The id of the media file you want to update. |
file | Form | False | Required | multipart | The file that will replace the existing media file |
Request
HTTP
Following is an example HTTP request:
1 2 3 4 5 6 7 8 9 10 11 12 |
PUT /api/1/media/f-004c HTTP/1.1 Host: restapi.actonsoftware.com Authorization: Bearer ccb86747508bfca0a7ecd3e0424833e8 Cache-Control: no-cache Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW ----WebKitFormBoundary7MA4YWxkTrZu0gW Content-Disposition: form-data; name="file"; filename="file.pdf" Content-Type: application/pdf ----WebKitFormBoundary7MA4YWxkTrZu0gW |
curl
Following is an example curl request:
1 |
curl -X PUT -H "Authorization: Bearer ccb86747508bfca0a7ecd3e0424833e8" -H "Cache-Control: no-cache" -H "Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW" -F "file=file.pdf" https://restapi.actonsoftware.com/api/1/media/f-004c |
Response
A successful request results in an HTTP 200 response in JSON like the following:
1 2 3 4 5 |
{ "status": "success", "message": "The file has been uploaded", "id": "f-004c" } |