Code Monkey home page Code Monkey logo

enterprise-webhooks-nodejs-sdk's Introduction

MessageMedia Enterprise Webhooks NodeJS Code Guide

Pull Requests Welcome

The MessageMedia Enterprise Webhooks code guide demonstrates how you can verify webhooks signed and sent to you by MessageMedia.

Isometric

Table of Contents

πŸ“° Information

Slack and Mailing List

If you have any questions, comments, or concerns, please join our Slack channel: https://developers.messagemedia.com/collaborate/slack/

Alternatively you can email us at: [email protected]

Bug reports

If you discover a problem with the code guide, we would like to know about it. You can raise an issue or send an email to: [email protected]

Contributing

We welcome your thoughts on how we could best provide you with SDKs that would simplify how you consume our services in your application. You can fork and create pull requests for any features you would like to see or raise an issue

⭐ Prerequisite

To be able to use this SDK, you will need a public key provided by MessageMedia. You can find out how to do this by going through the Signature Key Management documentation. You can then make use of the Signature Key Management NodeJS SDK to create and manage your keys.

🎬 Get Started

To keep this guide simple and easy to understand, we've used Express to set up a server which will monitor for incoming webhooks. You can setup your own production server and use it instead of the Express one if needed.

Initialisation and Installation

Create an empty directory for your project, let’s name it β€œtestApp”. Now, open up your command prompt and clone this repository into the directory created. Run npm install to install the necessary packages.

Adding in the public key

Open up the index.js file and replace the placeholder that says PUBLIC_KEY_HERE with your public key. The result should look like this:

var publicKey = '-----BEGIN PUBLIC KEY-----\n'+
  'MIIabcdNBgkqhkiG9w0BAQ4AAOCA338AMIIBCgKCAQEAwISbN8vv0HeUCPN9o29xCUzCsh0ZUM+wdc3Gi3+DfyO4rPec1f/uxFbw0Dscw1iEA1dUfQ5eKhhsOIPdjk//gOGQbBVmQ8DhDcGVGWrHrE/n/K/x0ZkIae4n4eNobK96Ic/C4YmXf5LBUmgkOwUM+5VDPxe3rMnm/3TQdJzAcBMIzqNixzseCh4ICYMSahKnkNY5bJGf+8WbT0i+3mHQwvLacAub+wFH6hyT4I7FXOcXmR+HIyD8xwwYLmB4Yy+cMmiDcc1J9KX34C5apXM2A3f2mOtgfM0WSH2NpXmZmpXmzbkbIxEw90N3zERrDb2myJAHAD0MKQ7abcdxPen96dIDAQAB\n'+
  '-----END PUBLIC KEY-----';

Changing the request line

The request line will need to be changed according to your callback url and request type. For instance, if your callback url is /captureData and the method type was PATCH then the resulting request line would look like this:

  verifier.update("PATCH /captureData HTTP/1.1" + date + body);

Testing

You are now ready to test the application. From the root directory of your application (where your index.js file is), run node index If all goes well, you should receive a true response which indicates the verification was a success.

πŸ“• API Reference Documentation

Check out the full API documentation for more detailed information.

πŸ˜• Need help?

Please contact developer support at [email protected] or check out the developer portal at developers.messagemedia.com

πŸ“ƒ License

Apache License. See the LICENSE file.

enterprise-webhooks-nodejs-sdk's People

Contributors

david-porter-messagemedia avatar elruwen avatar ibrahimtareq avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  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.