1.0.24 • Published 4 years ago
panviva.sdk v1.0.24
Panviva.Sdk
Introduction
This is a simple NPM package provided by Panviva Pty. Ltd. to help streamline integrations with Panviva APIs in a JavaScript environment.
Package Status
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: