Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mskian/tamilsms-api
API build using PHP Slim Framework for storing the Tamil kavithai and Quotes in Database
https://github.com/mskian/tamilsms-api
api json json-api php silm3 tamil
Last synced: 29 days ago
JSON representation
API build using PHP Slim Framework for storing the Tamil kavithai and Quotes in Database
- Host: GitHub
- URL: https://github.com/mskian/tamilsms-api
- Owner: mskian
- License: mit
- Created: 2020-09-22T03:37:51.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-05T13:02:50.000Z (over 4 years ago)
- Last Synced: 2024-11-07T22:48:42.644Z (3 months ago)
- Topics: api, json, json-api, php, silm3, tamil
- Language: PHP
- Homepage:
- Size: 17.6 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# TAMILSMS API
API build using PHP Slim Framework for storing the Tamil kavithai and Quotes in Database
## Requirements
- PHP 7.4
- Composer for install the packages
- SSL for secure Connection
- MYSQL 5.x or 8.x## usage
- install the packages via Composer
```sh
composer install
```- Add your DB details in `conf.php` file
- Update your database table name in `index.php` replace mine with your's
- Add user name and password for HTTP Auth (Check line no 20 in `index.php`) - Basic protection for POST Method
- Create MYSQL database with Tamil Content Support```sql
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';DROP TABLE IF EXISTS `tamilcontent`;
CREATE TABLE `tamilcontent` (
`id` int NOT NULL AUTO_INCREMENT,
`content` text CHARACTER SET utf16 COLLATE utf16_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
```- That's all done
```sh
https://api.example.com/all - Get all content
https://api.example.com/random - Get Random Content
https://api.example.com/add - Post the content into Database
https://api.example.com/update/{id} - Update the Content in the Database
```## Examples
- Post Method
```sh
curl --request POST \
--url https://api.example.com/add \
--header 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXXX' \
--header 'content-type: application/x-www-form-urlencoded' \
--data 'content=Example Tamil Content'
```- PUT Method
```sh
curl --request PUT \
--url https://api.example.com/update/1 \
--header 'authorization: Basic XXXXXXXXXXXXXXXXXXXXXX' \
--header 'content-type: application/x-www-form-urlencoded' \
--data 'content=Example Edited Tamil Content'
```## Enable FastCGI Cache (Nginx)
- Open `/etc/nginx/nginx.conf`
- Add this Below code inside http block```sh
fastcgi_cache_path /etc/nginx/cache levels=1:2 keys_zone=sanapp:100m inactive=60m;
fastcgi_cache_key "$scheme$request_method$host$request_uri";
```> **you can Update this API According to your usage this is Just Example API for Tamil Content**
## LICENSE
MIT