Documents
Binary documents business logic
Parameters
Name |
In |
Type |
Required |
Description |
x-auth-owner |
header |
string |
false |
The string id related with the document owner. It is mandatory when document is not public |
org_id |
path |
string |
true |
The string id related with one of Grupo MasOrange tenants |
body |
body |
object |
true |
File name, content and metadata for creating the document. |
Request body - Content-Type: multipart/form-data
Custom schema example
1
2
3
4
5
6
7
8
|
name: personal_contract
extension: pdf
tags:
- Draft
- Top_Secret
- v1.0
content: string
|
Name |
Type |
Required |
Description |
name |
string |
true |
Name of the document (without spaces). The document is renamed with this value. |
extension |
string |
true |
Format of the document to be stored. It must match the format of the binary |
Allowed values: pdf, jpeg, jpg, png |
|
|
|
tags |
array |
false |
Free values (user-defined) to tag document. These values are normalized following the next rules: |
- All tags will be converted to lowercase
- All whitespaces will be removed
- Empty or blank tags are not allowed
- Tags matching reserved words (null, undefined or nan) are not allowed|
|content|string|true|Document content in binary format|
Request example
1
2
3
4
5
6
7
8
9
10
|
curl -X POST https://documents.masstack.com/v1/orgs/masmovil/documents \
-H "Content-Type: multipart/form-data" \
-H "Accept: application/json" \
-H "x-auth-owner: 2357893" \
-F "name=personal_contract" \
-F "extension=pdf" \
-F "tags=Draft,Top_Secret,v1.0" \
-F "content=undefined" \
|
Parameters
Name |
In |
Type |
Required |
Description |
x-auth-owner |
header |
string |
false |
The string id related with the document owner. It is mandatory when document is not public |
org_id |
path |
string |
true |
The string id related with one of Grupo MasOrange tenants |
documentId |
path |
string |
true |
The string id related with one of Grupo MasOrange tenants/organizations |
Request example
1
2
3
4
5
|
curl -X DELETE https://documents.masstack.com/v1/orgs/masmovil/documents/d290f1ee-6c54-4b01-90e6-d701748f0851 \
-H "Accept: application/json" \
-H "x-auth-owner: 2357893"
|
Parameters
Name |
In |
Type |
Required |
Description |
x-auth-owner |
header |
string |
false |
The string id related with the document owner. It is mandatory when document is not public |
org_id |
path |
string |
true |
The string id related with one of Grupo MasOrange tenants |
documentId |
path |
string(uuid) |
true |
The string id related with one of Grupo MasOrange tenants/organizations |
Request example
1
2
3
4
5
|
curl -X GET https://documents.masstack.com/v1/orgs/masmovil/documents/d290f1ee-6c54-4b01-90e6-d701748f0851 \
-H "Accept: application/octet-stream" \
-H "x-auth-owner: 2357893"
|
Responses
Code |
Meaning |
Description |
Schema |
200 |
OK |
The document binary content. Expected response to a valid request. |
string |
400 |
Bad Request |
Request input is not valid |
None |
401 |
Unauthorized |
Unauthorized. AuthN and AuthZ validations have fail |
None |
404 |
Not Found |
resource not found |
None |
410 |
Gone |
resource is not longer available |
None |
500 |
Internal Server Error |
Not expected error |
None |
default |
Default |
Error response |
ErrorsResponse |
Parameters
Name |
In |
Type |
Required |
Description |
x-auth-owner |
header |
string |
false |
The string id related with the document owner. It is mandatory when document is not public |
org_id |
path |
string |
true |
The string id related with one of Grupo MasOrange tenants |
documentId |
path |
string |
true |
The string id related with one of Grupo MasOrange tenants/organizations |
Request example
1
2
3
4
5
|
curl -X DELETE https://documents.masstack.com/v1/orgs/masmovil/documents/d290f1ee-6c54-4b01-90e6-d701748f0851/physical \
-H "Accept: application/json" \
-H "x-auth-owner: 2357893"
|
Parameters
Name |
In |
Type |
Required |
Description |
x-auth-owner |
header |
string |
false |
The string id related with the document owner. It is mandatory when document is not public |
org_id |
path |
string |
true |
The string id related with one of Grupo MasOrange tenants |
documentId |
path |
string(uuid) |
true |
The string id related with one of Grupo MasOrange tenants/organizations |
body |
body |
CreatePublicUrlRequest |
true |
Duration before public url expires and becomes not accesible |
1
2
3
4
|
{
"expiresIn": "PT24H",
"downloadDisposition": "inline"
}
|
Name |
Type |
Required |
Description |
expiresIn |
string |
false |
Default to 24 hours. Max 24 hours. Validity duration time (ISO-8601 format) of the public url from now. |
downloadDisposition |
string |
false |
Controls the disposition of the content (if the PDF is rendered inline or downloaded). Allowed values “attachment” or “inline”. |
Property |
Values |
downloadDisposition |
one of [attachment, inline] |
Request example
1
2
3
4
5
6
7
8
9
10
|
curl -X POST https://documents.masstack.com/v1/orgs/masmovil/documents/d290f1ee-6c54-4b01-90e6-d701748f0851/public_url \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "x-auth-owner: 2357893" \
--data-raw "{
'expiresIn': 'PT24H',
'downloadDisposition': 'inline'
}"
|
Parameters
Name |
In |
Type |
Required |
Description |
x-auth-owner |
header |
string |
false |
The string id related with the document owner. It is mandatory when document is not public |
org_id |
path |
string |
true |
The string id related with one of Grupo MasOrange tenants |
documentId |
path |
string(uuid) |
true |
The string id related with one of Grupo MasOrange tenants/organizations |
body |
body |
ChangeOwnerRequest |
true |
The identifier of the new owner to whom ownership of the document is transferred |
1
2
3
|
{
"newOwner": "sUbScRiPtiOn_12123112a"
}
|
Name |
Type |
Required |
Description |
newOwner |
string |
false |
The identifier of the new owner of the document |
Request example
1
2
3
4
5
6
7
8
9
|
curl -X PUT https://documents.masstack.com/v1/orgs/masmovil/documents/d290f1ee-6c54-4b01-90e6-d701748f0851/owner \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "x-auth-owner: 2357893" \
--data-raw "{
'newOwner': 'sUbScRiPtiOn_12123112a'
}"
|