  
npm install @panviva/node-sdk!npm !npm bundle size (scoped) !npm (scoped)
Wouldn't it be great if you could share information seamlessly? This JavaScript SDK allows you to push your knowledge further and consume a complete list of Panviva's API offerings within your application. This is a simple NPM package provided by Panviva to help streamline integration with Panviva APIs within JavaScript environments.
1. Access to a Panviva instance (also known as a tenant)
2. A developer account on the Panviva developer portal (dev.panviva.com)
3. An active Panviva API subscription (also known as an API plan) and valid Panviva API credentials
If you are not a customer or need help visit www.panviva.com/support.
Follow the steps below to get your API key & instance name.
To get your API key you must:
1. Sign into the Panviva developer portal at dev.panviva.com
2. Navigate to your profile (click your name then click "Profile" from the top navigation bar)
3. Your should now see your API key under "Your Subscriptions" section of your profile.
To get your instance name you must:
1. Sign into the Panviva developer portal at dev.panviva.com
2. Navigate to your API (click "APIs" from the top navigation bar)
3. You should now see your API instance under your API suite (look for "_The instance name for the API Suite is_")
To install @panviva/node-sdk:
``shRun this command in your project root
with npm
npm install --save @panviva/node-sdk
Set up:
`js
const { PanvivaClient, ResourceApiKeys } = require('@panviva/node-sdk');const panvivaClient = new PanvivaClient('_Your instance name here_');
// You can provide a base URL as the second argument, it defaults to
https://api.panviva.companvivaClient.setApiKey(ResourceApiKeys.apiKeyHeader, '_Your API key_');
`Example request:
`js
panvivaClient
.searchArtefacts({ simplequery: '*' })
.then((response) => {
console.log(response);
})
.catch((ex) => console.error(ex));
``| Method Name | Parameter Name | Parameter Type | Description |
|---|---|---|---|
| getArtefactById | id | string | The id (ID) of an artefact |
| getArtefactCategories | options (optional) | any | Override HTTP request options. |
| getArtefactCategoryPost | postArtefactCategoryRequest | PostArtefactCategoryRequest | JSON object containing the category name |
| options (optional) | any | Override HTTP request options. | |
| getContainerById | id | string | The id of a document container |
| options (optional) | any | Override HTTP request options. | |
| getDocumentById | id | string | A document unique identifier, Document ID. If a document is a translated document, this value represents Internal ID or IID in Panviva API v1. |
| version (optional) | integer | Request the API to return a particular version of the specified document. | |
| options (optional) | any | Override HTTP request options. | |
| getDocumentByIdContainers | id | string | A document unique identifier, Document ID. If a document is a translated document, this value represents Internal ID or IID in Panviva API v1. |
| options (optional) | any | Optional parameter to Override HTTP request options. | |
| getDocumentByIdContainersRelationships | id | string | A document unique identifier, Document ID. If a document is a translated document, this value represents Internal ID or IID in Panviva API v1. |
| options (optional) | any | Override HTTP request options. | |
| getDocumentByIdTranslations | id | string | A document unique identifier, Document ID. If a document is a translated document, this value represents Internal ID or IID in Panviva API v1. |
| options (optional) | any | Override HTTP request options. | |
| getFileById | id | string | The internal id (IID) of a Panviva file (external document) |
| options (optional) | any | Override HTTP request options. | |
| getDocumentByIdContainers | id | string | A document unique identifier, Document ID. If a document is a translated document, this value represents Internal ID or IID in Panviva API v1. |
| options (optional) | any | Override HTTP request options. | |
| getFolderById | id | string | The internal id (IID) of a Panviva folder |
| options (optional) | any | Override HTTP request options. | |
| getFolderByIdChildren | id | string | The internal id (IID) of a Panviva folder |
| options (optional) | any | Override HTTP request options. | |
| getFolderByIdTranslations | id | string | The internal id (IID) of a Panviva folder |
| options (optional) | any | Override HTTP request options. | |
| getFolderRoot | id | string | The internal id (IID) of a Panviva folder |
| getImageById | id | string | The id of a Panviva image |
| options (optional) | any | Override HTTP request options. | |
| searchArtefacts | simplequery | string | Natural language query string. For example: Action Movies (Note: Use simplequery OR advancedquery, not both.) |
| advancedquery | string | Query string written in Lucene query syntax. For example: films AND books\. (Note: Use simplequery OR advancedquery, not both.) | |
| filter (optional) | string | Accepts a Lucene-formatted filter string. Examples: category/name eq 'Mortgages', panvivaDocumentVersion gt '8' (Filterable fields include dateCreated, dateModified, dateDeleted, category/name, category/dateCreated, category/dateModified, metaData/keyword/values, metaData/keyword/dataType, title, primaryQuery, isDeleted, timestamp, panvivaDocumentId, panvivaDocumentVersion, id) | |
| channel (optional) | string | Return response for a specific channel, instead of the default | |
| pageOffset (optional) | integer | The pagination offset to denote the number of initial search results to skip. For example, pageOffset of 100 and pageLimit of 10 would return records 101-110. | |
| pageLimit (optional) | any | The number of records to return. Must be an integer between 0 and 1000. | |
| facet (optional) | string | Accepts a Lucene-formatted facet string. Examples: facet=metaData/keyword/values (Facetable fields include metaData/values) | |
| options (optional) | any | Override HTTP request options. | |
| postLiveCsh | postLiveCshRequest | PostLiveCshRequest | JSON object containing information required to perform a live activity |
| options (optional) | any | Override HTTP request options. | |
| postliveDocument | postLiveDocumentRequest | PostLiveDocumentRequest | JSON object containing information required to perform a live activity |
| options (optional) | any | Override HTTP request options. | |
| postLiveSearch | postLiveSearchRequest | PostLiveSearchRequest | JSON object containing information required to perform a live activity |
| options (optional) | any | Override HTTP request options. | |
| search | term | string | The word or phrase to be searched for |
| pageOffset (optional) | integer | The pagination offset to denote the number of initial search results to skip. For example, pageOffset of 100 and pageLimit of 10 would return records 101-110. | |
| pageLimit (optional) | integer | The number of records to return. Must be an integer between 0 and 1000. | |
| options (optional) | any | Override HTTP request options. |