Download the PHP package veksa/carrot-api without Composer
On this page you can find all versions of the php package veksa/carrot-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download veksa/carrot-api
More information about veksa/carrot-api
Files in veksa/carrot-api
Package carrot-api
Short Description PHP Wrapper for Carrot Quest API
License MIT
Homepage https://github.com/veksa/carrot-api
Informations about the package carrot-api
PHP Carrot Quest Api
An extended native php wrapper for Carrot Quest API without requirements. Supports all methods and types of responses.
Install
The preferred way to install this extension is through composer.
Either run
or add
to the require section of your composer.json
file.
Usage
API Wrapper
Methods
getActiveUsers
Get the users who are currently online on the status of "online".
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
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: https://carrotquest.io/developers/filters/.
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
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
Get information about the specific dialog.
id int: dialogue ID. Required options
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
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
Mark all messages as read in the dialogue (by the user on the site).
id int: dialogue ID. Required options
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
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
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
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
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
Get user by ID.
id int: user ID. Required options
isSystem bool: system or local ID. Default is system
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
Delete user props.
id int: user ID. Required options
props array: array of props. Required options
isSystem bool: is system ID?
setPresence
Set user status.
id int: user ID. Required options
presence string: user status. Required options
sessionId string: session ID Required options
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
Start conversation with user.
id int: user ID. Required options
message string: text of message. Required options
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
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
Please see CHANGELOG for more information what has changed recently.
Testing
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Alex Khijnij
- All Contributors
License
The MIT License (MIT). Please see License File for more information.