PHPackages                             zozocorp/worker - 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. zozocorp/worker

ActiveLibrary[API Development](/categories/api)

zozocorp/worker
===============

The Worker SDK provides methods for all API functions.

v1.0.0(4y ago)03MITPHPPHP ^7.3 || ^8.0

Since Jun 5Pushed 4y ago1 watchersCompare

[ Source](https://github.com/zozocorp/worker)[ Packagist](https://packagist.org/packages/zozocorp/worker)[ RSS](/packages/zozocorp-worker/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)Dependencies (9)Versions (2)Used By (0)

Worker PHP client
=================

[](#worker-php-client)

This is the Worker PHP SDK. This SDK contains methods for easily interacting with the Worker API. Below are examples to get you started. For additional examples, please see our official documentation at

[![Join the chat at https://gitter.im/worker/worker-php](https://camo.githubusercontent.com/b594306ddefa3a97c0a4a229a3cd2b7eb5248b8697780e37f629a79c0eb14a82/68747470733a2f2f6261646765732e6769747465722e696d2f776f726b65722f776f726b65722d7068702e737667)](https://gitter.im/worker/worker-php?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

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

[](#installation)

To install the SDK, you will need to be using [Composer](http://getcomposer.org/)in your project. If you aren't using Composer yet, it's really simple! Here's how to install composer:

```
curl -sS https://getcomposer.org/installer | php
```

The Worker API Client is not hard coupled to Guzzle, Buzz or any other library that sends HTTP messages. Instead, it uses the [PSR-18](https://www.php-fig.org/psr/psr-18/) client abstraction. This will give you the flexibility to choose what [PSR-7 implementation and HTTP client](https://packagist.org/providers/php-http/client-implementation)you want to use.

If you just want to get started quickly you should run the following command:

```
composer require zozocorp/worker
```

Usage
-----

[](#usage)

You should always use Composer autoloader in your application to automatically load your dependencies. All the examples below assume you've already included this in your file:

```
require 'vendor/autoload.php';
use Worker\Worker;
```

Here's how to send a message using the SDK:

```
// First, instantiate the SDK with your API credentials
$wk = Worker::create('key-example'); // For VI servers

// Now, compose and send your message.
// $wk->messages()->send($domain, $params);
$wk->email()->send('example.com', [
  'from'    => 'bob@example.com',
  'to'      => 'sally@example.com',
  'subject' => 'The PHP SDK is awesome!',
  'text'    => 'It is so simple to send a message.'
]);
```

Attention: `$domain` must match to the domain you have configured on [worker.zozo.vn](https://worker.zozo.vn).

### All usage examples

[](#all-usage-examples)

You will find more detailed documentation at [/doc](https://worker.zozo.vn/frontend/docs/api/v1) and on [https://documentation.worker.com](https://worker.zozo.vn/frontend/docs/api/v1).

### VERIFY EMAIL

[](#verify-email)

```
$wk = Worker::create('key-example');
$dns = $wk->email()->verify(['email' => 'ws@zozo.vn']);
```

If you'd rather work with an array than an object you can inject the `ArrayHydrator`to the Worker class.

### MINIFY

[](#minify)

The result of an API call is, by default, a domain object. This will make it easy to understand the response without reading the documentation. One can just read the doc blocks on the response classes. This provides an excellent IDE integration.

### MINIFY HTML

[](#minify-html)

```
$wk = Worker::create('key-example');
$dns = $wk->template()->minify(['template' => '

    CONVERT HTML TO AMP

    MINIFY HTML

']);
```

If you'd rather work with an array than an object you can inject the `ArrayHydrator`to the Worker class.

### CONVERT HTML TO AMP

[](#convert-html-to-amp)

```
$wk = Worker::create('key-example');
$dns = $wk->template()->amp(['template' => '

    CONVERT HTML TO AMP

    CONVERT HTML TO AMP

']);
```

If you'd rather work with an array than an object you can inject the `ArrayHydrator`to the Worker class.

### MINIFY IMAGES

[](#minify-images)

C1: Use the api post header form data or push directly from the form

```
$wk = Worker::create('key-example');
$dns = $wk->image()->shrink(['image' => $file]);
```

C2: use api post images curl

```
$wk = Worker::create('key-example');
$dns = $wk->image()->shrink(['image' => $_FILES['image']]);
```

### GEO IP

[](#geo-ip)

```
$wk = Worker::create('key-example');
$dns = $wk->ip()->info(['ip' => '125.212.192.170']);
```

You can also use the `NoopHydrator` to get a PSR7 Response returned from the API calls.

### URL screenshot

[](#url-screenshot)

```
$width = 1080;
$height = 650;
$url = 'https://zozo.vn/';
$wk = Worker::create('key-example');
$dns = $wk->url()->screenshot(['url' => $url, 'width' => $width, 'height' => $height]);
```

You can also use the `NoopHydrator` to get a PSR7 Response returned from the API calls.

### URL screenshot

[](#url-screenshot-1)

```
$width = 1080;
$height = 650;
$url = 'https://zozo.vn/';
$wk = Worker::create('key-example');
$dns = $wk->url()->screenshot(['url' => $url, 'width' => $width, 'height' => $height]);
```

You can also use the `NoopHydrator` to get a PSR7 Response returned from the API calls.

### URL short

[](#url-short)

```
$url = 'https://zozo.vn/';
$wk = Worker::create('key-example');
$dns = $wk->url()->screenshot(['url' => $url]);
```

You can also use the `NoopHydrator` to get a PSR7 Response returned from the API calls.

### SEARCH

[](#search)

Search full text

```
$wk = Worker::create('key-example');
$dns = $wk->elasticsearch()->search(
    [
        'index' => 'index name',
        'keyword' => 'website giáo dục' ,
        'fields' => array('text', 'title', 'description')
    ]);
```

Search keyword trending

```
$wk = Worker::create('key-example');
$dns = $wk->elasticsearch()->trendingKeywords(
    [
        'merchant' => 'tên miền doanh nghiệp',
        'from' => 'thời gian bắt đầu' ,
        'to' => 'thời gian bắt đầu' ,
        'limit' => 'số bản ghi' ,
    ]);
```

Insert data

```
$url = 'https://zozo.vn/';
$wk = Worker::create('key-example');
$dns = $wk->elasticsearch()->insert(
    ['index' => 'index name' ,
     'data' => array('text' => 'insert content', 'title' => 'insert content', 'description' => 'insert content')
    ]);
```

Get data

```
$url = 'https://zozo.vn/';
$wk = Worker::create('key-example');
$dns = $wk->elasticsearch()->get(
    [
        'index' => 'index name',
        'id' => 1 ,
    ]);
```

Delete data

```
$url = 'https://zozo.vn/';
$wk = Worker::create('key-example');
$dns = $wk->elasticsearch()->delete(
    [
        'index' => 'index name',
        'id' => 1 ,
    ]);
```

Create index

```
$url = 'https://zozo.vn/';
$wk = Worker::create('key-example');
$dns = $wk->elasticsearch()->createIndex(
    [
        'index' => 'index name',
    ]);
```

Delete index

```
$url = 'https://zozo.vn/';
$wk = Worker::create('key-example');
$dns = $wk->elasticsearch()->deleteIndex(
    [
        'index' => 'index name',
    ]);
```

### Create QR code

[](#create-qr-code)

TYPE: use type text (name, email, phone, url, meta)

```
$type = 'text';
$name = 'zozo'; // Field is optional
$email = 'ws@zozo.vn'; // Field is optional
$meta = 'zozo.vn - Nền tảng thiết kế Website bán hàng chuyên nghiệp'; // Field is optional
$url = 'https://zozo.vn/'; // Field is optional
$phone = '0960099999'; // Field is optional

$wk = Worker::create('key-example');
$dns = $wk->qrCode()->encode(['type' => $type, 'content' => $meta]);
```

TYPE: use type mecard (name, address, phone, email, url)

```
$type = 'mecard';
$name = 'zozo'; // Field is optional
$email = 'ws@zozo.vn'; // Field is optional
$address = 'Tầng 7, Toà nhà iNET, số 247 Cầu Giấy, phường Dịch Vọng, Quận Cầu Giấy'; // Field is optional
$url = 'https://zozo.vn/'; // Field is optional
$phone = '0960099999'; // Field is optional

$wk = Worker::create('key-example');
$dns = $wk->qrCode()->encode(['type' => $type, 'name' => $name, 'email' => $email, 'address' => $address, 'url' => $url, 'phone' => $phone]);
```

TYPE: use type vcard (first\_name, last\_name, title, company, street, province, country, phone, email, url)

```
$type = 'vcard';
$first_name = 'le'; // Field is optional
$last_name = 'thi'; // Field is optional
$title = 'Nền tảng thiết kế Website bán hàng chuyên nghiệp'; // Field is optional
$company = 'zozo.vn'; // Field is optional
$email = 'ws@zozo.vn'; // Field is optional
$street = 'Tầng 7, Toà nhà iNET, số 247 Cầu Giấy, phường Dịch Vọng, Quận Cầu Giấy'; // Field is optional
$province = 'Hà Nội'; // Field is optional
$country = 'Việt Nam'; // Field is optional
$url = 'https://zozo.vn/'; // Field is optional
$phone = '0960099999'; // Field is optional

$wk = Worker::create('key-example');
$dns = $wk->qrCode()->encode([
    'first_name' => $first_name, 'last_name' => $last_name,
    'title' => $title, 'company' => $company, 'email' => $email,
    'street' => $street, 'province' => $province, 'country' => $country,
    'url' => $url, 'phone' => $phone]);
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.4% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1808d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/81798747?v=4)[Zozo](/maintainers/zozocorp)[@zozocorp](https://github.com/zozocorp)

---

Top Contributors

[![zozocorp](https://avatars.githubusercontent.com/u/81798747?v=4)](https://github.com/zozocorp "zozocorp (32 commits)")[![lethi2k](https://avatars.githubusercontent.com/u/57670659?v=4)](https://github.com/lethi2k "lethi2k (3 commits)")

---

Tags

composersdk

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zozocorp-worker/health.svg)

```
[![Health](https://phpackages.com/badges/zozocorp-worker/health.svg)](https://phpackages.com/packages/zozocorp-worker)
```

###  Alternatives

[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k22.6M232](/packages/openai-php-client)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[mailgun/mailgun-php

The Mailgun SDK provides methods for all API functions.

1.1k28.9M168](/packages/mailgun-mailgun-php)[theodo-group/llphant

LLPhant is a library to help you build Generative AI applications.

1.5k311.5k5](/packages/theodo-group-llphant)[deeplcom/deepl-php

Official DeepL API Client Library

2616.2M66](/packages/deeplcom-deepl-php)[jolicode/slack-php-api

An up to date PHP client for Slack's API

2534.4M12](/packages/jolicode-slack-php-api)

PHPackages © 2026

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