mirror of
https://github.com/BushlanovDev/max-bot-api-client-php.git
synced 2026-08-22 07:42:13 +00:00
first commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace BushlanovDev\MaxMessengerBot;
|
||||
|
||||
use BushlanovDev\MaxMessengerBot\Exceptions\ClientApiException;
|
||||
use BushlanovDev\MaxMessengerBot\Exceptions\NetworkException;
|
||||
use BushlanovDev\MaxMessengerBot\Exceptions\SerializationException;
|
||||
|
||||
interface ClientApiInterface
|
||||
{
|
||||
/**
|
||||
* Performs a request to the Max Bot API.
|
||||
*
|
||||
* @param string $method The HTTP method (GET, POST, PATCH, etc.).
|
||||
* @param string $uri The API endpoint (e.g., '/me', '/messages').
|
||||
* @param array<string, mixed> $queryParams Query parameters for the request.
|
||||
* @param array<string, mixed> $body The request body.
|
||||
*
|
||||
* @return array<string, mixed> The decoded JSON response as an associative array.
|
||||
*
|
||||
* @throws ClientApiException for API-level errors (4xx, 5xx).
|
||||
* @throws NetworkException for network-related issues.
|
||||
* @throws SerializationException for JSON encoding/decoding failures.
|
||||
*/
|
||||
public function request(string $method, string $uri, array $queryParams = [], array $body = []): array;
|
||||
}
|
||||
Reference in New Issue
Block a user