Security Operations
Add Document Password Protection
This REST API allows adding document password protection. API endpoint accepts document storage path as input payload and returns path to the created a password-protected document.
The description of the important API parameters is given below:
Name | Description | Comment |
---|---|---|
FilePath | The file path in the storage | Required property |
StorageName | Storage name | It could be omitted for default storage. |
VersionId | File version Id | Useful for storages that support file versioning |
Password | The password to open file | Should be specified only for password-protected documents |
OutputPath | Path to resultant document | Required |
Resource URI
HTTP PUT ~/password
Swagger UI lets you call this REST API directly from the browser.
cURL Example
* First get JSON Web Token
* Please get your Client Id and Client Secret from https://dashboard.groupdocs.cloud/applications. Kindly place Client Id in "client_id" and Client Secret in "client_secret" argument.
curl -v "https://api.groupdocs.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=xxxx&client_secret=xxxx" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
* cURL example to get document information
curl -v "https://api.groupdocs.cloud/v1.0/merger/password" \
-X PUT
-H "Authorization: Bearer
<jwt token>"
-d "{
'FileInfo': { 'FilePath': 'words/four-pages.docx'},
'Password': 'Password',
'OutputPath': 'output/add-password.docx'
}"
{
"path": "output/add-password.docx"
}
SDKs
Using an SDK (API client) is the quickest way for a developer to speed up the development. An SDK takes care of a lot of low-level details of makingRequests and handlingResponses and lets you focus on writing code specific to your particular project. Check out our GitHub repository for a complete list of GroupDocs.Merger Cloud SDKs along with working examples, to get you started in no time. Please check to Get Supported File Formats article to learn how to add an SDK to your project.
Add Document Password Protection
Check the Document for Password Protection
This REST API allows checking the document for password-protection. The result will be true if the document has a password for the opening set, in another case false will be returned. The endpoint accepts the file path as a query string parameter and returns the IsPasswordSet flag.
The description of the important API parameters is given below:
Name | Type | Description |
---|---|---|
filePath | string | Path to document to append. Query parameter. Required. |
storageName | string | Storage name. Query parameter. Optional |
versionId | string | File version id. Query parameter. Optional |
Resource URI
HTTP GET ~/password?filePath#{filePath}
Swagger UI lets you call this REST API directly from the browser.
cURL Example
* First get JSON Web Token
* Please get your Client Id and Client Secret from https://dashboard.groupdocs.cloud/applications. Kindly place Client Id in "client_id" and Client Secret in "client_secret" argument.
curl -v "https://api.groupdocs.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=xxxx&client_secret=xxxx" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
* cURL example to get document information
curl -v "https://api.groupdocs.cloud/v1.0/merger/password?filePath#%2Fwords%2Fpassword-protected.docx" \
-X GET
-H "Authorization: Bearer
<jwt token>"
{
"isPasswordSet": true
}
SDKs
Using an SDK (API client) is the quickest way for a developer to speed up the development. An SDK takes care of a lot of low-level details of makingRequests and handlingResponses and lets you focus on writing code specific to your particular project. Check out our GitHub repository for a complete list of GroupDocs.Merger Cloud SDKs along with working examples, to get you started in no time. Please check to Get Supported File Formats article to learn how to add an SDK to your project.
Check the Document for Password Protection
Remove Document Password
This REST API allows removing the password from a password-protected document. API endpoint accepts document storage path as input payload and returns the path to document without password-protection. The description of the important API parameters is given below:
Name | Description | Comment |
---|---|---|
FilePath | The file path in the storage | Required property |
StorageName | Storage name | It could be omitted for default storage. |
VersionId | File version Id | Useful for storages that support file versioning |
Password | The password to open file | Should be specified only for password-protected documents |
OutputPath | Path to resultant document | Required |
Resource URI
HTTP DELETE ~/password
Swagger UI lets you call this REST API directly from the browser.
cURL Example
* First get JSON Web Token
* Please get your Client Id and Client Secret from https://dashboard.groupdocs.cloud/applications. Kindly place Client Id in "client_id" and Client Secret in "client_secret" argument.
curl -v "https://api.groupdocs.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=xxxx&client_secret=xxxx" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
* cURL example to get document information
curl -v "https://api.groupdocs.cloud/v1.0/merger/password" \
-X DELETE
-H "Authorization: Bearer
<jwt token>"
-d "{
'FileInfo': { 'FilePath': 'words/password-protected.docx'},
'Password': 'Password',
'OutputPath': 'output/remove-password.docx'
}"
{
"path": "output/remove-password.docx"
}
SDKs
Using an SDK (API client) is the quickest way for a developer to speed up the development. An SDK takes care of a lot of low-level details of makingRequests and handlingResponses and lets you focus on writing code specific to your particular project. Check out our GitHub repository for a complete list of GroupDocs.Merger Cloud SDKs along with working examples, to get you started in no time. Please check to Get Supported File Formats article to learn how to add an SDK to your project.
Remove Document Password
Update Document Password
This REST API allows updating the password for the password-protected document. The resultant document will have a new password. API endpoint accepts document storage path as input payload and returns path to document with a new password.
The description of the important API parameters is given below:
Name | Description | Comment |
---|---|---|
FilePath | File path in storage | Required property |
StorageName | Storage name | Could be omitted for default storage. |
VersionId | File version Id | Useful for storages that support file versioning |
Password | The password to open file | Required |
NewPassword | New password | Required |
OutputPath | Path to resultant document | Required |
Resource URI
HTTP POST ~/password
Swagger UI lets you call this REST API directly from the browser.
cURL Example
* First get JSON Web Token
* Please get your Client Id and Client Secret from https://dashboard.groupdocs.cloud/applications. Kindly place Client Id in "client_id" and Client Secret in "client_secret" argument.
curl -v "https://api.groupdocs.cloud/connect/token" \
-X POST \
-d "grant_type=client_credentials&client_id=xxxx&client_secret=xxxx" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json"
* cURL example to get document information
curl -v "https://api.groupdocs.cloud/v1.0/merger/password" \
-X POST
-H "Authorization: Bearer
<jwt token>"
-d "{
'FileInfo':
{
'FilePath': '/words/password-protected.docx',
'Password': 'Password',
},
'NewPassword': 'NewPassword',
'OutputPath': 'output/update-password.docx'
}"
{
"path": "output/update-password.docx"
}
Response
{
"path": "output/update-password.docx"
}
SDKs
Using an SDK (API client) is the quickest way for a developer to speed up the development. An SDK takes care of a lot of low-level details of makingRequests and handlingResponses and lets you focus on writing code specific to your particular project. Check out our GitHub repository for a complete list of GroupDocs.Merger Cloud SDKs along with working examples, to get you started in no time. Please check to Get Supported File Formats article to learn how to add an SDK to your project.