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.
- Copy and rename .env.example to .env, modify environment variables.
- Run
npm install
in terminal
- Run
npm run http
in terminal - Enter url in SurveyLegend app
- Run
npm run express
in terminal - Enter url in SurveyLegend app
- Run
npm run hapi
in terminal - Enter url in SurveyLegend app
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
Run php ./php/examples/get_survey_list.php --apikey=XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX
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=#######
Run php ./php/examples/get_responses_for_survey.php --apikey=XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX --survey_id=#######
Run php ./php/examples/get_response.php --apikey=XXXXXXX-XXXXXXX-XXXXXXX-XXXXXXX --response_id=#######
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.
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
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.