qqzii / map-client
PHP client for MAP API
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/qqzii/map-client
Requires
- php: ^8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.4
- monolog/monolog: ^3.0
This package is not auto-updated.
Last update: 2025-12-24 17:59:57 UTC
README
Installation
Install the latest version with
composer require qqzii/map-client
Basic Usage
Init config file map.php with simple structure
[
'url' => 'your.map.url',
'api_version' => 'v1',
'auth' => [
'login' => 'your_login',
'secret' => 'your_secret_key',
],
'logger' => [
'name' => 'name_of_your_logger',
'filepath' => 'path/to/your/logger/file.log',
],
];
Basic way of interaction
$mapService = new MapService(config('map')); $indexQueryParamsExample = [ 'per_page' => 10, 'page' => 1, 'with' => ['topics'], 'filters' => ['first_name' => 'Olivia'] ]; $mapService->getCustomers($indexQueryParamsExample)
Available methods for interactions with MAP
public function getCustomers(array $queryParams = []): array
public function getCustomer(string $customerId, array $queryParams = []): array
public function createCustomer(array $bodyArgs = []): array
public function updateCustomer(string $customerId, array $bodyArgs = []): array
public function deleteCustomer(string $customerId): array
public function initCustomerEvent(string $customerId, string $eventSlug, array $bodyArgs = []): array
public function attachCustomerToSegment(string $customerId, string $segmentId): array
public function detachCustomerFromSegment(string $customerId, string $segmentId): array
public function getSegments(array $queryParams = []): array
public function getSegment(string $segmentId, array $queryParams = []): array
public function createSegment(array $bodyArgs = []): array
public function updateSegment(string $segmentId, array $bodyArgs = []): array
public function deleteSegment(string $segmentId): array
public function getTopics(array $queryParams = []): array
public function getTopic(string $topicId, array $queryParams = []): array
public function getMessages(array $queryParams = []): array
public function getMessage(string $messageId, array $queryParams = []): array
public function initMessageEvent(array $bodyArgs = []): array
public function createDevice(array $bodyArgs = []): array
public function updateDevice(string $deviceId, array $bodyArgs = []): array