API version of TinyQueries
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


TinyQueries PHP API

This is a derived version of TinyQueries PHP-libs. It can be used to set up a REST api based on a list of compiled queries.

Installation instructions

  • Note 1: It is assumed you already have an account for TinyQueries. If you don't have one, please sign up first.

  • Note 2: The installation will be done by just downloading the ZIP and copy the files to your webserver. If you prefer to install TinyQueries using Composer we suggest to use TinyQueries PHP-libs.

Follow the instructions below to setup a TinyQueries API:

  1. Download the latest release of this repo as ZIP

  2. Upload the files to a folder inside the document-root of your server. For example, place it in a folder such that you can access it through http://www.myserver.com/api/

  3. Make a copy of the file config/config.template.xml and call it config/config.xml. Fill in the following fields:

    • <database> attributes 'driver', 'name', 'user', 'password', etc.
    • <compiler> attribute 'api_key' - You can find your api-key on the dashboard of your TinyQueries account.
  4. In the TinyQueries editor go to Config > Publish settings. In the field 'Publish to' set the URL of the api, so for example http://www.myserver.com/api. You can use localhost as well if your server runs on your laptop.

  5. If you don't use Apache, ensure you do the same URL-rewriting as is done in .htaccess. Furthermore ensure that the folders config, libs and queries are not accessible.

  6. You can start creating queries. When you compile them, they are published to your webserver. The queries can be called using the api by http://www.myserver.com/api/{myQuery}. So for example http://www.myserver.com/api/helloWorld should work after you compile for the first time.