Download the PHP package coopbelvedere/laravel-basecamp-api without Composer
On this page you can find all versions of the php package coopbelvedere/laravel-basecamp-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download coopbelvedere/laravel-basecamp-api
More information about coopbelvedere/laravel-basecamp-api
Files in coopbelvedere/laravel-basecamp-api
Package laravel-basecamp-api
Short Description API Wrapper for Basecamp3
License MIT
Informations about the package laravel-basecamp-api
Laravel Basecamp API
[!WARNING] This repo is now readonly and no longer maintained.
An API wrapper for Basecamp 3.
Prerequisites
Create an integration
Visit https://launchpad.37signals.com/integrations and register your app.
Add the credentials in your .env file as:
And add the config variables to your config/services.php
file:
OAuth2
The Basecamp3 API only supports 3-legged authentication and makes calls on behalf of one user. To receive an access token, you can use Laravel Socialite with the 37signals Socialite Driver. After you save the access token and the desired Basecamp3 account, you can now create an instance of the API wrapper.
Add the socialite service provider to your config/app.php
providers
array key:
Add the socialite event listener in your app/Providers/EventServiceProvider.php
listen
property:
Installation
Add a user-agent
to identify your app in your config/basecamp.php
file.
This is mandatory or any request will return a 400 error.
Usage
Retrieve your basecamp id, base uri (href), token and refresh token and
initialize the API wrapper. Here's a basic example on the routes/web.php
file to get you started.
NOTE: You shouldn't initialize the API in the callback route, this is only to show you what data to keep from the socialite user. Save this data in the database, and/or the session to keep the connection active.
Caching
The client uses a Laravel Filesystem cache strategy by default. You can override this with your preferred Laravel cache store:
Middlewares (optional)
You can optionally add an array of middlewares to the Guzzle Handler Stack. Here is an example for logging a request:
Event Listener
The Client also comes with a middleware which will refresh an expired access
token and automatically retry the intended endpoint. You can listen to the
basecamp.refreshed_token
event to update the access token in your app.
The event returns 2 parameters, your basecamp user id and the new access token.
You can add something like this in your EventServiceProvider.php
boot method:
Pagination
Most collection of resources in Basecamp can be paginated.
Resources documentation
- Attachments
- Campfires
- Chatbots
- Client approvals
- Client correspondances
- Client replies
- Comments
- Documents
- Events
- Forwards
- Needles
- Inboxes
- Message Boards
- Message types
- Messages
- People
- Projects
- Question answers
- Questionnaires
- Questions
- Recordings
- Schedule entries
- Schedules
- Subscriptions
- Templates
- To-do list groups
- To-do lists
- To-dos
- To-do sets
- Uploads
- Vaults
- Webhooks
License
Copyright (c) 2017-present, Coopérative Belvédère Communication
All versions of laravel-basecamp-api with dependencies
ext-fileinfo Version *
illuminate/support Version ^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
kevinrob/guzzle-cache-middleware Version ^3.0|^4.0
illuminate/cache Version ^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
illuminate/filesystem Version ^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0
guzzlehttp/guzzle Version ^6.5 || ^7.0