Download the PHP package hapio/hapio-sdk-php without Composer

On this page you can find all versions of the php package hapio/hapio-sdk-php. 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 hapio-sdk-php

Hapio SDK for PHP

The Hapio SDK for PHP allows you to easily interact with the Hapio API for bookings and scheduling when using the PHP programming language.

Requirements

Getting started

The easiest way to install the Hapio SDK is by using Composer to require the package in your project:

To use the SDK in your project you simply instantiate an API client, and then get to work:

Documentation

API client

Provide your API token when you instantiate the API client:

Models

The following models are available in the SDK:

These models are returned when fetching entities, as well as when you create or update entities. When instantiating a new model, you can provide an array of properties to set:

You can also set and get individual properties on the model object:

You can use either snake_case or camelCase for the property names. Property names in camelCase will be automatically converted to snake_case internally, since that is used when communicating with the API.

You can only set values for valid property names:

Repositories

The Hapio SDK provides a repository class for each type of entity available in Hapio:

These repositories are the communication gateway to the API, and are used to send and retrieve data.

The repositories are accessible through methods on the ApiClient class:

Each repository has a set of methods, corresponding to the endpoints available for the entity. These are listed for each repository below.

Hapio\Sdk\Repositories\ProjectRepository

Hapio\Sdk\Repositories\LocationRepository

Hapio\Sdk\Repositories\ResourceRepository

Hapio\Sdk\Repositories\ServiceRepository

Hapio\Sdk\Repositories\ScheduleBlockRepository

Hapio\Sdk\Repositories\RecurringScheduleRepository

Hapio\Sdk\Repositories\RecurringScheduleBlockRepository

Hapio\Sdk\Repositories\Booking

Hapio\Sdk\Repositories\BookingGroupRepository

Paginated responses

All the methods for API endpoints that respond with a paginated list, will return an instance of Hapio\Sdk\PaginatedResponse. This class has a set of methods that make it easier for you to work with these paginated responses.

Exceptions

Whenever the API responds with a 4XX or 5XX response, an exception will be thrown. Validation error responses with a status code of 422 will throw a Hapio\Sdk\Exceptions\ValidationException, and all other 4XX and 5XX status codes will throw a Hapio\Sdk\Exceptions\ErrorException. For both of these exceptions you can access the original Guzzle exception using the getPrevious() method, the message property of the response is available using the getMessage() method, and the status code can be fetched using the getCode() method. The ValidationException class also has a method for accessing validation errors, called getValidationErrors(). Other Guzzle exceptions are not caught by the SDK.

Resources


All versions of hapio-sdk-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
guzzlehttp/guzzle Version ^7.8
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 hapio/hapio-sdk-php contains the following files

Loading the files please wait ....