- Symfony Flex recipe, published as assets of every GitHub release. With
releases/latest/download/index.jsonadded toextra.symfony.endpoint,composer requireregisters the bundle, createsconfig/packages/zammad.yamland addsZAMMAD_URL/ZAMMAD_TOKENto.env;composer removereverts it. Applications without Flex keep registering the bundle by hand (#182)
- Guzzle 8 is supported:
guzzlehttp/guzzleis now^7.10 || ^8.0andguzzlehttp/psr7is now^2.7 || ^3.0. Before, installing the client into a project already on Guzzle 8, such as every new Laravel 13 application, failed unless Composer was allowed to downgrade Guzzle (#180, #181)
Auth— credentials as a transport-independent value:Auth::token(),Auth::oauth2(),Auth::basic(). The constructor is private, so the set of valid schemes is closed by construction; empty tokens and usernames are rejected on creation instead of surfacing as a 401 laterZammadClient::create(string $url, Auth $auth, ?ConnectionConfig $config = null)— one-line entry point for the default (Guzzle) transportRequestHandleraccepts an optionalauth:argument and applies theAuthorizationheader per requestConnectionConfig::$allowInsecureHttp/RequestHandler'sallowInsecureHttp:argument — opt out of the cleartext-credential check described below
- Authentication no longer depends on the HTTP client supporting client-level default headers. It is applied by
RequestHandlerwhen composing each request, so any PSR-18 transport authenticates the same way — the hand-writtenAuthMiddlewarethat the docs previously required for Symfony'sPsr18Clientis obsolete - Breaking: credentials are no longer sent in cleartext. Constructing a client with an
Authand a plainhttp://URL whose host is not loopback now throws anInvalidArgumentExceptioninstead of putting the token on the wire for anyone on the path to read. Loopback is exempt —localhost, any.localhostname, the whole127.0.0.0/8range and::1— so every default this project ships (http://localhost:3000in the cookbook,http://127.0.0.1:8098in both bridges) is unaffected, as is anyhttps://URL. Who is affected: anyone pointing the client at a remote Zammad over plain HTTP, e.g. an app server talking to an internal instance or a container reachinghttp://zammad-nginx:3000. Switch the URL tohttps://, or, if the connection is already protected by other means (VPN, service mesh, SSH tunnel), opt out withnew ConnectionConfig(allowInsecureHttp: true)— orallowInsecureHttp: truewhen building aRequestHandlerdirectly. The check keys on theAuthit is given, so anAuthorizationheader that your own PSR-18 client adds stays your responsibility (#173) GuzzleClientFactorytakes(string $url, Auth $auth, ?ConnectionConfig $config)and no longer sets anAuthorizationdefault header on the Guzzle client. Its constructor was private before, so no caller is affected- The
@deprecatedmarker onDTOInterface::id()'s trait implementation is withdrawn. It announced a removal in 4.0 that was never planned, was never mentioned in the 3.0.0 changelog that introduced it, and contradicted both the interface — which requires the method and is not deprecated — and the library's own use of it inResource. Reading$dto->iddirectly remains the more readable form - Documentation: corrected examples that referenced
ZammadClient::withToken()and the impersonation methods removed in 3.0.0 (#168) - Fixed: the Laravel override and custom-middleware examples in the custom HTTP client guide built a client with no credentials at all, so every request would have failed with HTTP 401. They now pass an
Authto theRequestHandler - Fixed:
SymfonyBundleregistered the client withContainerBuilder::set(), which stores a live instance rather than a definition. Instances set that way do not survive container compilation, so any service injectingZammadClientfailed the build with "has a dependency on a non-existent service" — the bundle never worked in a compiled container. It now registers a lazyDefinitionwithZammadClient::create()as its factory and an inlinedAuthdefinition, so nothing is instantiated at compile time and the credentials are resolved from%env(ZAMMAD_TOKEN)%at runtime instead of being written intovar/cache - Fixed: the password parameters of
Auth::basic()andGuzzleClientFactory::withBasicAuth()are marked#[\SensitiveParameter]. An empty username throws from insideAuth::basic(), so with PHP's defaultzend.exception_ignore_args=0the password appeared verbatim in the stack trace. The attribute is honoured from PHP 8.2 on and inert on 8.1 - Fixed: the Symfony section of the custom HTTP client guide offered the
create()definition and a custom PSR-18 stack in oneservices:block, with the custom stack under its ownapp.zammad_clientID. Autowiring resolves aZammadClienttype-hint to theZammadAPIClient\ZammadClientID, so anyone copying that block got the Guzzle client and a dead custom stack. The two are now separate, clearly alternative blocks, both registering the class ID — the same shapeSymfonyBundleuses - Fixed: the Slim recipe (
examples/cookbook/10-slim.php) told readers to create a.envfile and then read$_ENVwithout loading one — and$_ENVis empty altogether unlessvariables_orderincludesE. It now usesgetenv(), like every other recipe - Fixed: the v3 migration guide's
composer requireline allowed^3.0, while the client instantiation shown directly below it usesZammadClient::create(), which only exists from 3.2.0 - Fixed:
LaravelServiceProviderreadZAMMAD_URL/ZAMMAD_TOKENwithenv()from inside the container binding, i.e. at the moment the client was resolved. Underphp artisan config:cacheLaravel skips theLoadEnvironmentVariablesbootstrapper altogether, so.envis never loaded and such a call returns its default — an application that kept its token in.envand never ranvendor:publishtherefore worked in development and failed in production with "API token must not be empty.".register()now merges the packagedconfig/zammad.phpviamergeConfigFrom(), which leaves the singleenv()call in the one fileconfig:cacheactually freezes. Who is affected: anyone setting an explicitly emptyurlortokenin a publishedconfig/zammad.phpwhile relying on the environment to fill it in — an explicit configuration value now wins over the environment instead of being treated as unset. The built-in URL default still applies to an empty value (#169) - Fixed: the provider passed
mixedconfiguration values straight intoZammadClient::create()andAuth::token(). Underdeclare(strict_types=1)a non-string value in a publishedconfig/zammad.phpsurfaced as aTypeErrorraised from inside the client, naming the client rather than the config file that had to be fixed. Values are now narrowed before use, and a value that is neither unset nor a string is rejected withInvalidArgumentException: config('zammad.url') must be a string, array given.— naming the configuration key that has to change rather than a file that need not exist, since the value may just as well come from a.enventryenv()hands back as a bool or from a runtime override. Who is affected: anyone whosezammad.urlorzammad.tokenholds a non-string value. The alternative, substituting the built-in default, would have pointed a production client athttp://127.0.0.1:8098without a word (#169) - Fixed:
Cast::dateTime()caughtDateMalformedStringException, a class that only exists from PHP 8.3 on. The library supports PHP 8.1 and 8.2, wherenew DateTimeImmutable()throws a plainExceptionfor an unparsable value — the catch never matched and the exception escaped, contradicting both the method's documentednullreturn and the class contract that these coercions never throw. It now catchesException, which on 8.3 and later is the same thing. Who is affected: anyone on PHP 8.1 or 8.2 whose Zammad returns a timestamp the parser rejects (#169) - Fixed: the Symfony bundle fell back to
%env(ZAMMAD_TOKEN)%with no default, so an application that registered the bundle without setting that variable got Symfony'sEnvNotFoundException: Environment variable not found: "ZAMMAD_TOKEN"when it first resolved the client — an error about Symfony's env layer rather than about the missing credential. It now falls back through azammad.default_tokenparameter, the same shape the URL already used, so the failure is the library's ownInvalidArgumentException: API token must not be empty.— identical to whatLaravelServiceProviderhas always done. Who is affected: anyone relying on the previous exception type or message in acatchblock or a health check (#169) - Both framework bridges are verifiable by contributors. They are tested from separate Composer projects under
test/Bridge/Symfony/andtest/Bridge/Laravel/, each with its ownvendor/, its own PHPStan run at level max and its own PHPUnit configuration. The Symfony suite loads, compiles and dumps a realContainerBuilder— the path on which the bundle has broken before — and the Laravel suite registers the provider against a realIlluminate\Foundation\Application; both bridges go from 0 % to full line coverage. CI runs them against Symfony 6.4, 7.0, 7.4 and 8.x and Laravel 12 and 13, and those ranges are stated insuggestand in the README. The split is not cosmetic: resolved in one lock file the two frameworks deadlock, because every Laravel release that tolerates PHPUnit 11 requiressymfony/http-kernel ^7or newer. It also keeps both frameworks out of the rootrequire-dev, so a plaincomposer installstays small. A.gitattributeswithexport-ignorerules additionally cuts the Composer dist archive roughly in half (#169) - Fixed: the Symfony service IDs in the custom HTTP client guide.
@Symfony\Component\HttpClient\Psr18Clientand@Nyholm\Psr7\Factory\Psr17Factoryare class names, not registered services, so copying that YAML failed the build. FrameworkBundle aliasesPsr\Http\Client\ClientInterface, and thenyholm/psr7Flex recipe registersnyholm.psr7.psr17_factory. The fallback for installations without Flex, in that same section, then declared the factory under its class name while the handler referencednyholm.psr7.psr17_factory— reproducing the very "has a dependency on a non-existent service" build error it was meant to avoid. It now declares the ID the handler asks for
GuzzleClientFactory::withToken() / withOAuth2() / withBasicAuth() keep their signatures and now delegate to Auth. They remain supported shorthand for the explicit-Auth constructor and are not scheduled for removal; ZammadClient::create() is simply the recommended entry point for new code.
One behavioural change to be aware of: an empty or whitespace-only token (or username) is now rejected with an InvalidArgumentException at construction, where it previously produced a client that failed with HTTP 401 on its first request. Code that builds a client from an unset environment variable therefore fails earlier and more clearly than before. Both framework bridges resolve the client lazily, so this surfaces the first time something asks the container for it, not while the container is built: Laravel falls back to an empty token (env('ZAMMAD_TOKEN', '')) and throws InvalidArgumentException, while the Symfony bundle falls back to an empty token and throws InvalidArgumentException — unless config/packages/zammad.yaml sets token: '%env(ZAMMAD_TOKEN)%' explicitly, in which case Symfony raises EnvNotFoundException for an unset variable. The Symfony bundle only became lazy in this release — see the fix above; before it, an empty token made cache:clear (and with it composer install) fail outright. It is now covered by tests and static analysis in this repository (#169).
RoleRepository/RoleDTOfor/api/v1/roles, accessible via$client->role()— resolve role names to the IDs needed forUserDTO::$role_ids;permission_ids,group_idsanddefault_at_signupare writable on create and update (#167)
- Documentation: README restructured for newcomers (install / Packagist section), cookbook setup instructions and a broken personal access token link fixed
- PSR-18 / PSR-17 compliant HTTP layer (
RequestHandler,RetryAfterMiddleware) - Typed DTOs for all 10 resources (
Ticket,User,Organization,Group,TicketArticle,TicketState,TicketPriority,Tag,TextModule,Link) - Repository pattern with generator-based pagination (
AbstractRepository) patch()method for partial updates viaarrayorTicketUpdateDTO- Proper exception hierarchy:
AuthenticationException,ForbiddenException,NotFoundException,BadRequestException,ValidationException,RateLimitException,ServerErrorException,NetworkException GuzzleClientFactory::withToken()/withOAuth2()/withBasicAuth()factory methods (namespaceZammadAPIClient\Factory)- PSR-3 Logger injection
- OpenAPI schema validation in integration tests
- Framework bridges for Laravel and Symfony
TicketArticleTypeenum for article channel typesClientFactoryInterfaceinterface +GuzzleClientFactory—createHandler()builds theRequestHandlerImpersonationHandler— stateless decorator for API impersonation, scoped vianew ZammadClient(new ImpersonationHandler($handler, $userId))
- Breaking: PHP >= 8.1 required
- Breaking:
ZammadClient::withToken()/withOAuth2()/withBasicAuth()→new ZammadClient(GuzzleClientFactory::with*())(namespaceZammadAPIClient\Factory). Non-Guzzle vianew ZammadClient(new RequestHandler($psr18Client, $psr17Factory, $url)). - Breaking:
ZammadClient::withClient()removed; theZammadClientconstructor acceptsRequestHandlerInterface|ClientFactoryInterface - Breaking:
ZammadClient::setOnBehalfOfUser()/unsetOnBehalfOfUser()/onBehalfOf()/performOnBehalfOf()removed. Impersonation vianew ZammadClient(new ImpersonationHandler($handler, $userId)). - Breaking:
RequestHandlerInterface::setOnBehalfOfUser()/getOnBehalfOfUser()removed.RequestHandlerno longer holds any impersonation state. - Breaking:
RequestHandlerInterface::getRaw()signature extended by a$headersparameter - Breaking:
Clientclass replaced byZammadClientwith repository accessors - Breaking: Array return values replaced by typed DTOs
- Breaking: Guzzle used as default transport; any PSR-18 client can be injected via
RequestHandler getListKey()in repository classes is no longer abstract; it defaults to$this->resourcePath- Typed repository accessors (
$client->ticket(),$client->user(), …) are the recommended public API; the underlyingrepo()method is@internal.
ZammadClient::aliasMap(),resolveAlias(),__call()— deprecated in v3.0, now removed- Shared mutable impersonation state in
RequestHandler
- Added #78 - Ticket linking support (Link resource).
- Added #59 - Admin-scoped tag support.
- Added #126 - Configurable test timeout via
ZAMMAD_PHP_API_CLIENT_UNIT_TESTS_TIMEOUTandconnection_optionssupport in HTTPClient. - Fixed #52 -
getAttachmentContent()to return string instead of Stream object. - Added #43 -
sort_byandorder_byparameters forsearch(). - Fixed #77 -
getID()to handle null values and always return a string.
- Fixed #64 - Use
Fromheader instead of deprecatedX-On-Behalf-Of.
- Fix PHP deprecation warnings.