mrpbennett / npi-api-demo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pulsepoints NPI API demo repo

Here we have a working Python class that performs each task of the API.

To get started clone this repo

git clone https://github.com/mrpbennett/npi-api-demo.git

If you haven't already please install pipenv

pip install --user pipenv

OR

brew install pipenv

If you're using Homebrew

Once the repo has been cloned, from the command line enter the root directory and run the following:

pipenv install

This will install all the dependencies. Next, you will need to create a config.toml file in the root directory of this project. The file should have the following layout: (please replace xxx with your details, your account manager will need to provide you with the pp_auth info.)

[pp_auth]
client_id = 'xxx'
client_secret = 'xxx'
url = 'https://lifeapi.pulsepoint.com/RestApi/oauth/token'


[user]
username = "xxx"
password = "xxx"
account = "xxx"

Our current API request restrictions are as follows

  • GET: 1 request per 1 second
  • PUT, POST, PATCH, DELETE: 10 requests per 60 seconds

Get Started

Now you're ready to test the API. Head over to main.py where you're able to call each one of the endpoints via the NPIListAPIClass in npi_api_class.py. To do this please follow the instructions within the comments. You will also need to choose / create a list to test with. The ID in the code 11105 will need to be changed

When you're ready to test the endpoints, you will need to change the choice variable to the relevant number depending on which endpoint you wish to test. The choices are as follows:

  1. Get a single NPI list
  2. Get all NPI lists from an account
  3. Create an NPI list
  4. Replace NPIs within a list
  5. Add NPIs to a list
  6. Remove NPIs from a list

Once this is changed you will need to create an environment by running the following in the terminal:

pipenv shell

Once an environment has been created we can then run the program with our choice selected.

pipenv run python main.py

About


Languages

Language:Python 100.0%