A PHP wrapper for the SupportBee REST API.
The package is in Alpha version and hence there may be bugs and api methods that are not implemented
You can find your API token in Settings > API Token screen. See https://developers.supportbee.com/api for more.
In your project root, run the following:
composer require supportbee/supportbee dev-master
This will create a vendor
directory (if you dont already have one), and set up the autoloading classmap.
Once everything is installed, you should be able to load the composer autoloader in your code.
You can load the wrapper classes using namespace as:
require __DIR__ . '/vendor/autoload.php';
use \SupportBee\SupportBee;
Now create a new object
$supportbee = new SupportBee();
At this stage you can also supply the configuration parameter token, company
which is used throughout the API. These can be passed directly as array:
$config = array(
'token' => 'your token',
'company' => 'your company name'
);
$supportbee = new SupportBee($config);
Now the available API calls can be done using the instance. All the result from API will be returned as associative array. If any status code other than 200 is returned an exception would be thrown.
Please refer to https://developers.supportbee.com/api for avaialble parameter details.
Incase of multiple paramters : Pass as an associative array. All method names follow Camel Casing.
- tickets - Returns 15 tickets of the company in the order of their last activity. Only tickets that are not archived are returned (please see optional parameters to get archived tickets).
- ticket - Retrieves the ticket specified by the id.
- searchTickets - Returns 15 tickets of the company in the order of their last activity matching the search query.
- createTickets - Creates a ticket for the company. Pass the information for ticket as associative array.
- deleteTicket - Deletes a trashed ticket. Only Admins can delete a trashed ticket.
- archiveTicket - Archives an unarchived ticket.
- unarchiveTicket - Un-archives an archived ticket.
- assignTicket - Assign a ticket to a User or Group. The first paramter is the ticket id. The second paramter is an associative arry with index as user_id if the ticket is to be assigned to an user and group_id if the ticket is to be assigned to a group.
- starTicket - Stars an un-starred ticket.
- unstarTicket - Un-stars a starred ticket.
- spamTicket - Spam's an un-spammed ticket.
- unspamTicket - Un-spam a spammed ticket.
- trashTicket - Trashes an un-trashed ticket.
- untrashTicket - Un-trashes a trashed ticket.
- replies - Retrieves all the replies of the ticket with id ticket_id.
- reply - Retrieves the reply for ticket specified by the ticket_id with id.
- comments - Retrieves all the comments of the ticket with id ticket_id.
- agents - Retrieves all confirmed agents of the company.
- agent - Retrieves the agent for company specified by the id.
- labels - Retrieves all the custom labels of a company.
- groups - Retrieves all the groups of the company.
- snippets - Returns all the snippets of the company.
- webhooks - Returns all the web hooks of the company.
Questions or problems? Please post them on the issue tracker. You can contribute changes by forking the project and submitting a pull request.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.