messagebird / php-rest-api
MessageBird REST API client for PHP
Installs: 7 226 843
Dependents: 29
Suggesters: 1
Security: 0
Stars: 158
Watchers: 17
Forks: 95
Open Issues: 5
Requires
- php: >=7.3|~8.0.0|~8.1.0|~8.2.0
- ext-curl: *
- ext-json: *
- firebase/php-jwt: ^5.5.1|^6.2
Requires (Dev)
- phpunit/phpunit: ^9.5.14
- vimeo/psalm: 4.18.1
- dev-master
- v3.1.5
- v3.1.4
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.0
- v2.1.0
- v2.0.1
- v2.0.0
- v1.20.0
- v1.19.2
- v1.19.1
- v1.18.0
- v1.17.0
- v1.16.1
- 1.16.0
- 1.15.0
- 1.14.1
- 1.14.0.1
- 1.14.0
- v1.13.0
- v1.12.0-beta
- v1.11.0-beta
- v1.10.0
- v1.9.5
- v1.9.4
- v1.9.3
- v1.9.2
- v1.9.1
- v1.9.0
- v1.8.0
- v1.7.0
- v1.6.7
- v1.6.6
- v1.6.5
- v1.6.4
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.1
- v1.5.0
- 1.4.1
- 1.4.0
- 1.3.1
- 1.3.0
- 1.2.0
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.0
- dev-fix/fix-broken-fragile-testcase
- dev-chore/release-3.1.4
- dev-chore-release
- dev-pr/210
- dev-bugfix-207
- dev-update-sdk
- dev-update-bundle
- dev-chore-bump-version
- dev-chore/bump-release-version-2
- dev-bugfix/fix-empty-items
- dev-feature-code-cleanup
- dev-improve-tests
- dev-travis-ci-update
This package is auto-updated.
Last update: 2024-11-04 08:22:58 UTC
README
This repository contains the open source PHP client for MessageBird's REST API. Documentation can be found at: https://developers.messagebird.com/
Requirements
- Sign up for a free MessageBird account
- Create a new access_key in the developers sections
- MessageBird API client for PHP requires PHP >= 7.3.
Installation
Composer installation
- Download composer
- Run
composer require messagebird/php-rest-api
.
Manual installation
When you do not use Composer. You can git checkout or download this repository and include the MessageBird API client manually.
Usage
We have put some self-explanatory examples in the examples directory, but here is a quick breakdown on how it works. First, you need to set up a MessageBird\Client. Be sure to replace YOUR_ACCESS_KEY with something real.
require 'autoload.php'; $messageBird = new \MessageBird\Client('YOUR_ACCESS_KEY');
That's easy enough. Now we can query the server for information. Lets use getting your balance overview as an example:
// Get your balance $balance = $messageBird->balance->read();
Conversations WhatsApp Sandbox
To use the WhatsApp sandbox you need to add \MessageBird\Client::ENABLE_CONVERSATIONSAPI_WHATSAPP_SANDBOX
to the list of features you want enabled. Don't forget to replace YOUR_ACCESS_KEY
with your actual access key.
$messageBird = new \MessageBird\Client('YOUR_ACCESS_KEY', null, [\MessageBird\Client::ENABLE_CONVERSATIONSAPI_WHATSAPP_SANDBOX]);
If you use a custom HttpClient
you will have to manually direct Conversation API request to the WhatsApp sandbox endpoint.
Documentation
Complete documentation, instructions, and examples are available at: https://developers.messagebird.com/
License
The MessageBird REST Client for PHP is licensed under The BSD 2-Clause License. Copyright (c) 2014, MessageBird