redbooth/redbooth

This package is abandoned and no longer maintained. No replacement package was suggested.

Official Redbooth PHP client

0.0.23 2015-01-16 10:56 UTC

README

Redbooth is a total online collaboration solution with all of the features you need to manage projects effectively from anywhere.

This package is the official Redbooth PHP client and provides connectivity with the Redbooth API.

Installation

Simply add redbooth/redbooth to the require section of your composer.json file. After that run composer update to install the package among your list of requirements.

Example composer.json:

{
    "require": {
        "redbooth/redbooth": "*"
    }
}

Basic usage

After the package is properly installed you can connect to Redbooth API through the \Redbooth\Service class.

Here's an example code that reads information about your user (also available on examples/me.php):

<?php
require 'vendor/autoload.php';

$redbooth = new \Redbooth\Service(
    'CLIENT_ID',      // update with your client id
    'CLIENT_SECRET',  // update with your client secret
    'ACCESS_TOKEN',   // update with your user's access token
    'REFRESH_TOKEN',  // update with your user's refresh token
    'REDIRECT_URL'    // update with your redirect URL
);

try {
    $res = $redbooth->getMe();
    echo 'My name is ' . $res->first_name . ' ' . $res->last_name . "\n";
} catch (\Redbooth\Exception\InvalidTokenException $e) {
    $res = $redbooth->refreshToken();
    echo 'New access token  : ' . $res->access_token . "\n";
    echo 'New refresh token : ' . $res->refresh_token . "\n";
}

Supported API methods

The following Redbooth API methods are supported by this package, after instantiating the service, as seen above:

Redbooth API method Service method Description
GET /activities getActivities() Get a list of activities
GET /comments getComments() Get a list of comments
POST /comments createComment() Create a comment
GET /conversations getConversations() Get a list of conversations
POST /conversations createConversation() Create a conversation
GET /files getFiles() Get a list of files
GET /files/{id} getFile() Get a single file
GET /files/{id}/download downloadFile() Download a file
GET /me getMe() Get information about the authorized user
GET /memberships getMemberships() Get a list of memberships
GET /notes getNotes() Get a list of notes
POST /notes createNote() Create a note
GET /notifications getNotifications() Get a list of notifications
POST /notifications createNotification() Create a notification
GET /organizations getOrganizations() Get a list of organizations
GET /people getPeople() Get a list of people
GET /projects getProjects() Get a list of projects
GET /subtasks getSubtasks() Get a list of subtasks
POST /subtasks createSubtask() Create a subtask
GET /task_lists getTaskLists() Get a list of task lists
POST /tasks_lists createTaskList() Create a task list
GET /tasks getTasks() Get a list of tasks
POST /tasks createTask() Create a task
GET /users getUsers() Get a list of users
GET /users/{id} getUser() Get a single user

License

Copyright 2014 Redbooth, Inc. All rights reserved.

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.