Download the PHP package vineyardkoeln/churchtools-api without Composer

On this page you can find all versions of the php package vineyardkoeln/churchtools-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package churchtools-api

No longer maintained. Please move to https://github.com/5pm-HDH/churchtools-api!

ChurchTools API

Access the API for ChurchTools at https://api.churchtools.de/ in an object-oriented way that integrates nicely with modern PHP projects via Composer.

The API v2 which uses the new (2019) REST api can be found in the README_API2.md.

Free software (both as in free beer and free speech) by Vineyard Köln, licensed under Apache 2.0

[4]:

Further development

Currently this library has not been updated recently. If you wish to participate in development, you can send us pull requests to integrate in the main branch

Other php CT API implementations

https://github.com/5pm-HDH/churchtools-api

Installation

composer require vineyardkoeln/churchtools-api

Usage

Prerequisite: Autoloading

If you haven't already configured autoloading in your project, start by including the Composer autoloader:

Login to use the API

In order to use the ChurchTools API you need a valid login. This can either be a username / password pair or you can use a login ID and token. The latter is the recommended way because it keeps you API separate from any user account but username and password is fine for testing purposes.

To login with username and password, use this code snippet:

where mychurch is your church handle or subdomain like in the URL to your web interface: https://_mychurch_.church.tools/. If you are self-hosting ChurchTools, then use full server name of your installation without protocol (so for example: 'mychurch.example.org').

To login with a login ID and token, use this code snippet (recommended):

You can retrieve the token by logging in once to the API with a username and password via the static method getLoginToken() (see below).

The login is valid for the duration of the programm call (script lifecycle). This way you can perform many requests with only one login via the static constructor method of your choice.

The following examples mostly assume you have a valid login and the API object is assigned to the variable $api.

Get Token

In order to acquire a login ID and token you must call the getLoginToken method once:

This will return something like:

Get all calendar entries

To get all calendar entries from now until 10 days in the future:

This method also has two optional parameters, $toDays and $fromDays, which allow you to select the desired timeframe.

Get master data

To get calendar or service master data, use this method:

or

TODO: In one of the upcoming alpha versions, methods will return model objects and not plain arrays.

TODOs

  1. Wrap more API calls
  2. Use Model classes for the return data instead of plain arrays
  3. Someday, wrap all available API calls
  4. Document every single available method

All versions of churchtools-api with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-json Version *
guzzlehttp/psr7 Version ^1.6
guzzlehttp/guzzle Version ^7.3
jane-php/open-api-3 Version ^7.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package vineyardkoeln/churchtools-api contains the following files

Loading the files please wait ....