Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This Gist contains examples of groupdocs.cloud APIs for Blog Posts
GroupDocs-Cloud
### 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"}"
### 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 },} ]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.