Git Product home page Git Product logo

webhook-examples's Introduction

webhook-examples

Examples of servers to listen for and process webhooks from SurveyLegend

Note: It's necessary to have an IP or URL that is accessible from the Internet for SurveyLegend webhook processing service or SurveyLegend app to reach the server.

Node.js

  1. Copy and rename .env.example to .env, modify environment variables.
  2. Run npm install in terminal

Node HTTP

  1. Run npm run http in terminal
  2. Enter url in SurveyLegend app

Express.js

  1. Run npm run express in terminal
  2. Enter url in SurveyLegend app

Hapi.js

  1. Run npm run hapi in terminal
  2. Enter url in SurveyLegend app

PHP

API Usage Examples

These examples are meant to be run from the command-line like so and usually require an API-key. php examples/script.php --apikey=XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX

Get survey list for user

Run php ./php/examples/get_survey_list.php --apikey=XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX

Get specific survey

Note that no API-key is necessary, surveys are available publicly otherwise they wouldn't load when someone wants to participate.

Run php ./php/examples/get_survey.php --survey_id=#######

Get responses for specific survey

Run php ./php/examples/get_responses_for_survey.php --apikey=XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX --survey_id=#######

Get responses for specific survey

Run php ./php/examples/get_response.php --apikey=XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX --response_id=#######

Webhook Examples

To use a PHP script for receiving a web-server such as Nginx, Apache or similar is necessary. The server must also be configured to respond to requests coming from the Internet and to run PHP scripts.

TODO: Create script for handling incoming webhook call.

Python

API Usage Examples

These examples are meant to be run from the command-line like so and usually require an API-key. python python/examples.py --apikey=XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX --limit=3

Include get survey list for user, iterating and getting surveys

Webhook Examples

To use a Python script for receiving a web-server such as Nginx, Apache or similar is necessary, a Python based server can also be used. The server must also be configured to respond to requests coming from the Internet and to run Python scripts.

TODO: Create script for handling incoming webhook call.

webhook-examples's People

Contributors

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