PHPackages                             logotel/logobot-php-integration - 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. logotel/logobot-php-integration

ActiveLibrary

logotel/logobot-php-integration
===============================

A package to integrate with LogoBot

1.14.0(1y ago)05.4k↓41.7%MITPHPPHP ^5.6||^7.4||^8.0

Since Feb 27Pushed 1y ago4 watchersCompare

[ Source](https://github.com/Logotel/logobot-php-integration)[ Packagist](https://packagist.org/packages/logotel/logobot-php-integration)[ RSS](/packages/logotel-logobot-php-integration/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (7)Versions (26)Used By (0)

 [![Logotel Logo](.art/logotel-logo.png)](.art/logotel-logo.png)

[![Tests](https://github.com/Logotel/logobot-php-integration/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/Logotel/logobot-php-integration/actions/workflows/test.yml/badge.svg?branch=main)[![Packagist](https://camo.githubusercontent.com/1260aa9a0d3440626cb555edce79d260ac33eaed205344d38a678ba01458b9be/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6f676f74656c2f6c6f676f626f742d7068702d696e746567726174696f6e2e737667)](https://camo.githubusercontent.com/1260aa9a0d3440626cb555edce79d260ac33eaed205344d38a678ba01458b9be/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6f676f74656c2f6c6f676f626f742d7068702d696e746567726174696f6e2e737667)

Logobot PHP integration
=======================

[](#logobot-php-integration)

This package aim to provide the integration with Logobot

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

[](#installation)

Install via composer:

```
composer require logotel/logobot-php-integration
```

Generating JWT
--------------

[](#generating-jwt)

Generate your JWT with:

```
use Logotel\Logobot\Manager;

$jwt = Manager::jwt()
        ->setKey(file_get_contents('/path/to/private_key.pem'))
        ->setLicense($license)
        ->setEmail($email)
        ->setIdentifier($identifier)
        ->setPermissions($permissions)
        ->setIsSuperUser($is_super_user)
        ->setExpiration($expiration)
        ->generate();
```

The key can be retrieved by a file path:

```
use Logotel\Logobot\Manager;

$jwt = Manager::jwt()
        ->setKeyFromFile('/path/to/private_key.pem')
        ->setLicense($license)
        ->setEmail($email)
        ->setIdentifier($identifier)
        ->setPermissions($permissions)
        ->setIsSuperUser($is_super_user)
        ->setExpiration($expiration)
        ->generate();
```

### Super user

[](#super-user)

The property (bool) can set if the user has high privilege. The privileges will be managed by the server application.

### Token expiration

[](#token-expiration)

The token default lifetime is 24 hours. You can edit it with ` ->setExpiration(int $expiration)`. The expiration time is in seconds (deafult 60 \* 60 \* 24)

### User payload

[](#user-payload)

ParameterTypeDescriptionemailStringThe email address of the useridentifierStringThe user identifierlicenseStringThe bot licensepermissionsArray(String)The user's permissionsis\_super\_userBoolIf the user is super userAuthenticate without JWT
------------------------

[](#authenticate-without-jwt)

In case of JWT too big (&gt;2kb) you have to use `/authenticate` endpoint.

Before proceeding create a JWT as described [here](#generating-jwt)

```
use Logotel\Logobot\Manager;

$key = Manager::authenticate()
        ->setJwt($jwt)
        ->generate();
```

The key will be then used instead of jwt

Uploading text (with link)
--------------------------

[](#uploading-text-with-link)

```
use Logotel\Logobot\Manager;

Manager::textUpload()
        ->setApiKey($api_key)
        ->setIdentifier($identifier)
        ->setTitle($title)
        ->setContent($content)
        ->setLink($link)
        ->setPermissions($permissions)
        ->setLanguage($language)
        ->setMetadata($metadata)
        ->setDocumentDate($document_date)
        ->setIsSearchable(true | false)
        ->setIsGenerative(true | false)
        ->upload();
```

If you want to change the endpoint base url you can change it by:

```
Manager::textUpload()->setApiUrl("https://something.test");
```

You can also set a custom http client

```
Manager::textUpload()->setClient(new \GuzzleHttp\Client(...));
```

`is_searchable` and `is_generative` are `true` by default

Bulk importer
-------------

[](#bulk-importer)

The bulk importer functionality will take care of processing multiple file at once. The file uploaded must by a zip file, containing:

- *n* files in pdf or txt format
- a json file named `details.json` with this structure, with one entry for each file:

```
[
  {
    "name": "name_of_the_file.pdf",
    "permissions": [
      "a",
      "list",
      "of",
      "permissions",
    ],
    "language": "selected_language",
    "metadata": {
        "some": "value",
        "another": "value",
    },
    "document_date": "2024-05-29",
    "is_searchable": true,
    "is_generative": true
  },
  {
    ...
  },
  ...
]
```

The number of the entries in the array must be `total files in zip - 1` (the json file).

#### Usage

[](#usage)

```
use Logotel\Logobot\Manager;

Manager::bulkImporter()
        ->setApiKey($api_key)
        ->setFilePath($file_path)
        ->upload();
```

If you want to change the endpoint base url you can change it by:

```
Manager::textUpload()->setApiUrl("https://something.test");
```

You can also set a custom http client

```
Manager::textUpload()->setClient(new \GuzzleHttp\Client(...));
```

Delete document
---------------

[](#delete-document)

```
use Logotel\Logobot\Manager;

Manager::deleteDocument()
        ->setApiKey($api_key)
        ->setIdentifier($identifier)
        ->delete();
```

If you want to change the endpoint base url you can change it by:

```
Manager::deleteDocument()->setApiUrl("https://something.test");
```

You can also set a custom http client

```
Manager::deleteDocument()->setClient(new \GuzzleHttp\Client(...));
```

Search engine
-------------

[](#search-engine)

Search the most relevant documents based on search query.

`$jwt` is the jwt token generated using [Generating JWT](#generating-jwt)

`$query` is the search query

`$limit` is the **maximum** amount of documents to retrieve

`$filters` is an array of available filters. At the moment are supported:

Filter keyTypeDescriptionExampledate\_fromDateFilter documents based on creation date2024-06-24```
use Logotel\Logobot\Manager;

Manager::searchEngine()
        ->setApiKey($api_key)
        ->setJwt($jwt)
        ->setQuery($query)
        ->setLimit($limit)
        ->setFilters($filters)
        ->search();
```

The ouput will be

```
[
  {
     "uuid": "fdb07973-4955-40db-a8d1-d5b8547b4c9b",
     "name": "my document",
     "icon": "file-pdf",
     "distance": 0.253548767,
     "created_at": "10/10/2024 10:10:10"
   },
   ...
]
```

`icon` possible values are:

- file-pdf
- file-word
- file-powerpoint
- file-excel
- file-alt
- file

If you want to change the endpoint base url you can change it by:

```
Manager::deleteDocument()->setApiUrl("https://something.test");
```

You can also set a custom http client

```
Manager::deleteDocument()->setClient(new \GuzzleHttp\Client(...));
```

Contributing
------------

[](#contributing)

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D

History
-------

[](#history)

Version 1.00 (2024-02-27) - first commit

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing-1)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Garavaglia Giacomo](https://github.com/giagara)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

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

Every ~10 days

Total

24

Last Release

578d ago

PHP version history (2 changes)1.0.0PHP ^7.4||^8.0

1.9.0PHP ^5.6||^7.4||^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/6fc9f11be7e67adf04a4b1663e2586d2a36ec2ce281c85d492c3cd80e00256a7?d=identicon)[logotel](/maintainers/logotel)

---

Top Contributors

[![giagara](https://avatars.githubusercontent.com/u/79515022?v=4)](https://github.com/giagara "giagara (37 commits)")[![marcosvega91](https://avatars.githubusercontent.com/u/5365582?v=4)](https://github.com/marcosvega91 "marcosvega91 (8 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/logotel-logobot-php-integration/health.svg)

```
[![Health](https://phpackages.com/badges/logotel-logobot-php-integration/health.svg)](https://phpackages.com/packages/logotel-logobot-php-integration)
```

###  Alternatives

[laravel/socialite

Laravel wrapper around OAuth 1 &amp; OAuth 2 libraries.

5.7k96.9M674](/packages/laravel-socialite)[kreait/firebase-php

Firebase Admin SDK

2.4k39.7M72](/packages/kreait-firebase-php)[omniphx/forrest

A Laravel library for Salesforce

2724.4M8](/packages/omniphx-forrest)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[opentok/opentok

OpenTok is a platform for creating real time streaming video applications, created by TokBox.

1413.0M10](/packages/opentok-opentok)[pusher/pusher-push-notifications

562.5M9](/packages/pusher-pusher-push-notifications)

PHPackages © 2026

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