Create Encrypted File
Description
Creates an encrypted file on your account.
Encryption details is available here.
Request
HTTP Method: POST
URI Path: /v3/encrypted_files
Header: Content-Type: multipart/form-data
URI Query Parameters:
Request Body Object Attributes:
Name |
Parameter Type |
Type |
Is Required? |
Description |
---|---|---|---|---|
encrypted_files[encryption_fingerprint] |
|
|
Yes |
The encryption fingerprint. |
encrypted_files[items][][description] |
|
|
Optional |
The encrypted file description. |
encrypted_files[items][][file] |
|
|
Yes |
The encrypted file. |
Note
You can pass up to 5 files per request. Size of each file MUST NOT be greater than 20MB. Uploaded encrypted files will expire after 24 hours.
Examples
POST /v3/encrypted_files HTTP/1.1
Host: api.didww.com
Content-Type: multipart/form-data
Accept: application/json
Api-Key: [API token]
curl -i -X POST https://api.didww.com/v3/encrypted_files -H "Accept: application/json" -H "Api-Key: [API token]" -H "Content-Type: multipart/form-data"
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"ids": [
"377dc5cf-55b3-45b8-9fed-156600a7f151"
]
}
POST /v3/encrypted_files HTTP/1.1
Host: api.didww.com
Content-Type: multipart/form-data
Accept: application/json
Api-Key: [API token]
curl -i -X POST https://api.didww.com/v3/encrypted_files -H "Accept: application/json" -H "Api-Key: [API token]" -H "Content-Type: multipart/form-data"
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json; charset=utf-8
{
"errors": {
"base": [
"outdated fingerprint"
]
}
}
POST /v3/encrypted_files HTTP/1.1
Host: api.didww.com
Content-Type: multipart/form-data
Accept: application/json
Api-Key: [API token]
curl -i -X POST https://api.didww.com/v3/encrypted_files -H "Accept: application/json" -H "Api-Key: [API token]" -H "Content-Type: multipart/form-data"
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json; charset=utf-8
{
"errors": {
"items/0/file": [
"size must be less than or equal to 20 MB"
]
}
}
POST /v3/encrypted_files HTTP/1.1
Host: api.didww.com
Content-Type: multipart/form-data
Accept: application/json
Api-Key: [API token]
curl -i -X POST https://api.didww.com/v3/encrypted_files -H "Accept: application/json" -H "Api-Key: [API token]" -H "Content-Type: multipart/form-data"
HTTP/1.1 422 Unprocessable Entity
Content-Type: application/json; charset=utf-8
{
"errors": {
"items/0/file": [
"can't be blank"
]
}
}
Note
Curl example for creating encrypted file:
curl -i -X POST https://api.didww.com/v3/encrypted_files -H 'Accept: application/json' -H 'Api-Key: [API token]' -H 'Content-Type: multipart/form-data' -F 'encrypted_files[encryption_fingerprint]: c24c8711fed0fb9df377d4dad6090038063eec27:::d8919eb961da809e4d597f5c072e04383055e219' -F 'encrypted_files[items][][description]: my file' -F 'encrypted_files[items][][file]=@"/path_to_file"'
Note
For every additional file repeat the following:
-F 'encrypted_files[items][][file]=@"/path_to_file"'
Other Responses
Code |
Success |
Description |
---|---|---|
401 |
No |
|
422 |
No |
Validation Error |