Add a Shape to an Excel Worksheet using Aspose.Cells Cloud API
This REST API adds a shape to an Excel worksheet.
The endpoint belongs to API version v3.0; ensure that you use a JWT access token obtained through the Aspose Cloud OAuth2 flow (client‑id/client‑secret) and include it in the Authorization: Bearer <token> header.
Security and Authentication
The Aspose.Cells Cloud APIs are secure and require JWT token-based authentication.
REST API
PUT https://api.aspose.cloud/v3.0/cells/{name}/worksheets/{sheetName}/shapes
Request parameters
| Parameter Name | Type | Location | Description |
|---|---|---|---|
| name | string | path | Document name. |
| sheetName | string | path | Worksheet name. |
| shapeDTO | object | body | JSON object that describes the shape to be added (see the OpenAPI specification for the full schema). |
| drawingType | string | query | Shape object type (e.g., arc, line, rectangle). |
| upperLeftRow | integer | query | Upper‑left row index of the shape. |
| upperLeftColumn | integer | query | Upper‑left column index of the shape. |
| top | integer | query | Vertical offset of the shape from its top edge, in pixels. |
| left | integer | query | Horizontal offset of the shape from its left edge, in pixels. |
| width | integer | query | Width of the shape, in pixels. |
| height | integer | query | Height of the shape, in pixels. |
| folder | string | query | Folder that contains the document. |
| storageName | string | query | Name of the storage. |
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 make a call to the Cloud API with cURL.
Response Codes
| Code | Description |
|---|---|
| 200 | Shape added successfully. |
| 400 | Bad Request – missing/invalid parameters. |
| 401 | Unauthorized – invalid or missing JWT token. |
| 404 | Not Found – worksheet or document does not exist. |
Typical error responses include:
- 400 Bad Request – missing or invalid parameters.
- 401 Unauthorized – invalid or missing JWT token.
- 404 Not Found – the specified worksheet or document does not exist.
Each error is returned as a JSON object containing Code and Message fields.
Cloud SDK Family
Using an SDK is the best way to speed up development. An SDK handles low‑level details so you can 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 call Aspose.Cells web services using various SDKs: