PHPackages                             artesaos/zenvia-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. artesaos/zenvia-php

AbandonedArchivedLibrary[API Development](/categories/api)

artesaos/zenvia-php
===================

Zenvia API 2.0 with your PHP application, build on top of the psr-7 components.

141744PHP

Since Mar 12Pushed 10y ago5 watchersCompare

[ Source](https://github.com/artesaos/zenvia-php)[ Packagist](https://packagist.org/packages/artesaos/zenvia-php)[ RSS](/packages/artesaos-zenvia-php/feed)WikiDiscussions develop Synced today

READMEChangelogDependenciesVersions (3)Used By (0)

Zenvia PHP
==========

[](#zenvia-php)

[![Build Status](https://camo.githubusercontent.com/94ad3df5ffa9e28c8f5e2649938e32960b14a3b12ce0e5f3c502fdde9b1bca6a/68747470733a2f2f7472617669732d63692e6f72672f6172746573616f732f7a656e7669612d7068702e7376673f6272616e63683d646576656c6f70)](https://travis-ci.org/artesaos/zenvia-php)

> # ⚠️ Under Development 🚧
>
> [](#warning-under-development-construction)

Introduction
------------

[](#introduction)

This package integrate the Zenvia SMS Gateway API 2.0 with your PHP application, built with PSR-7 in mind.

Table of Contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Usage](#usage)
    - [Sending SMS](#sending-sms)
    - [Sending Multiple SMS](#sending-multiple-sms)
    - [Schedule SMS](#schedule-sms)
    - [Check the status of a Delivered SMS](#check-the-status-of-a-delivered-sms)
    - [Changing The Response Format](#changing-the-response-format)
- [License](#license)

Installation
------------

[](#installation)

> Not work for now!

This project follow the [psr-7](http://www.php-fig.org/psr/psr-7/) standards and no have a dependency of an specific HTTP client. You need require a library for send the Http requests manually, at your choice. Consult this list to find a client that support [php-http/client-implementation](https://packagist.org/providers/php-http/client-implementation). For more information about virtual packages please refer to [Httplug](http://docs.php-http.org/en/latest/httplug/users.html). Example:

```
composer require php-http/guzzle6-adapter
```

Then install this package with composer:

```
composer require artesaos/zenvia-php
```

Usage
-----

[](#usage)

First, see the [Zenvia API Documentation](http://docs.zenviasms.apiary.io/#reference/servicos-da-api/envio-de-um-unico-sms) for view the structure of requests and responses.

### Sending SMS

[](#sending-sms)

The class you need use for sending sms is the `Artesaos\Zenvia\SMS.php`. Let`s get started sending one sms:

```
$sms = new Artesaos\Zenvia\SMS('your_account','your_password');
$response = $sms->send(['id'=>'001','from'=>'sender','to'=>'phone_number','msg'=>'message']);
```

The `send` and `sendMultiple` method return for default a `psr7` response, but you can choose the response type, passing a third argument to the send method. The second argument is a optional `aggregateId` parameter. The response type argument is a string and need to be one of: `array`,`obj`,`string`,`stream`,`simple_xml` or `psr7`(default). Example:

```
$sms = new Artesaos\Zenvia\SMS('your_account','your_password');
$response = $sms->send(['id'=>'001','from'=>'sender','to'=>'phone_number','msg'=>'message'],null,'simple_xml');
```

If you need convert your psr7 response to one of the response types manually, see the [Changing The Response Format](#changing-the-response-format) section.

### Sending Multiple SMS

[](#sending-multiple-sms)

For sending multiple SMS at a time, use the `sendMultiple` method instead of `send` method. This method has the same signature:

```
$messages = [
    [
        'id'=>'001',
        'from'=>'sender',
        'to'=>'phone_number'
        'msg'=>'message'
    ],
    [
        'id'=>'002',
        'from'=>'sender',
        'to'=>'phone_number'
        'msg'=>'message'
    ],
];
$sms = new Artesaos\Zenvia\SMS('your_account','your_password');
$response = $sms->sendMultiple($messages);
```

### Schedule SMS

[](#schedule-sms)

You can schedule a text message to be sent passing a schedule attribute to the body of your sms:

```
$sms = new Artesaos\Zenvia\SMS('your_account','your_password');
$response = $sms->send(['id'=>'001','from'=>'sender','to'=>'phone_number','msg'=>'message','schedule'=>'15/04/2016 17:10:23']);
```

By default the Zenvia API accepts the ISO format, someting like this `2016-04-15T17:10:23`. Thanks to Carbon extension for make this more easy. Instead of a ISO date string, you may pass a variety of formats accepted by Carbon.

Example:

- `+1 day`
- `tomorrow 13:00`
- `first day of April 17:10:23`
- `this sunday 20:20:10`
- `17:10:23`
- `15/04/2016 17:10:23`

You can use any format accepted by Carbon contructor(or parse method).See more options on the [Carbon documentation](http://carbon.nesbot.com/docs/)

### Check the status of a Delivered SMS

[](#check-the-status-of-a-delivered-sms)

You can check the status of a delivered SMS using the `check` method. The first argument is the sms `id` and the second the response format:

```
$sms = new Artesaos\Zenvia\SMS('your_account','your_password');
$response = $sms->check($id, 'obj');
```

### Changing The Response Format

[](#changing-the-response-format)

If you need change the response format manually, use the `Artesaos\Http\ResponseHandler` class. Call the static `convert` method for convert your PSR-7 response to one of the formats above:

`array`,`obj`,`string`,`stream`,`simple_xml`

Note: The response to be converted must be a valid `PSR-7` format!

```
$converted_response = Artesaos\Zenvia\Http\ResponseHandler::convert($response, $format);
```

> Work in progress!

License
-------

[](#license)

This project is open-source and licensed under the MIT license

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10168637?v=4)[Mauri de Souza Meneguzzo](/maintainers/mauri870)[@mauri870](https://github.com/mauri870)

---

Top Contributors

[![mauri870](https://avatars.githubusercontent.com/u/10168637?v=4)](https://github.com/mauri870 "mauri870 (96 commits)")

### Embed Badge

![Health badge](/badges/artesaos-zenvia-php/health.svg)

```
[![Health](https://phpackages.com/badges/artesaos-zenvia-php/health.svg)](https://phpackages.com/packages/artesaos-zenvia-php)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
