- API
- Edit file
GET
https://send.now/api/file/edit?key=1ltghrilhllgrx2b2&file_code=eb58d02u8znz&name=My document.pdf&file_descr=Quarterly report&file_public=0
| Parameters |
Description |
Example |
Format |
Required |
| key |
API-Key |
1ltghrilhllgrx2b2 |
String |
yes |
| file_code |
File code |
eb58d02u8znz |
String |
yes |
| name |
New file name (file_name works too). Not sent = the name stays |
My document.pdf |
String |
no |
| file_descr |
Description |
Quarterly report |
String |
no |
| file_public |
1 = public, 0 = private |
0 |
Number |
no |
| file_password |
Password of the file. An empty value removes the password |
123password |
String |
no |
| file_premium_only |
1 = only premium users can download it (where the site has this feature) |
0 |
Number |
no |
| file_price |
Price in USD of a paid (VIP) file, 0 = not a paid file. Needs the permission to sell files |
4.99 |
Number |
no |
cURL example
curl --include \
'https://send.now/api/file/edit?key=1ltghrilhllgrx2b2&file_code=eb58d02u8znz&name=My document.pdf&file_descr=Quarterly report&file_public=0'
Response
{
"msg": "OK",
"result": {
"file_code": "eb58d02u8znz",
"file_name": "My document.pdf",
"file_descr": "Quarterly report",
"file_public": 0,
"file_premium_only": 0,
"file_price": 0
},
"status": 200,
"server_time": "2024-08-26 12:19:28"
}
Notice
|
Only the fields you send change. Everything else, the password included, keeps its value. |
|
Rename is the short form of this call: it needs name and answers "result": "true". |
|
A price needs the permission to sell files, and file_premium_only works only where the site has that feature: otherwise the reply is 403. Taking a price or the premium-only flag off a file is always allowed. |
|
The name has to pass the site's file-name rules (allowed extensions). |
|
Errors: 400 invalid file code, name or price, 403 not allowed to set a price or premium-only, 404 no such file (also for a file in the trash). |
Status code
| 200 |
Everything is OK. Request succeeded |
| 400 |
Bad request (e.g. wrong parameters) |
| 403 |
Permission denied |
| 404 |
File not found |
| 451 |
Unavailable
|