Protect the unprotected Document

This REST API adds a protection to a document.

A password is always required. If you want to change the type of protection, then ProtectionType is required. If you want to change the password, then NewPassword is required. If you want to change both of the type of protection and the password, then both ProtectionType and NewPassword are required.

Important properties are the following:

Property Name Type Description
ProtectionType string Document protection type, one from: AllowOnlyComments, AllowOnlyFormFields, AllowOnlyRevisions, ReadOnly, NoProtection.
Password string Current document protection password.
NewPassword string New document protection password.

Usage examples with cURL and Postman

You can carry out REST API interactions using cURL and Postman. Please read these instructions to receive a personal JWT_TOKEN for authorization.

Aspose.Words Cloud SDK Family

Using SDK is the best way to speed up the development. Please go to the GitHub repository to explore a wide family of our Cloud SDKs. These powerful libraries take care of all low-level programming details and let you focus on your primary tasks.

Usage examples in Python, Java, C#, etc.

The following code samples show how to interact with the REST API using almost any mainstream programming language.

You can find a lot of other examples in Python, Java, C#, JavaScript, PHP, C++, Golang, Ruby, Swift, Dart on GitHub. All codes are thoroughly tested and ready for production use.