sailing2014 / chat-api-sdk-php
The SDK allows you to receive and send messages through your WhatsApp account. [Sign up now](https://app.chat-api.com/) The Chat API is based on the WhatsApp WEB protocol and excludes the ban both when using libraries from mgp25 and the like. Despite this, your account can be banned by anti-spam sy
Requires
- php: >=7.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ~2.12
- phpunit/phpunit: ^7.4
- squizlabs/php_codesniffer: ~2.6
This package is auto-updated.
Last update: 2024-09-26 12:40:53 UTC
README
The SDK allows you to receive and send messages through your WhatsApp account. Sign up now
The Chat API is based on the WhatsApp WEB protocol and excludes the ban both when using libraries from mgp25 and the like. Despite this, your account can be banned by anti-spam system WhatsApp after several clicking the "block" button.
This PHP package is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Build package: org.openapitools.codegen.languages.PhpClientCodegen
Requirements
PHP 5.5 and later
Installation & Usage
Composer
To install the bindings via Composer, add the following to composer.json
:
{ "repositories": [ { "type": "vcs", "url": "https://github.com/sailing2014/chat-api-sdk-php.git" } ], "require": { "sailing2014/chat-api-sdk-php": "dev-master" } }
Then run composer install
Manual Installation
Download the files and include autoload.php
:
require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
Tests
To run the unit tests:
composer install ./vendor/bin/phpunit
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); // Configure API key authorization: instanceId $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('instanceId', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('instanceId', 'Bearer'); // Configure API key authorization: token $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKey('token', 'YOUR_API_KEY'); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed // $config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('token', 'Bearer'); $apiInstance = new OpenAPI\Client\Api\Class1InstanceApi( // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. // This is optional, `GuzzleHttp\Client` will be used as default. new GuzzleHttp\Client(), $config ); try { $result = $apiInstance->expiry(); print_r($result); } catch (Exception $e) { echo 'Exception when calling Class1InstanceApi->expiry: ', $e->getMessage(), PHP_EOL; } ?>
Documentation for API Endpoints
All URIs are relative to https://api.chat-api.com
Documentation For Models
- Ack
- BanSettings
- BanTestAction
- BanTestStatus
- Chat
- ChatIdProp
- ChatUpdate
- Chats
- ClearActionsQueueStatus
- ClearMessagesQueueStatus
- CreateGroupAction
- CreateGroupStatus
- ForwardMessageRequest
- GroupParticipantAction
- GroupParticipantStatus
- InlineResponse200
- InlineResponse2001
- InlineResponse2002
- InlineResponse2003
- InlineResponse2004
- InlineResponse2005
- InlineResponse2005Update
- InlineResponse401
- InstanceStatus
- InstanceStatusAction
- InstanceStatusLink
- InstanceStatusStatusData
- InstanceStatusStatusDataActions
- Message
- Messages
- OutboundAction
- OutboundActions
- OutboundMessage
- OutboundMessages
- PhoneProp
- ReadChatAction
- ReadChatStatus
- SendContactRequest
- SendFileRequest
- SendLinkRequest
- SendLocationRequest
- SendMessageRequest
- SendMessageStatus
- SendPTTRequest
- SendVCardRequest
- SetWebhookStatus
- Settings
- Status
- Statuses
- WebhookStatus
- WebhookUrl
Documentation For Authorization
instanceId
- Type: API key
- API key parameter name: instanceId
- Location: URL query string
token
- Type: API key
- API key parameter name: token
- Location: URL query string