Giter VIP home page Giter VIP logo

mautic-api-nodejs's Introduction

Synopsis

RESTFul API which works as a middle layer between http request (e.g: by ajax) and Mautic RESTful API.

Use

Motivation

In Acadevor we needed to connect with Mautic as our core marketing automation's engine.

Installation

Create config.js based on sample.config.js in the same root

Change variables with yours (ACCESS_TOKEN and REFRESH_TOKEN are be filled later. Keep them blank so far...)

MAUTIC_BASE_URL: 'https://your-mautic-url.com/',
MAUTIC_REDIRECT_URI: 'http://localhost:3000/auth/callback',
MAUTIC_PUBLIC_KEY: 'MAUTIC_PUBLIC_KEY',
MAUTIC_SECRET_KEY: 'MAUTIC_SECRET_KEY',
ACCESS_TOKEN: 'ACCESS_TOKEN',
REFRESH_TOKEN: 'REFRESH_TOKEN'

Run

npm install

npm start

Open in your browser

localhost:3000/auth

Fill your mautic credentials

After submit you will be redirected to localhost:3000/auth/callback

Copy access_token and refres_token from displayed response

{"access_token":"(YTFhZDg5MzUyM451M2JhY2YyODk32FKIKG1N2E4ZmQ2ZmJmMDJmYzY1NmE0Mjk0NGMxNjhmNTdmZDljZTDNiNQ)","expires_in":2160000000000,"token_type":"bearer","scope":null,"refresh_token":"OTYzNjUzYzg2M2U5MJkOGY1YjA2MjJlMDAzYMmJlMGI2NDk1ZWNMyZDJZmNDE5MDdhZmNhMQ","expires_at":"+070464-08-01T23:19:40.235Z"}

And paste them into config.js

Go to

localhost:3000/api/contacts

If you see a json with contacts response you did it right ๐Ÿ‘ !!!!!

API Reference

Endpoints at /api/....

GET /contacts get json of contacts @querystring search=field:value

POST /contact create a new contact @body: { 'email' : '[email protected]', }

PATCH /contact update a contact @body: { 'email' : '[email protected]', }

localhost:3000/api/contacts

Tests

Oops....

Contributors

Want to extend? write me at: [email protected]

License

MIT licence

mautic-api-nodejs's People

Contributors

nachomazzara avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.