Ministry Platform
an npm package for interacting with the Ministry Platform Rest API
Usage
Prerequisites
This package uses async/await, so requires a node version > 7.6
Build a request
currently, only GET requests with select columns, filters, and table in implemented.
const MP = ;const mp = ; const selectColumns = selectColumnsselectColumnsselectColumnsconst filter = `User_ID_Table_Contact_ID_Table.[Contact_ID] = 7680320 and Role_ID_Table.[Role_Name] LIKE 'pushpay'` const table = 'dp_User_Roles'const data = await mp console;
to run the above example, you can run
node example.js
, just remember to set your environment variables.
Development
Install dependencies
npm i
Run tests
npm test# or, to run tests as you change files npm test:watch
Environment Variables needed
- MP_REST_API_ENDPOINT = "https://adminint.crossroads.net/ministryplatformapi"
- MP_OAUTH_BASE_URL = "https://adminint.crossroads.net/ministryplatformapi/oauth"
- MP_USERNAME = "mpuser"
- MP_PASSWORD = "password1$3"
- MP_CLIENT_ID = "client-id"
- MP_CLIENT_SECRET = "mysecret"