Download the PHP package palpalani/laravel-bandwidth-api without Composer

On this page you can find all versions of the php package palpalani/laravel-bandwidth-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-bandwidth-api

Bandwidth API for Laravel

Latest Version on Packagist PHP Version Laravel Version GitHub Tests Action Status GitHub Code Style Action Status Total Downloads License


A simple, elegant Laravel wrapper for the Bandwidth API. Send SMS/MMS messages, make voice calls, implement two-factor authentication, and integrate WebRTC communications into your Laravel applications with ease.

Features

Requirements

Installation

Install the package via Composer:

Publish the configuration file:

This will create a config/bandwidth.php configuration file.

Configuration

Add your Bandwidth API credentials to your .env file:

Published Configuration File

The config/bandwidth.php file contains the following structure:

Note: You don't need credentials for all APIs. Configure only the services you plan to use.

Getting Your Credentials

  1. Sign up for a Bandwidth account
  2. Navigate to your Bandwidth Dashboard
  3. Create API credentials for the services you need
  4. For messaging, create an Application to get your application_id
  5. Your account_id can be found in your account settings

Usage

Basic SMS Messaging

Using the Facade:

Using Dependency Injection:

Message Tagging

Organize and track messages with custom tags (available since v0.6.0):

Response Structure

All sendMessage() calls return a structured array (since v0.5.0):

Success Response:

Error Response:

Error Handling

Dashboard API Access

Access your Bandwidth account information:

Advanced: Direct SDK Access

For advanced use cases, access the underlying Bandwidth SDK clients directly:

API Reference

Bandwidth Class

sendMessage()

Send an SMS or MMS message.

Parameters:

Returns: Array with keys:

getAccount()

Get the Bandwidth account object for dashboard operations.

Returns: Iris\Account object for account management

Environment Variables

Variable Required Description Example
BANDWIDTH_MESSAGING_USERNAME For SMS/MMS Messaging API username api-user-123
BANDWIDTH_MESSAGING_PASSWORD For SMS/MMS Messaging API password api-password-456
BANDWIDTH_MESSAGING_ACCOUNT_ID For SMS/MMS Your Bandwidth account ID 1234567
BANDWIDTH_MESSAGING_APPLICATION_ID For SMS/MMS Messaging application ID app-abc123
BANDWIDTH_VOICE_USERNAME For Voice Voice API username voice-user-123
BANDWIDTH_VOICE_PASSWORD For Voice Voice API password voice-pass-456
BANDWIDTH_VOICE_ACCOUNT_ID For Voice Voice account ID 1234567
BANDWIDTH_TWO_FACTOR_USERNAME For 2FA Two-factor API username 2fa-user-123
BANDWIDTH_TWO_FACTOR_PASSWORD For 2FA Two-factor API password 2fa-pass-456
BANDWIDTH_TWO_FACTOR_ACCOUNT_ID For 2FA Two-factor account ID 1234567
BANDWIDTH_WEBRTC_USERNAME For WebRTC WebRTC API username webrtc-user-123
BANDWIDTH_WEBRTC_PASSWORD For WebRTC WebRTC API password webrtc-pass-456
BANDWIDTH_WEBRTC_ACCOUNT_ID For WebRTC WebRTC account ID 1234567
BANDWIDTH_DASHBOARD_USERNAME For Dashboard Dashboard/IRIS username dashboard-user-123
BANDWIDTH_DASHBOARD_PASSWORD For Dashboard Dashboard/IRIS password dashboard-pass-456
BANDWIDTH_DASHBOARD_API_URL Optional Dashboard API endpoint https://dashboard.bandwidth.com/api/

Testing

Run the test suite:

Run static analysis:

Fix code style issues:

Testing Your Integration

When testing, you can use Bandwidth's test credentials or mock the Bandwidth class:

Troubleshooting

Common Issues

Problem: "Application ID not configured"

Problem: "Invalid phone number format"

Problem: "The to parameter must be an array"

Problem: "Unexpected response type"

Enable Debug Logging

Add logging to debug issues:

Check API Status

Visit Bandwidth Status Page to check for service outages.

Upgrade Guide

Upgrading to v0.6.0 from v0.5.0

New Feature: Optional tag parameter added to sendMessage().

No breaking changes - fully backward compatible.

Upgrading to v0.5.0 from v0.4.0

Breaking Change: sendMessage() response structure changed.

Before (v0.4.0):

After (v0.5.0):

Migration Steps:

  1. Update all sendMessage() calls to handle the new array response
  2. Replace exception handling with $result['success'] checks
  3. Update tests to expect the new response structure

Upgrading to v0.4.0 from v0.3.0

Breaking Change: Removed $applicationId parameter from sendMessage().

Before (v0.3.0):

After (v0.4.0):

Migration Steps:

  1. Add BANDWIDTH_MESSAGING_APPLICATION_ID to your .env file
  2. Remove the $applicationId parameter from all sendMessage() calls
  3. Republish the config if you published it before v0.4.0

FAQ

Q: Do I need to configure all API credentials? A: No, only configure the services you plan to use. For example, if you only need SMS, just set the messaging credentials.

Q: What's the difference between account_id and application_id? A: The account_id is your Bandwidth account identifier. The application_id is specific to your messaging application created in the Bandwidth dashboard. You need both for messaging.

Q: Can I send messages to multiple recipients? A: Yes, pass an array of phone numbers to the to parameter. Bandwidth will send individual messages to each recipient.

Q: How do I send MMS with images? A: Currently, the package's sendMessage() helper focuses on text messages. For MMS with media, use the direct SDK access to set the media property on the MessageRequest object.

Q: Is there a rate limit? A: Yes, Bandwidth enforces rate limits. Check your account's rate limits in the Bandwidth dashboard and implement appropriate throttling in your application.

Q: How can I track message delivery status? A: Configure webhooks in your Bandwidth dashboard to receive delivery receipts. The package returns a message ID that you can use to correlate webhook callbacks.

Q: Does this support Laravel Vapor/serverless? A: Yes, the package is stateless and works with serverless deployments like Laravel Vapor.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

We welcome contributions! Whether it's:

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Never commit your Bandwidth API credentials to version control. Always use environment variables and keep your .env file secure.

Credits

This package is a Laravel wrapper for the official Bandwidth SDK. Special thanks to Bandwidth for providing excellent communications APIs.

License

The MIT License (MIT). Please see License File for more information.

Resources


Note: This is an unofficial Laravel package. Bandwidthยฎ is a registered trademark of Bandwidth Inc.


All versions of laravel-bandwidth-api with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
bandwidth/iris Version ^4.3
bandwidth/sdk Version ^11.0
illuminate/contracts Version ^10.0|^11.0|^12.0
spatie/laravel-package-tools Version ^1.14
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package palpalani/laravel-bandwidth-api contains the following files

Loading the files please wait ...