@panviva/toolkit-node-sdk v1.0.3
Panviva.Sdk
Introduction
Wouldn't it be great if you could share information seamlessly? This JavaScipt 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 Pty. Ltd. to help streamline integrations 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 & API instance.
If you see an error while using the connector you may look up the error code for more information. Note: the HTTP status code in the documentation may be slightly different than what you see in Power Automate or Power Apps, please use the Error Code field for lookup purposes.
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 API instance 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")
Setup For PanvivaClient in a NodeJs environment
Setting up .Net Core project
Install the panviva.sdk package into node_modules and save it as a dependency in the package.json.
- Run this command from the command-line in the same folder as your package.json:
npm install --save panviva.sdk
Import the Panviva client and the ResourceApiKeys enum from panviva.sdk into the file you wish to use it in.
- Example:
const { PanvivaClient, ResourceApiKeys } = require('testpanviva');
Instantiate new PanvivaClient
- To create a new client:
var panvivaClient = new PanvivaClient("_Your instance name here_", "https://api.panviva.com");
Note : Base Url is optional by default it will be
https://api.panviva.com
. You can provide a value to override the default.Set the subscription key
- panvivaClient.setApiKey(ResourceApiKeys.apiKeyHeader, "replace with subscription key");
Now you can make a request to the PanvivaApis if you have entered everything above correctly
- An example of searching artefacts is:
panvivaClient.searchArtefacts("_your instance name here_", "_your query_").then((response) => { console.log(response.body); }) .error((error) => console.log(error)).catch((ex) => console.log(ex));
- An example of searching artefacts is: