Download the PHP package infiniteloop/camara-client without Composer
On this page you can find all versions of the php package infiniteloop/camara-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download infiniteloop/camara-client
More information about infiniteloop/camara-client
Files in infiniteloop/camara-client
Package camara-client
Short Description A client for the CAMARA cellular network KYC protocol
License MIT
Informations about the package camara-client
CamaraClient
A PHP client library for the CAMARA API with built-in OAuth2 authentication and configurable settings.
Features
- 🔐 OAuth2 Authentication - Automatic token management with configurable credentials
- 📱 HLR Lookup - Mobile number validation and operator information
- 👤 Customer Premium Info - Retrieve detailed customer information
- 🛠️ Configurable - Flexible settings injection for multi-environment support
- 🎯 Clean API - Simple, intuitive method calls with automatic authentication
- 📦 PSR-4 Compliant - Modern PHP package structure
Installation
Install via Composer:
Requirements
- PHP >= 7.4
- ext-curl (for HTTP requests)
- ext-json (for JSON handling)
Quick Start
Configuration
Required Settings
The CamaraClient constructor requires an associative array with the following keys:
| Key | Type | Description |
|---|---|---|
token_url |
string | OAuth2 token endpoint URL |
service_url |
string | CAMARA API base URL |
client_id |
string | OAuth2 client ID |
client_secret |
string | OAuth2 client secret |
opco |
string | Operating company code (e.g., 'IE', 'UK') |
sp_name |
string | Service provider name |
Example Configuration
Available Methods
HLRLookup
Performs a Home Location Register lookup for a mobile number.
Parameters:
$msisdn(string): Mobile number in international format (e.g., '353871234567')
Returns:
- Array containing operator information, validity status, and lookup metadata
Example:
getCustomerPremiumInfo
Retrieves detailed customer information for a mobile number.
Parameters:
$msisdn(string): Mobile number in international format
Returns:
- Array containing customer details, credit information, and account status
Example:
getPackageInfo
Returns information about the CamaraClient package.
Returns:
- Array with package name, vendor, version, description, and configured settings
getVersion
Returns the current package version.
Authentication
The package handles OAuth2 authentication automatically. When you call any API method:
- The client checks if authentication is required
- Requests an access token using client credentials flow
- Includes the token in API requests
- Handles token expiration and errors gracefully
You don't need to manage tokens manually - the package handles everything internally.
Error Handling
The package returns structured arrays with error information when operations fail:
Advanced Usage
Multi-Environment Configuration
Dependency Injection
Debug Information
Get comprehensive debug information about authentication and configuration:
Package Structure
Security Considerations
- ⚠️ Never commit credentials - Store
client_idandclient_secretin environment variables - 🔒 Use HTTPS - Always use secure URLs for token and service endpoints
- 🔑 Rotate secrets - Regularly rotate your OAuth2 credentials
- 📝 Audit logs - Monitor API usage and authentication attempts
Development
Running Tests
Code Style
This package follows PSR-4 autoloading and PSR-12 coding standards.
Support
For issues, questions, or contributions, please visit:
- Packagist: https://packagist.org/packages/infiniteloop/camara-client
- GitHub: [Your repository URL]
License
This package is open-source software licensed under the MIT license.
Credits
Developed by Infinite Loop Development Ltd
Changelog
Version 2.0.0
- Added configurable settings injection
- Implemented OAuth2 authentication
- Added HLR lookup functionality
- Added customer premium info retrieval
- Improved error handling
- Enhanced documentation
Version 1.0.0
- Initial release
- Basic package structure
- Hello World example
Made with ❤️ by Infinite Loop Development