Skip to main content

Accessing the API from PHP

For PHP, we offer the mittwald API client library mittwald/api-client. This library is an auto-generated client for the mStudio v2 API and can be installed via Composer.

Quickstart

Install this package using Composer:

$ composer require mittwald/api-client

To use the client, import the Mittwald\ApiClient\MittwaldAPIV2Client class, and instantiate it via one of the factory functions:

  • MittwaldAPIClient::newUnauthenticated()
  • MittwaldAPIClient::newWithToken(string $apiToken) (recommended)
  • MittwaldAPIClient::newWithCredentials(string $email, string $password) (does actually perform a login in the background; does not work when using 2FA)

Have a look at our API introduction for more information on how to obtain an API token and how to get started with the API.

Further reading

For a complete documentation, have a look at the libraries README file.