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:

NameDescriptionComment
FilePathThe file path in the storageRequired property
StorageNameStorage nameIt could be omitted for default storage.
VersionIdFile version IdUseful for storages that support file versioning
PasswordThe password to open fileShould be specified only for password-protected documents
OutputPathPath to resultant documentRequired

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 App Key and App SID from https://dashboard.groupdocs.cloud/#/apps. Kindly place App Key in "client_secret" and App SID in "client_id" 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:

NameTypeDescription
filePathstringPath to document to append. Query parameter. Required.
storageNamestringStorage name. Query parameter. Optional
versionIdstringFile 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 App Key and App SID from https://dashboard.groupdocs.cloud/#/apps. Kindly place App Key in "client_secret" and App SID in "client_id" 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:

NameDescriptionComment
FilePathThe file path in the storageRequired property
StorageNameStorage nameIt could be omitted for default storage.
VersionIdFile version IdUseful for storages that support file versioning
PasswordThe password to open fileShould be specified only for password-protected documents
OutputPathPath to resultant documentRequired

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 App Key and App SID from https://dashboard.groupdocs.cloud/#/apps. Kindly place App Key in "client_secret" and App SID in "client_id" 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:

NameDescriptionComment
FilePathFile path in storageRequired property
StorageNameStorage nameCould be omitted for default storage.
VersionIdFile version IdUseful for storages that support file versioning
PasswordThe password to open fileRequired
NewPasswordNew passwordRequired
OutputPathPath to resultant documentRequired

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 App Key and App SID from https://dashboard.groupdocs.cloud/#/apps. Kindly place App Key in "client_secret" and App SID in "client_id" 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.

Update Document Password