Digitale Signatur für Excel Arbeitsbuch hinzufügen Dieser REST API gibt an, dass ein digital signature
für eine Excel-Arbeitsmappe hinzugefügt werden soll.
RSET API
Copy
POST http://api.aspose.cloud/v3.0/cells/{ name} /digitalsignature
Die Anforderungsparameter sind:
Parametername
Typ
Pfad/Abfragezeichenfolge/HTTPBody
Beschreibung
Name
Schnur
Weg
Name der Arbeitsmappe.
digitale Signaturdatei
Schnur
Abfrage
Parameter für digitale Signaturdateien.
Passwort
Schnur
Abfrage
Ordner
Schnur
Abfrage
Ordner der Arbeitsmappe.
Speichername
Schnur
Abfrage
Speichername.
DerOpenAPI-Spezifikation definiert eine öffentlich zugängliche Programmierschnittstelle und ermöglicht Ihnen, REST-Interaktionen direkt von einem Webbrowser aus durchzuführen.
Mit dem Befehlszeilentool cURL können Sie ganz einfach auf die Webdienste Aspose.Cells zugreifen. Das folgende Beispiel zeigt, wie Sie mit cURL Anrufe an Cloud API tätigen.
Cloud SDK-Familie
Die Verwendung eines SDK ist der beste Weg, um die Entwicklung zu beschleunigen. Ein SDK kümmert sich um Details auf niedriger Ebene und ermöglicht es Ihnen, sich auf Ihre Projektaufgaben zu konzentrieren. Bitte lesen Sie dieGitHub-Repository für eine vollständige Liste der Aspose.Cells Cloud SDKs.
Die folgenden Codebeispiele zeigen, wie Sie mit verschiedenen SDKs Aufrufe an die Webdienste Aspose.Cells tätigen:
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