mittwald / api-client
Client library for the mittwald mStudio v2 API
Requires
- php: ^8.2
- caseyamcl/guzzle_retry_middleware: ^2.9
- guzzlehttp/guzzle: ^7.8
- justinrainbow/json-schema: ^5.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.68
- phpstan/phpstan: ^2.1.1
- phpunit/phpunit: ^11.5 || ^12.5
- rector/rector: ^2.0.7
This package is auto-updated.
Last update: 2026-06-16 19:59:05 UTC
README
This package contains a (mostly auto-generated) PHP client for the mittwald mStudio v2 API.
License
Copyright (c) 2025 Mittwald CM Service GmbH & Co. KG and contributors
This project is licensed under the MIT License; see the LICENSE file for details.
Installation
You can install this package using composer:
$ composer require mittwald/api-client
Usage
Import the client:
use Mittwald\ApiClient\MittwaldAPIV2Client;
To create a client instance you can use one of the following factory methods for different types of authentication:
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.MittwaldAPIClient::newWithAccessTokenRetrievalKey(string $userId, string $key), authenticates an mStudio user using the access token retrieval key mechanism. Only useful if you're building an mStudio extension.MittwaldAPIClient::newWithExtensionSecret(string $extensionInstanceId, string $extensionSecret), authenticates an mStudio extension itself (without any user interaction). Only useful if you're building an mStudio extension.
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.
Example
use \Mittwald\ApiClient\Generated\V2\Clients\Project\ListProjects\ListProjectsRequest; $listProjectRequest = new ListProjectsRequest(); $listProjectResponse = $client->project()->listProjects($listProjectRequest); foreach ($listProjectResponse->getBody() as $project) { echo $project->getShortId() . PHP_EOL; }
API documentation
The API documentation can be found in our Developer Portal. You can find the operation ID on the right side of each operation.