@@ -317,35 +317,27 @@ Config.json file:
317
317
Go code:
318
318
319
319
```
320
- // Start README example
321
-
322
- // init words cloud api
323
- config, _ := models.NewConfiguration(configFilePath)
324
- wordsApi, ctx, _ := api.CreateWordsApi(config)
325
-
326
- // upload test.docx to a cloud
327
- // remote.docx is a name in the cloud
328
- file, _ := os.Open(localFilePath)
329
- uploadRequest := &models.UploadFileRequest{
330
- FileContent: file,
331
- Path: &remotePath,
332
- }
333
- wordsApi.UploadFile(ctx, uploadRequest)
334
-
335
- // get a text for the first paragraph of the first section
336
- options := map[string]interface{}{
337
- "folder": remoteFolder,
338
- }
339
- request := &models.GetParagraphsRequest{
340
- Name: &remoteName,
341
- Optionals: options,
342
- }
343
-
344
- result, _, _ := wordsApi.GetParagraphs(ctx, request)
345
-
346
- fmt.Println(result.Paragraphs.ParagraphLinkList[0].Text)
347
-
348
- // End README example
320
+ // Start README example
321
+
322
+ // init words cloud api
323
+ config, _ := models.NewConfiguration(configFilePath)
324
+ wordsApi, ctx, _ := api.CreateWordsApi(config)
325
+
326
+ // upload test.docx to a cloud
327
+ // remote.docx is a name in the cloud
328
+ file, _ := os.Open(localFilePath)
329
+ wordsApi.UploadFile(ctx, file, remotePath, nil)
330
+
331
+ // get a text for the first paragraph of the first section
332
+ options := map[string]interface{}{
333
+ "folder": remoteFolder,
334
+ }
335
+
336
+ result, _, _ := wordsApi.GetParagraphs(ctx, remoteName, options)
337
+
338
+ fmt.Println(result.Paragraphs.ParagraphLinkList[0].Text)
339
+
340
+ // End README example
349
341
```
350
342
351
343
[ Product Page] ( https://products.aspose.cloud/words/go ) | [ Documentation] ( https://docs.aspose.cloud/display/wordscloud/Home ) | [ API Reference] ( https://apireference.aspose.cloud/words/ ) | [ Code Samples] ( https://github.com/aspose-words-cloud/aspose-words-cloud-go ) | [ Blog] ( https://blog.aspose.cloud/category/words/ ) | [ Free Support] ( https://forum.aspose.cloud/c/words ) | [ Free Trial] ( https://dashboard.aspose.cloud/#/apps )
0 commit comments