Panviva SDK
Introduction
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.
Prerequisites
To use the Panviva SDK, you must have:
- Access to a Panviva instance (also known as a tenant)
- A developer account on the Panviva developer portal (dev.panviva.com)
- 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.
How to get credentials
Follow the steps below to get your API key & instance name.
To get your API key you must:
- Sign into the Panviva developer portal at dev.panviva.com
- Navigate to your profile (click your name then click "Profile" from the top navigation bar)
- Your should now see your API key under "Your Subscriptions" section of your profile.
To get your instance name you must:
- Sign into the Panviva developer portal at dev.panviva.com
- Navigate to your API (click "APIs" from the top navigation bar)
- You should now see your API instance under your API suite (look for "The instance name for the API Suite is")
Installation
To install @panviva/node-sdk:
# Run this command in your project root
# with npm
npm install --save @panviva/node-sdk
# with yarn
yarn add @panviva/node-sdk
Set up:
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.com`
panvivaClient.setApiKey(ResourceApiKeys.apiKeyHeader, '_Your API key_');
Example request:
panvivaClient
.searchArtefacts({ simplequery: '*' })
.then((response) => {
console.log(response);
})
.catch((ex) => console.error(ex));
Available client methods
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. |