https://github.com/sambarnes90/node-mautic
Node.js wrapper for the Mautic API
https://github.com/sambarnes90/node-mautic
mautic mautic-api nodejs
Last synced: 7 months ago
JSON representation
Node.js wrapper for the Mautic API
- Host: GitHub
- URL: https://github.com/sambarnes90/node-mautic
- Owner: sambarnes90
- License: gpl-3.0
- Created: 2018-02-20T15:43:54.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-22T08:47:58.000Z (over 6 years ago)
- Last Synced: 2024-09-20T02:18:21.317Z (about 1 year ago)
- Topics: mautic, mautic-api, nodejs
- Language: JavaScript
- Size: 24.4 KB
- Stars: 16
- Watchers: 2
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# !!! Project No Longer Maintined !!!
# Please use [@vdavid's improved version](https://github.com/vdavid/node-mautic)--------------------------------
# Node.js Wrapper for Mautic API

**Alpha** version of a basic wrapper to use the Mautic API in Node.js.
## Usage
- `npm install mautic-api-node`
- Require the module with `var mautic = require('mautic-api-node')`
- Update the mautic.config object with relevant details as per below:\
`mautic.config.base_url = "https://example.mautic.com";`\
`mautic.config.redirect_uri = "https://www.mautic.com";`\
`mautic.config.public_key = "EXAMPLE_PUBLIC_KEY";`\
`mautic.config.secret_key = "EXAMPLE_SECRET_KEY";`\
`mautic.config.state = "RANDOM_STATE";`\
`mautic.config.api_endpoint = "https://example.mautic.com/api";`
- Use `mautic.auth.checkAuth(callback)` to check auth and process the data with callback.
- You *must* run this from the command line first, perhaps using example.js - as this will create the token file needed to authenticate with the Mautic API.
- Callback will either receive a single parameter from these options:
- An `asset` object containing the JSON response from the API.
- An `error` string containing a relevant error message.
- An `error` object from the request itself.## Examples
- Please reference `example.js` for an example.
## Support
- Please raise an issue on the Github repo - https://github.com/sambarnes90/node-mautic
## Reference
- Attempted to follow the Mautic API Documentation (https://developer.mautic.org/) as closely as possible.