Browse our Products

If so you can download any of the below versions for testing. The product will function as normal except for an evaluation limitation. At the time of purchase we provide a license file via email that will allow the product to work in its full capacity. If you would also like an evaluation license to test without any restrictions for 30 days, please follow the directions provided here.


Docs Swagger Examples Blog Support Dashboard

Installation

The package is available at npmjs.com and it can be installed via npm by executing the following command:

npm install groupdocs-metadata-cloud

NPM Version NPM Downloads NPM-GroupDocsCloud


Requirements

Dependencies

The SDK requires the following packages:

PackageConstraint
axios1.13.3
form-data*
jsonwebtoken9.0.1
qs6.14.1

Quick Start

Get your API credentials

To use GroupDocs.Metadata Cloud, sign up at GroupDocs.Cloud Dashboard and get your Client ID and Client Secret.

Initialize the API

Use the following code to start using the GroupDocs.Metadata Cloud SDK for Node.js. The constructor takes the Client ID, then the Client Secret.

"use strict";
const metadata_cloud = require("groupdocs-metadata-cloud");

const clientId = "YourClientId";
const clientSecret = "YourClientSecret";

const config = new metadata_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";

const metadataApi = metadata_cloud.MetadataApi.fromConfig(config);

See test_context.ts for more details.

Extract metadata

Once initialized, use this basic example to extract the metadata tree from a Word document in cloud storage.

"use strict";
const metadata_cloud = require("groupdocs-metadata-cloud");

const clientId = "YourClientId";
const clientSecret = "YourClientSecret";

const config = new metadata_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";

const metadataApi = metadata_cloud.MetadataApi.fromConfig(config);

const extractOptions = new metadata_cloud.ExtractOptions();
extractOptions.fileInfo = new metadata_cloud.FileInfo();
extractOptions.fileInfo.filePath = "documents/input.docx";
const request = new metadata_cloud.ExtractRequest(extractOptions);

metadataApi.extract(request).then((result) => {
    console.log(result.metadataTree.innerPackages.length);
});

See test_metadata_extract_api.ts for more details.

Set a Metadata Property

This example replaces the Creator property on a Word document.

"use strict";
const metadata_cloud = require("groupdocs-metadata-cloud");

const clientId = "YourClientId";
const clientSecret = "YourClientSecret";

const config = new metadata_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";

const metadataApi = metadata_cloud.MetadataApi.fromConfig(config);

const options = new metadata_cloud.SetOptions({
    fileInfo: new metadata_cloud.FileInfo(),
    properties: [
        new metadata_cloud.SetProperty({
            newValue: "NewAuthor",
            type: "String",
            searchCriteria: new metadata_cloud.SearchCriteria({
                tagOptions: new metadata_cloud.TagOptions({
                    exactTag: new metadata_cloud.Tag({
                        name: "Creator",
                        category: "Person"
                    })
                })
            })
        })
    ]
});
options.fileInfo.filePath = "documents/input.docx";
const request = new metadata_cloud.SetRequest(options);

metadataApi.set(request).then((result) => {
    console.log(result.setCount);
});

See test_metadata_set_api.ts for more details.

Remove Metadata by Tag

This example removes the Title property from a Word document.

"use strict";
const metadata_cloud = require("groupdocs-metadata-cloud");

const clientId = "YourClientId";
const clientSecret = "YourClientSecret";

const config = new metadata_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";

const metadataApi = metadata_cloud.MetadataApi.fromConfig(config);

const options = new metadata_cloud.RemoveOptions({
    fileInfo: new metadata_cloud.FileInfo(),
    searchCriteria: new metadata_cloud.SearchCriteria({
        tagOptions: new metadata_cloud.TagOptions({
            exactTag: new metadata_cloud.Tag({
                name: "Title",
                category: "Content"
            })
        })
    })
});
options.fileInfo.filePath = "documents/input.docx";
const request = new metadata_cloud.RemoveRequest(options);

metadataApi.remove(request).then((result) => {
    console.log(result.removedCount);
});

See test_metadata_remove_api.ts for more details.

Get Document Information

This example reads the file format and page count of a presentation.

"use strict";
const metadata_cloud = require("groupdocs-metadata-cloud");

const clientId = "YourClientId";
const clientSecret = "YourClientSecret";

const config = new metadata_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";

const infoApi = metadata_cloud.InfoApi.fromConfig(config);

const infoOptions = new metadata_cloud.InfoOptions();
infoOptions.fileInfo = new metadata_cloud.FileInfo();
infoOptions.fileInfo.filePath = "documents/input.pptx";
const request = new metadata_cloud.GetInfoRequest(infoOptions);

infoApi.getInfo(request).then((result) => {
    console.log(result.pageCount);
});

See test_metadata_info_api.ts for more details.

Get Supported Metadata Formats

Retrieve the file formats the API can read.

"use strict";
const metadata_cloud = require("groupdocs-metadata-cloud");

const clientId = "YourClientId";
const clientSecret = "YourClientSecret";

const config = new metadata_cloud.Configuration(clientId, clientSecret);
config.apiBaseUrl = "https://api.groupdocs.cloud";

const infoApi = metadata_cloud.InfoApi.fromConfig(config);

infoApi.getSupportedFileFormats().then((result) => {
    result.formats.forEach(function (format) {
        console.log(format.fileFormat);
    });
});

See test_formats_api.ts for more details.

Examples on GitHub

The GroupDocs.Metadata Cloud Node.js SDK repository includes the SDK and tests covering:

CategoryExamples
MetadataExtract, add, set, and remove metadata; search by tag or property name
InfoDocument information and supported file formats
StorageFile, folder, and storage operations

How to run the examples

  1. Clone or download the SDK repository
  2. Edit test/test_settings.json and set AppSid and AppKey
  3. Run npm install
  4. The tests are in test/api/
  5. Execute npm test

For more details, visit Getting Started.


Docs Swagger Examples Blog Support Dashboard


Tags

Document Metadata API | Node.js Cloud API | GroupDocs.Metadata Cloud | REST API | Metadata Extraction | Metadata Management | Metadata Filtering | Metadata Searching | Metadata Preservation | Cloud Storage Integration | File Management | Folder Management | File Versioning | Secure API Access | Cross-Platform API | PDF Metadata | Image Metadata | Video Metadata | Audio Metadata | Document Metadata Editing | MIT License



 English