Lock Excel Files
API Version: v3.0 (current)
This REST API locks Excel workbooks.
REST API
POST https://api.aspose.cloud/v3.0/cells/lock
Prerequisites – The request must be sent over HTTPS and include a valid OAuth 2.0 Bearer token in the Authorization header.
The request parameters are
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| file | file | form‑data (multipart body) | The Excel workbook to be uploaded and locked. |
| password | string | query string | Password for the workbook (optional). |
The OpenAPI Specification defines a publicly accessible programming interface and lets you carry out REST interactions directly from a web browser.
You can use the cURL command‑line tool to access Aspose.Cells web services easily. The following example shows how to call the Cloud API with cURL.
Response details
| Field | Type | Description |
|---|---|---|
| Filename | string | Name of the locked workbook returned by the service. |
| FileSize | integer | Size of the locked file in bytes. |
| FileContent | string (Base64) | The locked workbook encoded as a Base64 string. |
To retrieve the locked workbook, decode the FileContent value from Base64 and save it using the Filename provided in the response.
Error handling
– The API returns standard HTTP status codes (e.g., 400 Bad Request, 401 Unauthorized, 500 Internal Server Error) together with a JSON error object that contains Code and Message fields.
Cloud SDK Family
Using an SDK is the best way to speed up development. An SDK abstracts low‑level details, allowing you to focus on your project tasks. Please check out the GitHub repository for a complete list of Aspose.Cells Cloud SDKs.
The following code examples demonstrate how to make calls to Aspose.Cells web services using various SDKs: