https://github.com/64robots/php-notion
PHP API for Notion
https://github.com/64robots/php-notion
Last synced: about 1 year ago
JSON representation
PHP API for Notion
- Host: GitHub
- URL: https://github.com/64robots/php-notion
- Owner: 64robots
- License: mit
- Created: 2021-05-13T16:53:55.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-13T10:06:08.000Z (over 4 years ago)
- Last Synced: 2025-04-11T18:56:44.837Z (about 1 year ago)
- Language: PHP
- Size: 51.8 KB
- Stars: 19
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# Access Notion API from you PHP application
[](https://packagist.org/packages/64robots/php-notion)
[](https://github.com/64robots/php-notion/actions?query=workflow%3Arun-tests+branch%3Amain)
[](https://github.com/64robots/php-notion/actions?query=workflow%3A"Check+%26+fix+styling"+branch%3Amain)
[](https://packagist.org/packages/64robots/php-notion)
This package allows you to use the Notion API from PHP.
## Installation
This package requires PHP => 7.4.
You can install the package via composer:
```bash
composer require 64robots/php-notion
```
## Usage
You need to create an instance of the `Notion` class using your [Notion Internal Integration Token](https://developers.notion.com/docs/getting-started)
Now you can invoke the resource method you need (`databases` in this example)
```php
use R64\PhpNotion\Notion;
$notion = new Notion('secret_access_token');
$database = $notion->databases()->retrieve('a65b5216-46cb-479b-961e-67cc7b05a56d');
```
## Resources
### Databases
#### Retrieve a Database
[Notion Retrieve Database documentation](https://developers.notion.com/reference/get-database)
```php
$database = $notion->databases()->retrieve('a65b5216-46cb-479b-961e-67cc7b05a56d');
```
## Testing
```bash
composer test
```
## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
## Security Vulnerabilities
Please review [our security policy](../../security/policy) on how to report security vulnerabilities.
## Credits
- [64 Robots](https://github.com/64robots)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.