PHPackages                             veksa/carrot-api - 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. veksa/carrot-api

ActiveLibrary[API Development](/categories/api)

veksa/carrot-api
================

PHP Wrapper for Carrot Quest API

v2.0.0(9y ago)25.9k↓33.3%3[1 issues](https://github.com/veksa/carrot-api/issues)1MITPHPPHP &gt;=5.5.0CI failing

Since May 3Pushed 5y ago1 watchersCompare

[ Source](https://github.com/veksa/carrot-api)[ Packagist](https://packagist.org/packages/veksa/carrot-api)[ Docs](https://github.com/veksa/carrot-api)[ RSS](/packages/veksa-carrot-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (1)

PHP Carrot Quest Api
====================

[](#php-carrot-quest-api)

[![Stable Version](https://camo.githubusercontent.com/a2c5a542c4a119e0a02ac2bdff07513541233b0bbce57a7f6584d6edfd77fc2c/68747470733a2f2f706f7365722e707567782e6f72672f76656b73612f636172726f742d6170692f762f737461626c65)](https://packagist.org/packages/veksa/carrot-api)[![License](https://camo.githubusercontent.com/804ae5a381de5851a7c74945ee620c234e8b5fafffaa4afde58999add4776f4f/68747470733a2f2f706f7365722e707567782e6f72672f76656b73612f636172726f742d6170692f6c6963656e7365)](https://packagist.org/packages/veksa/carrot-api)[![Total Downloads](https://camo.githubusercontent.com/2a80bcfa4ec054b7543c728451709db100836945bca1f327184d8f7dcb753611/68747470733a2f2f706f7365722e707567782e6f72672f76656b73612f636172726f742d6170692f646f776e6c6f616473)](https://packagist.org/packages/veksa/carrot-api)[![Daily Downloads](https://camo.githubusercontent.com/34bcd5881276bc0eb57d4c7b573ece34c0d0f15517055349eb4f7d6aa700193b/68747470733a2f2f706f7365722e707567782e6f72672f76656b73612f636172726f742d6170692f642f6461696c79)](https://packagist.org/packages/veksa/carrot-api)[![Build Status](https://camo.githubusercontent.com/ee4acb03ede7d31e67cc3e55ccaf2a90057eab513c4ad998e28b3c622ab95ac5/68747470733a2f2f7472617669732d63692e6f72672f76656b73612f636172726f742d6170692e737667)](https://travis-ci.org/veksa/carrot-api)[![Code Climate](https://camo.githubusercontent.com/bfeea7e12cb5ec1426c325a0cd969256216e39df0602e120ce8e7574d937607b/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f76656b73612f636172726f742d6170692f6261646765732f6770612e737667)](https://codeclimate.com/github/veksa/carrot-api)[![Test Coverage](https://camo.githubusercontent.com/f8eae69903c759b91f39a94bc59035a931f8ddaa010ae8715df604d17e6b0ee6/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f76656b73612f636172726f742d6170692f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/veksa/carrot-api/coverage)

An extended native php wrapper for [Carrot Quest API](https://carrotquest.io/developers/endpoints/) without requirements. Supports all methods and types of responses.

\##Install The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require  veksa/carrot-api "~1.0"

```

or add

```
"veksa/carrot-api": "~1.0"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

### API Wrapper

[](#api-wrapper)

```
$carrot = new \Veksa\Carrot\Api('YOUR_APP_ID', 'YOUR_CARROT_API_TOKEN');
```

### Methods

[](#methods)

#### getActiveUsers

[](#getactiveusers)

Get the users who are currently online on the status of "online".

---

#### getCountLeads

[](#getcountleads)

Get count of users (leads). User if the lead is considered to be, if known contacts about it: name, email, phone, User ID, or it was at least one dialogue.

---

#### getLeads

[](#getleads)

Get all users (leads). User if the lead is considered to be, if known contacts about it: name, email, phone, User ID, or it was at least one dialogue.

**filters** *array*: array of filters, examples: .

**prop** *string*: property for sort. Default: $last\_seen

**order** *string*: sort order. Default: desc

**limit** *int*: limit show users. Default: 20

**offset** *int*: start from. Default: 0

---

#### getConversations

[](#getconversations)

Get all the dialogues of application.

**id** *int*: user ID.

**limit** *int*: limit show dialogues. Default: 20

**offset** *int*: start from. Default: 0

**closed** *bool|null*: true - open dialogues, false - closed dialogues, null - all dialogues

**assigned** *int|null*: Id of Admin that dialogues is assign, or null

**tags** *array*: array of tags

---

#### getConversation

[](#getconversation)

Get information about the specific dialog.

**id** *int*: dialogue ID. *Required options*

---

#### getMessages

[](#getmessages)

Get messages in a specific dialog.

**id** *int*: dialogue ID. *Required options*

**limit** *int*: limit show users. Default: 20

**offset** *int*: start from. Default: 0

---

#### sendConversationMessage

[](#sendconversationmessage)

Send messages to a specific dialog.

**id** *int*: dialogue ID. *Required options*

**message** *string*: text of message. *Required options*

**type** *string*: type of message. Default: note

**botName** *string*: name of bot. Default: Bot

**fromUser** *bool*: true - message from user

**fromAdmin** *int*: Id of Admin or default\_admin to send message from admin

**randomId** *int*: random Id of message, for control delivery. Default: 0

**autoAssign** *int*: Id of Admin than auto assign to him

**autoAssignRandomId** *int*: random Id of message, for control assign delivery. Default: 0

---

#### readMessages

[](#readmessages)

Mark all messages as read in the dialogue (by the user on the site).

**id** *int*: dialogue ID. *Required options*

---

#### setTyping

[](#settyping)

Set typing message in conversation.

**id** *int*: dialogue ID. *Required options*

**message** *string*: message.

**botName** *string*: set typing botName

**fromUser** *bool*: set typing from user

**fromAdmin** *int*: set typing from admin

---

#### assignConversation

[](#assignconversation)

Assign a specific dialogue defined by the administrator (or removes the assignment).

**id** *int*: dialogue ID. *Required options*

**adminId** *int|null*: admin ID or null to remove assignment.

**fromAdminId** *int|null*: admin ID from assignment

**botName** *string*: bot name from assignment. Default: Bot

**randomId** *int*: number for control assignment

---

#### addTag

[](#addtag)

Add tag to dialogue.

**id** *int*: dialogue ID. *Required options*

**tag** *string*: tag.

**fromAdminId** *int|null*: admin ID from assignment

**botName** *string*: bot name from assignment. Default: Bot

**randomId** *int*: number for control assignment

---

#### deleteTag

[](#deletetag)

Delete tag from dialogue.

**id** *int*: dialogue ID. *Required options*

**tag** *string*: tag.

**fromAdminId** *int|null*: admin ID from assignment

**botName** *string*: bot name from assignment. Default: Bot

**randomId** *int*: number for control assignment

---

#### closeConversation

[](#closeconversation)

Close the conversation.

**id** *int*: dialogue ID. *Required options*

**fromAdminId** *int|null*: admin ID from assignment

**botName** *string*: bot name from assignment. Default: Bot

**randomId** *int*: number for control assignment

---

#### getUser

[](#getuser)

Get user by ID.

**id** *int*: user ID. *Required options*

**isSystem** *bool*: system or local ID. Default is system

---

#### setProps

[](#setprops)

Add or Update user props.

**id** *int*: user ID. *Required options*

**props** *array*: array of props. *Required options*

**isSystem** *bool*: is system ID?

---

#### deleteProps

[](#deleteprops)

Delete user props.

**id** *int*: user ID. *Required options*

**props** *array*: array of props. *Required options*

**isSystem** *bool*: is system ID?

---

#### setPresence

[](#setpresence)

Set user status.

**id** *int*: user ID. *Required options*

**presence** *string*: user status. *Required options*

**sessionId** *string*: session ID *Required options*

---

#### sendUserMessage

[](#sendusermessage)

Send messages to a specific user.

**id** *int*: user ID. *Required options*

**message** *string*: text of message. *Required options*

**type** *string*: is note or message. Default: popup\_chat

---

#### startConversation

[](#startconversation)

Start conversation with user.

**id** *int*: user ID. *Required options*

**message** *string*: text of message. *Required options*

---

#### trackEvent

[](#trackevent)

Tracking events, which is performed by the user.

**id** *int*: user ID. *Required options*

**eventName** *string*: name of event. *Required options*

**additionalParams** *array*: additional params

---

#### getEvents

[](#getevents)

Receive events that the user makes a chronologically.

**id** *int*: user ID. *Required options*

**eventName** *string*: name of event to filter.

**limit** *int*: limit show users. Default: 20

**offset** *int*: start from. Default: 0

---

Change log
----------

[](#change-log)

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

Testing
-------

[](#testing)

```
$ composer test
```

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

[](#contributing)

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)

- [Alex Khijnij](https://github.com/veksa)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 54.5% 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 ~63 days

Total

3

Last Release

3542d ago

Major Versions

v1.1.0 → v2.0.02016-09-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/3d8639ee8ab3ba54c9fcc54fa4e41a30a235af22579c34680cf5df05549fa3bf?d=identicon)[veksa](/maintainers/veksa)

---

Top Contributors

[![veksa](https://avatars.githubusercontent.com/u/6467881?v=4)](https://github.com/veksa "veksa (12 commits)")[![smskin](https://avatars.githubusercontent.com/u/3227797?v=4)](https://github.com/smskin "smskin (7 commits)")[![fliak](https://avatars.githubusercontent.com/u/1640217?v=4)](https://github.com/fliak "fliak (3 commits)")

---

Tags

phpcarrot-questcarrotcarrot api

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/veksa-carrot-api/health.svg)

```
[![Health](https://phpackages.com/badges/veksa-carrot-api/health.svg)](https://phpackages.com/packages/veksa-carrot-api)
```

PHPackages © 2026

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