伙計們,過去打印、簽署、掃描和郵寄文件的繁瑣的簽署文件的工作已經一去不復返了。現在,在這個數字時代,在線文檔簽名選項使生活變得更加輕鬆。 GroupDocs.Signature Cloud REST API 經過測試且可靠的電子簽名 REST API,可在您的應用程序中添加電子簽名的功能,而無需安裝任何第三方軟件。它可以通過應用文本、圖章、QR 碼、條形碼、圖像和數字簽名來幫助您以電子方式保護文檔。 GroupDocs.Signature Cloud 19.5新版本發布。

請查看此版本的詳細發行說明,以了解此版本中的所有新功能/增強功能。

什麼是新的

API版本 - 推出API版本V2

身份驗證 - JWT(JSON Web Token) 身份驗證

簽名 API - 用於創建、驗證和搜索簽名的簡化 API 方法,與獲取文檔的附加信息相同

文件API – 引入了上傳、下載、複製、移動、刪除文件的方法:輸入文檔和渲染結果,在雲存儲中

文件夾 API - 引入了在雲存儲中創建、複製、移動、刪除文件夾的方法

Storage API - 引入了獲取存儲信息和文件信息的方法

怎麼運行的

此版本的主要變化是引入了V2 API版本,它是全新的API版本。它是更簡化的 API,具有更少的方法和選項。同時,其內部架構也更加優化和精緻。在此版本中,API 包含使用雲存儲的方法。因此,您可以使用 GroupDocs.Signature Cloud REST API 執行存儲操作,而不是使用單獨的 API。

這裡我們將向您展示 GroupDocs.Signature Cloud V2 API 版本的工作原理,它與 V1 有所不同。我們將按照以下步驟使用 V1 和 V2 在 Word 文檔中添加條形碼簽名:

  • 檢索訪問令牌
  • 將源文檔上傳至存儲
  • 將條形碼簽名添加到源文檔

從以下 cURL 示例中您可以注意到,我們在 V2 示例中使用了 JWT 身份驗證。請注意,V2 不再支持 V1 API 版本的 OAuth 2.0 和 URL 簽名請求身份驗證方法。現在,V2 API 版本支持 JWT(JSON Web Token) 身份驗證。

在新的發布方法中,我們使用V2 API的File方法將文件上傳到存儲,而不是GroupDocs.Storage Cloud方法。最後一個與以下示例的區別(但並非最不重要)是,在 V2 中,通過將簽名詳細信息作為參數傳遞,可以將單個 API 創建用於所有支持的簽名類型。然而,在 V1 中,我們習慣於為每種簽名類型調用不同的 API。

V1.1 示例

### Retrieve access token
### TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required).
curl "https://api.groupdocs.cloud/oauth2/token" 
-X POST 
-d "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]" 
-H "Content-Type: application/x-www-form-urlencoded" 
-H "Accept: application/json"

### Upload file to Aspose Cloud Storage
curl "https://api.aspose.cloud/v1.1/storage/file?path=one-page.docx" 
-X PUT 
-T C:/Temp/one-page.docx 
-H "Content-Type: multipart/form-data" 
-H "Accept: application/json" 
-H "Authorization: Bearer [ACCESS_TOKEN]"

### Add Barcode Signature to Document
curl "https://api.groupdocs.cloud/v1/signature/one-page.docx/barcode"
-X POST
-H "accept: application/json"
-H "Content-Type: application/json"
-H "authorization: Bearer [ACCESS_TOKEN]"
-d "{"BarcodeTypeName": "Code128","BorderVisiblity" : true,"BorderDashStyle" : "DashDotDot","BorderWeight" : 1,"Opacity" : 0.5,"Margin": {"All": 0,"Left": 0,"Top": 0,"Right": 0,"Bottom": 0},"SheetNumber": 1,"RowNumber": 11,"ColumnNumber": 22,"BorderVisiblity": true,"BorderDashStyle": 5,"BorderTransparency": 0.0,"BorderWeight": 1.0,"BackgroundTransparency": 0.1,"SignatureImplementation": "TextStamp","Text": "John Smith","Width": 100,"Height": 100,"LocationMeasureType": "Pixels","SizeMeasureType": "Pixels","RotationAngle": 0,"HorizontalAlignment": "Right","VerticalAlignment": "Center","MarginMeasureType": "Pixels","SignAllPages": false,"Font": {"FontFamily": "Times New Roman","FontSize": 14.0,"Bold": false,"Italic": false,"Underline": false},"ForeColor": {"Web": "Black"},"BorderColor": {"Web": "Black"},"BackgroundColor": {"Web": "OrangeRed"},"OptionsType": "WordsSignBarcodeOptionsData"}"

