code711 / code711-api
An API for accessing TYPO3 data
Installs: 1 936
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Type:typo3-cms-extension
Requires
- b13/slimphp-bridge: ^0.5
- firebase/php-jwt: ^6.4
- helhum/dotenv-connector: ^3.0
- typo3/cms-core: ^11.5
README
We published an extension to retrieve the current TYPO3 release of a remote project with a simple link like http://example.com/api/v1/version.
The extension implements a simple REST API using the micro framework slim. Thanks to B13 and extension b13/slimphp-bridge.
-
Get the extension: https://packagist.org/packages/code711/code711-api
-
Add config: In sites/[site]/config.yaml add:
imports: - resource: EXT:code711_api/Configuration/Routes/Api.yaml
- Add credentials: We use basic authentication to prevent open access to the current release for security reasons. The credentials could be stored in .env file in project root.
REST_API_USER=XXX REST_API_PW=XXX
-
Flush cache
-
Test For testing REST API you can use the Postman REST Client: https://www.postman.com/product/rest-client/
Special Environments
Some environments (e.g. Mittwald) need additional configuration to work with the REST API behind a basic authentication. When using CGI/FastCGI mode, it can happen that the Authorization header is not passed to PHP by default.
Therefore, you need to add the following line to your .htaccess
file:
SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0