Skip to content

PHP Wrapper for the Ninox REST-API builded with lumen. Limit and customize the access to your Ninox Database.

Notifications You must be signed in to change notification settings

geckse/ninox-api-wrapper

Repository files navigation

Ninox API Wrapper

Ninox's REST API currently only supports API-Token-Auth where your token grants full access to all your Ninox-Teams and Ninox-Databases. So usually you don't wont to expose your API-Token. Which makes the API not suitable for calls from a Frontend or an App. This API wrapper makes it possible to limit the access to your Ninox API using the same REST API without ever exposing your Ninox API-Token.

Quick Start

Install via Composer

composer install

Serve the API locally

php -S localhost:8000 -t public

Fill the .env file with your Ninox Informations

NINOX_API_URL=https://api.ninoxdb.de/v1/
NINOX_API_KEY=your top secret ninox api key
NINOX_TEAM_ID=some team id
NINOX_DATABASE_ID=the database id

Endpoints

The endpoints are orientaded on the original Ninox URI Layout - just without the now unnessesary parts.

Database

Get Database Information

GET /

(Analogous to api.ninoxdb.de/v1/teams/:team/databases/:database/)

Tables

Get List of all Tables

GET /tables

(Analogous to api.ninoxdb.de/v1/teams/:team/databases/:database/tables)

Get Table Information by Table-ID

GET /tables/:tableid

(Analogous to api.ninoxdb.de/v1/teams/:team/databases/:database/tables/:tableid)

Records

Get Records of a Table

GET /tables/:tableid/records

(Analogous to api.ninoxdb.de/v1/teams/:team/databases/:database/tables/:tableid/records)

Get Record by ID of a Table

GET /tables/:tableid/records/:recordid

(Analogous to api.ninoxdb.de/v1/teams/:team/databases/:database/tables/:tableid/records/recordid)

Environment Variables & Customization

Don't want that all tables of your Ninox Database are public queryable? Define a Whitelist trough the PUBLIC_TABLES env variable.

PUBLIC_TABLES=A,B,C2

If you want to, you can rename the URL parts /tables/ and /records/ via the .env variables.

URL_PART_TABLES=table
URL_PART_RECORDS=records

About

PHP Wrapper for the Ninox REST-API builded with lumen. Limit and customize the access to your Ninox Database.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages