Добавить цифровую подпись для рабочей книги Excel Этот REST API указывает на добавление digital signature
для книги Excel.
РСЕТ API
Copy
POST http://api.aspose.cloud/v3.0/cells/{ name} /digitalsignature
Параметры запроса:
Имя параметра
Тип
Путь/строка запроса/HTTPBody
Описание
имя
нить
путь
Имя рабочей книги.
файл цифровой подписи
нить
запрос
Параметры файла цифровой подписи.
пароль
нить
запрос
папка
нить
запрос
Папка рабочей тетради.
имя_хранилища
нить
запрос
имя хранилища.
Спецификация OpenAPI определяет общедоступный интерфейс программирования и позволяет выполнять взаимодействие с REST непосредственно из веб-браузера.
Вы можете использовать инструмент командной строки cURL для легкого доступа к веб-службам Aspose.Cells. В следующем примере показано, как позвонить на Cloud API с помощью cURL.
Семейство облачных SDK
Использование SDK — лучший способ ускорить разработку. SDK заботится о деталях низкого уровня и позволяет вам сосредоточиться на задачах проекта. Пожалуйста, ознакомьтесь сРепозиторий GitHub для получения полного списка Aspose.Cells Cloud SDK.
Следующие примеры кода демонстрируют, как выполнять вызовы веб-служб Aspose.Cells с использованием различных SDK:
C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Aspose.Cells.Cloud.SDK.Tests.Api.Example
{
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Aspose.Cells.Cloud.SDK.Request;
using System.Collections.Generic;
using Aspose.Cells.Cloud.SDK.Api;
using System;
using System.IO;
[TestClass]
public class CellsApiExample
{
CellsApi cellsApi = new CellsApi(Environment.GetEnvironmentVariable("CellsCloudTestClientId"), Environment.GetEnvironmentVariable("CellsCloudTestClientSecret"));
private readonly string remoteFolder = "TestData/In";
string localName = "Book1.xlsx";
string remoteName = "remote_book1.xlsx";
string localPath = "D:/TestData/CellsCloud";
[TestCategory("Cells")]
[TestMethod]
public void Example()
{
UploadFileRequest uploadFileRequest = new UploadFileRequest();
FileInfo fileInfo = new FileInfo(localPath + "/" + localName);
uploadFileRequest.path = remoteFolder + "/" + remoteName;
uploadFileRequest.storageName = "";
uploadFileRequest.UploadFiles = new Dictionary<string, Stream>() { { localName, File.OpenRead(localPath +"/"+ localName) } };
cellsApi.UploadFile(uploadFileRequest);
PostDigitalSignatureRequest request = new PostDigitalSignatureRequest { name = remoteName, digitalsignaturefile = "DigitalSignature.pfx", password = "123456", folder = remoteFolder };
cellsApi.PostDigitalSignature(request);
}
}
}
Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.aspose.cloud.cells.api;
import com.aspose.cloud.cells.client.*;
import com.aspose.cloud.cells.model.*;
import com.aspose.cloud.cells.request.*;
import java.io.IOException;
import org.junit.Test;
import java.util.ArrayList;
import java.util.List;
import java.io.File;
import java.util.HashMap;
public class Example {
private CellsApi api;
public Example(){
try {
api = new CellsApi(
System.getenv("CellsCloudClientId"),
System.getenv("CellsCloudClientSecret"),
"v3.0",
System.getenv("CellsCloudApiBaseUrl")
);
} catch (ApiException e) {
e.printStackTrace();
}
}
public void Run(){
try{
String remoteFolder = "TestData/In";
String localName = "Book1.xlsx";
String remoteName = "Book1.xlsx";
UploadFileRequest uploadFileRequest = new UploadFileRequest();
uploadFileRequest.setPath( remoteFolder + "/" + remoteName );
uploadFileRequest.setStorageName( "");
HashMap<String,File> files = new HashMap<String,File>();
files.put( localName , new File(localName ));
uploadFileRequest.setUploadFiles(files);
api.uploadFile(uploadFileRequest);
PostProtectWorkbookRequest request = new PostProtectWorkbookRequest();
request.setName(remoteName);
request.setProtectWorkbookRequest(protection);
request.setFolder(remoteFolder);
request.setStorageName("");
CellsCloudResponse response = api.postProtectWorkbook(request);
} catch (ApiException e) {
e.printStackTrace();
}catch (IOException e) {
e.printStackTrace();
}
}
}
PHP
Ruby
Node.js
Android
Perl
Go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main
import (
"os"
. "github.com/aspose-cells-cloud/aspose-cells-cloud-go/v25"
)
func main() {
instance := NewCellsApiService(os.Getenv("ProductClientId"), os.Getenv("ProductClientSecret"))
requestOpts := new(PostDigitalSignatureRequest)
requestOpts.Digitalsignaturefile = "roywang.pfx"
requestOpts.Folder = "CellsTests"
requestOpts.Name = "Book1.xlsx"
requestOpts.Password = "123456"
_, _, err := instance.PostDigitalSignature(requestOpts)
if err != nil {
return
}
}
Python