- PHP 7.1
- OpenSSL PHP extension (for certain algorithms)
Install composer if you haven't: https://getcomposer.org/download
- In main directory, run this php command to install all dependencies:
php composer.phar install
- Rename config.php.example to config.php and set your own configurations.
This project is using single file API: api.php
Example:
http://localhost/my_api/api.php/register
--> for registing new user.
http://localhost/my_api/api.php/get/users
--> will retrieve all rows in users table.
- Request is always using POST method. For CRUD, set token at Authorization on request header.
Authorization: Bearer MY_SECRET_TOKEN
- For registration set
Content-Type:application/x-www-form-urlencoded
on request header.
Just use sendEmail() function to send an email.
sendEmail($to, $subject, $htmlBody)