V2.0示例

### Retrieve access token JWT(JSON Web Token)
### TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required).
curl -v "https://api.groupdocs.cloud/connect/token"
-X POST 
-H "Content-Type: application/x-www-form-urlencoded" 
-D "grant_type=client_credentials&client_id=[APP_SID]&client_secret=[APP_KEY]"

### Upload file into the storage
curl --request POST "https://api.groupdocs.cloud/v2/signature/storage/file/one-page.docx" 
--header "authorization: Bearer [ACCESS_TOKEN]" 
--data-binary @"c:\temp\one-page.docx"

### Add Barcode Signature to Document
curl "https://api.groupdocs.cloud/v2.0/signature/create" 
-X POST
-H  "accept: application/json" 
-H  "authorization: Bearer [ACCESS_TOKEN(JWT)]" 
-H  "Content-Type: application/json" 
-d "{"FileInfo": { "FilePath": "one-page.docx",    "StorageName": "", "VersionId": "", "Password": ""  },  "SaveOptions": { "OverwriteExisting": true, "OutputFilePath": "result-one-page.docx", "SaveFormat": "docx"  },  "SignOptions": [    {  "DocumentType": "WordProcessing",  "SignatureType": "Barcode",    "Page": 1,  "AllPages": false,  "PagesSetup": {    "FirstPage": false,    "LastPage": true,    "OddPages": false,    "EvenPages": true,    "PageNumbers": [1]  },  "Text": "John Smith",  "BarcodeType": "Code128",  "Left": 2,  "Top": 2,  "Width": 200,  "Height": 100,  "Stretch": "None",  "RotationAngle": 45,  "HorizontalAlignment": "Left",  "VerticalAlignment": "Center",  "LocationMeasureType": "Pixels",  "SizeMeasureType": "Pixels",  "Margin": {  "All": 5,  "Left": 5,  "Top": 5,  "Right": 5,    "Bottom": 5  },  "MarginMeasureType": "Pixels",  "Font": { "FontFamily": "Times New Roman",  "FontSize": 14.0,    "Bold": false,    "Italic": false,  "Underline": false  },  "ForeColor": {    "Web": "DarkOrange"  },  "BorderColor": {  "Web": "DarkOrange",    "Alpha": "20",  },  "BackgroundBrush":   {  "Color": {"Web": "DarkBlue"},  "BrushType": "SolidBrush"  },  "BorderVisiblity": true,  "BorderDashStyle": "Dash",  "BorderTransparency": 0.55,  "BorderWeight": 12.0,  "BackgroundTransparency": 0.8,  "TextHorizontalAlignment": "Left",  "TextVerticalAlignment": "Top",  "Opacity": 0.5,  "CodeTextAlignment": "Below",  "InnerMargins": { "All": 5, "Left": 5,    "Top": 5,    "Right": 5,    "Bottom": 5  },} ]}"

提供反饋信息

請隨時在下面發表評論,分享您對新版本 GroupDocs.Signature Cloud 19.5 的想法。或者訪問我們的支持論壇,如果您有任何建議或者您希望我們的 API 具有任何特定功能/改進,請告訴我們。

如果您還沒有機會嘗試我們的 REST API,請立即開始免費試用。您所需要的只是註冊 groupdocs.cloud。註冊後,您就可以嘗試 groupdocs.cloud 提供的強大文件處理功能。