Open Agora basic PHP client
This is a very simple client for AgorAPI, based on PHP with
It is intended to demonstrate and test voting functionality of AgorAPI, the Open Agora polling API.
It complements the AgorAPI guide and the exhaustive documentation, please make sure to read these pages before starting using the present files.
This code is not intended for production use.
In order to use the files of this repository, you need the following:
- An AgorAPI access key (and the associated token). You may register on Open Agora website for free.
- PHP installed on your machine (or some server). More precisely, you need PHP CLI and PHP Curl above 5.4. We recommend using PHP 7.
- Having a running web server like Apache or Nginx is optional since you may try our code with PHP built-in server.
- That's about it. In case of trouble you may get in touch with us: email@example.com
Assume the downloaded files are located within folder
- Clone the repository or copy the files into some directory.
- Move file
/agorapiTestClient/OA/api.ini. This file contains essential information for accessing AgorAPI.
/agorapiTestClient/OA/api.iniand fill in your API token obtained from your profile at Open Agora website.
- Within directory
/agorapiTestClient/, you may simply type:
php -S localhost:8888 -t .. You should keep this server running in a console.
- In a browser, go to http://localhost:8888/poll_index.php.
Alternatively, you may configure Apache or Nginx to access directory
/agorapiTestClient/ from a given URL.
The files in this repository present some aspects of building a client for AgorAPI. However, we do not get deeply into every functionality of this API.
In particular, elements related to user management are omitted. AgorAPI makes it possible to have users, who may create polls and cast votes (each user may cast at most a single vote for a given poll, this vote can be replaced as often as necessary). In order to make optimal usage of AgorAPI, you should understand how users are handled, and what they are entitled to do. It is also important with respect to anonymous voting.
This project is licensed under the MIT License - see the LICENSE.md file for details.