1.0.0 • Published 4 years ago
@panviva/sdk v1.0.0
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
Setting up .Net Core project
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
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:
Available PanvivaClient methods
1.0.0
4 years ago