Before you can make any requests to GroupDocs Cloud API you need to get Client Id and Client Secret. This will be used to invoke the GroupDocs Cloud API.
Using an SDK (API client) is the quickest way for a developer to speed up the development. An SDK takes care of a lot of low-level details of making requests and handling responses and lets you focus on writing code specific to your particular project. Please check article to learn how to add an SDK to your project.
Make an API request from the SDK of your choice
Use the Client Id and Client Secret from the API app client you created in step one and replace in the corresponding code. Below is an example demonstrating how to edit docx document using GroupDocs.Editor Cloud.
Note
The GitHub repository for GroupDocs.Editor Cloud has a complete set of examples, demonstrating our API capabilities.
// For complete examples and data files, please go to https://github.com/groupdocs-editor-cloud/groupdocs-editor-cloud-dotnet-samplesstringMyAppKey="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloudstringMyAppSid="";// Get AppKey and AppSID from https://dashboard.groupdocs.cloudvarconfiguration=newConfiguration(MyAppSid,MyAppKey);// Create necessary API instancesvareditApi=newEditApi(configuration);varfileApi=newFileApi(configuration);// The document already uploaded into the storage.// Load it into editable statevarloadOptions=newWordProcessingLoadOptions{FileInfo=newFileInfo{FilePath="WordProcessing/password-protected.docx",Password="password"},OutputPath="output"};varloadResult=editApi.Load(newLoadRequest(loadOptions));// Download html documentvarstream=fileApi.DownloadFile(newDownloadFileRequest(loadResult.HtmlPath));varhtmlString=newStreamReader(stream,Encoding.UTF8).ReadToEnd();// Edit something...htmlString=htmlString.Replace("Sample test text","Hello world");// Upload html back to storagefileApi.UploadFile(newUploadFileRequest(loadResult.HtmlPath,newMemoryStream(Encoding.UTF8.GetBytes(htmlString))));// Save html back to docxvarsaveOptions=newWordProcessingSaveOptions{FileInfo=loadOptions.FileInfo,OutputPath="output/edited.docx",HtmlPath=loadResult.HtmlPath,ResourcesPath=loadResult.ResourcesPath};varsaveResult=editApi.Save(newSaveRequest(saveOptions));
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.
On this page
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.