plinct / api
API for the Plinct App modeled with the scheme proposed by Schema.org
Requires
- php: ^7.4|^8.0
- phpmailer/phpmailer: ^6.0
- slim/psr7: 1.*
- slim/slim: 4.*
- tuupola/slim-jwt-auth: 3.*
- dev-master
- 3.x-dev
- 3.0.7
- 3.0.6
- 3.0.5
- 3.0.4
- 3.0.3
- 3.0.2
- 3.0.1
- 3.0.0
- 2.x-dev
- 2.5.7
- 2.5.6
- 2.5.5
- 2.5.4
- 2.5.3
- 2.5.2
- 2.5.1
- 2.5.0
- 2.4.0
- 2.3.0
- 2.2.0
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.5
- 2.0.4
- 2.0.3
- 2.0.2
- 2.0.1
- 2.0.0
- 1.7.2
- 1.7.1
- 1.7.0
- 1.6.0
- 1.5.3
- 1.5.2
- 1.5.1
- 1.5.0
- 1.4.1
- 1.4.0
- 1.3.1
- 1.3.0
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.0
- 1.0.2
- 1.0.1
- 1.0.0
- 0.10.7
- 0.10.6
- 0.10.5
- 0.10.4
- 0.10.3
- 0.10.2
- 0.10.1
- 0.10.0
- 0.9.14
- 0.9.13
- 0.9.12
- 0.9.11
- 0.9.10
- 0.9.9
- 0.9.8
- 0.9.7
- 0.9.6
- 0.9.5
- 0.9.4
- 0.9.3
- 0.9.2
- 0.9.1
- 0.9.0
- 0.8.0
- 0.7.8
- 0.7.7
- 0.7.6
- 0.7.5
- 0.7.4
- 0.7.3
- 0.7.2
- 0.7.1
- 0.7.0
- 0.6.2
- 0.6.1
- 0.6.0
- 0.5.1
- 0.5.0
- 0.4.5
- 0.3.7
- 0.3.2
- 0.3.1
- 0.3.0
- v0.2.15
- v0.2.14
- v0.2.13
- v0.2.12
- v0.2.11
- v0.2.10
- v0.2.9
- v0.2.8
- v0.2.7
- v0.2.6
- v0.2.5
- v0.2.4
- v0.2.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.0
This package is auto-updated.
Last update: 2024-11-05 21:05:28 UTC
README
Interface for manipulating data in an SQL database modeled according to schema.org standards.
### UNDER DEVELOPMENT ###
Depedencies
- composer
- php 7.4 | 8.0
- slim/slim 4
- slim/psr7
Getting Start
For install in your website
Create mysql schema;
Create two user on mysql schema: one public user and one admin user;
Grant insert privilegies for the public user in only the user table and grant all privilegies for the admin user;
GRANT INSERT ON schema.user TO 'publicUser'@'hostname' IDENTIFIED BY 'password';
Add in index page on the root
<?php
declare(strict_types=1);
use \Slim\Factory\AppFactory;
use Plinct\Api\PlinctApiFactory;
// autoload
include '../vendor/autoload.php';
// slim app
$slimApp = AppFactory::create();
// for enable routes PUT and DELETE
$slimApp->addBodyParsingMiddleware();
/******** PLINCT API ***********/
// api factory
$api = PlinctApiFactory::create($slimApp);
// database connect
$api->connect("driver", "host", "dbname", "username", "password");
$api->run();
// run
$slimApp->run();
Start api using https://domain/api/start with request HTTP POST request, sending the database admin username and password by form url encoded using and with name of values;
Register a user with , and on https:///api/user sending with request HTTP POST from a form url encoded;
Update in table user the user for administrator with status = 1
Types enabled
- Action
- Article
- Book
- ContactPoint
- Event
- ImageObject
- LocalBusiness
- Organization
- Person
- Place
- PostalAddress
- Product
- PropertyValue
- Service
- Taxon
- VideoObject
- WebSite
- WebPage
- WebPageElement
Api access
Use https://yourdomain.dpn/api with base url
Get all items for a type
Https://yourdomain.dpn/api/[typename]
Get type and subClass of type with additionalType properties
https://yourdomain.dpn/api/[type]?format=classHierarchy&subClass=[additionalType]
properties from use in query strings
format=
ItemList:
- return a ItemList type with numberOfItems and ItemListElement properties
classHierarchy
- return data with type, class (subClass of type) and subClass (subClasses of subClass)