Download the PHP package voipcompetencecenter/weclappclient without Composer
On this page you can find all versions of the php package voipcompetencecenter/weclappclient. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download voipcompetencecenter/weclappclient
More information about voipcompetencecenter/weclappclient
Files in voipcompetencecenter/weclappclient
Package weclappclient
Short Description Ein PHP-Client für die Weclapp REST-API v2 mit vollständiger Feature-Unterstützung
License MIT
Homepage https://github.com/VCC-Common-Tools/weclappclient
Informations about the package weclappclient
WeclappClient v2.0.0
A comprehensive and flexible PHP client for interacting with the Weclapp REST API v2.
It supports structured queries, pagination, sorting, CRUD operations, and all advanced API features.
Responses are returned as native PHP arrays with full RFC 7807 error handling.
🚀 What's New in v2.0.0
- API v2 Migration: Full support for weclapp API v2 with legacy v1 compatibility
- Advanced Filtering: OR conditions, grouping, raw filter expressions (Beta)
- Custom Attributes: Type-safe filtering for custom fields with automatic data conversion
- Special Parameters: Elegant handling of endpoint-specific parameters (entityName, entityId)
- Performance Optimization: Referenced entities, selective properties, additional properties
- Enhanced Updates: Partial updates, dry-run mode, null serialization
- Complete Error Handling: RFC 7807 compliant with 40+ error types
- Backward Compatible: Minimal breaking changes, easy migration from v1.x
📦 Installation
🔧 Setup
HTTP options: timeouts & retries (v2.2.0)
The client applies sane defaults for production use and automatically retries
rate-limited requests (HTTP 429) and connection errors with exponential backoff.
You can override these via the optional 5th constructor argument:
Note:
timeout/connect_timeoutapply only to the internally created HTTP client. If you inject your own Guzzle client, configure timeouts there. Generic5xxresponses are not retried automatically to avoid duplicate writes on non-idempotent operations (e.g. POST).
🔍 Querying with the QueryBuilder
Supported Filter Methods
| Method | Description |
|---|---|
where($field, $op, $val) |
Custom filter condition |
whereEq('field', 'val') |
Equals |
whereNe('field', 'val') |
Not equal |
whereGt, whereGe |
Greater than, greater or equal |
whereLt, whereLe |
Less than, less or equal |
whereLike, whereILike |
(i)LIKE search pattern |
whereNotLike, whereNotILike |
NOT LIKE pattern |
whereIn('field', [...]) |
Field value in given list |
whereNotIn('field', [...]) |
Field value NOT in given list |
whereNull('field') |
Field is null |
whereNotNull('field') |
Field is not null |
Advanced Filtering (v2.0.0)
Custom Attributes (v2.0.0)
Type-safe filtering for custom fields with automatic data conversion:
Special Parameters (v2.0.0)
Elegant handling of endpoint-specific parameters without operator suffixes:
Sorting
Limiting and Pagination
🔢 Counting
🎯 Getting Single Records
⚡ Performance Optimization (v2.0.0)
🛠️ CRUD Operations
🛡️ Error Handling (v2.0.0)
The client now provides comprehensive RFC 7807 compliant error handling:
Error Types
The client supports 40+ error types including:
- Main Errors:
context,forbidden,optimistic_lock,validation, etc. - Validation Errors:
email,pattern,size,reference,enum, etc.
📄 Response Format
All queries return Weclapp-formatted arrays (i.e. response['body']['result']).
Example:
🔄 Migration from v1.x
Breaking Changes (Minimal)
- Default API Version: Now uses v2 by default (v1 still available)
- Update Method: New signature
update(array $data, bool $ignoreMissingProperties = false)
Migration Steps
New Features Available
All new features are optional and backward compatible:
🧪 Testing
The test suite is split into two parts:
unit– fast, isolated tests using a mocked HTTP client. No credentials or network access required. These run in CI.integration– tests against a real Weclapp system. Requires valid credentials intests/.env(WCLP_TEST_SUBDOMAIN,WCLP_TEST_API_KEY; seetests/.env.example).
🧩 For Developers: Reusing the QueryBuilder
The class AbstractBaseQueryBuilder provides the technical foundation for the QueryBuilder.
It encapsulates reusable API logic for filters, pagination, sorting, and counting.
You can use this class as a base to implement your own API clients in a similar architecture – independent of Weclapp.
📋 Changelog
See CHANGELOG.md for detailed version history.
📄 License
MIT License - see LICENSE file for details.