PHPackages                             blipfoto/blipfoto - 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. blipfoto/blipfoto

ActiveLibrary[API Development](/categories/api)

blipfoto/blipfoto
=================

SDK for connecting to the Blipfoto API.

0.1(11y ago)0322MITPHPPHP &gt;=5.4.0

Since Dec 19Pushed 2y ago6 watchersCompare

[ Source](https://github.com/Blipfoto/php-sdk)[ Packagist](https://packagist.org/packages/blipfoto/blipfoto)[ Docs](https://www.blipfoto.com/developer)[ RSS](/packages/blipfoto-blipfoto/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

Blipfoto PHP SDK
================

[](#blipfoto-php-sdk)

The Blipfoto SDK for PHP lets you integreate easily with the Blipfoto API.

Requirements
------------

[](#requirements)

- PHP 5.4.0 or greater
- libcurl

Installation
------------

[](#installation)

To install the SDK, we recommend using [Composer](https://getcomposer.org/). Just add the following to your `composer.json` file and run `composer update`:

```
{
	"require": {
		"blipfoto/blipfoto": "dev-master"
	}
}

```

Alternatively, you can clone the [GitHub repository](https://github.com/Blipfoto/php-sdk) and add the classes using your own auto-loader.

Basic usage
-----------

[](#basic-usage)

Create a `Blipfoto\Api\Client` instance, passing in your app's `client_id` and `client_secret`:

```
use Blipfoto\Api\Client;

$client = new Client('abcd', '1234');

```

The client's `get()`, `post()`, `put()` and `delete()` convenience methods all accept a resource as the first argument, and an optional array of parameters / values in the second argument.

```
$response = $client->get('user/profile', [
	'username' => 'arya'
]);
var_dump($response->data()); // => [...]

```

A `Response` object is returned. Its `data()` method returns an array, the contents of which depends on the resource being called. Note you can pass a period-separated key to `data()` for quick access to a nested item in the array:

```
echo $response->data('user.username');	//=> 'arya'

```

Uploading files
---------------

[](#uploading-files)

To upload files during `post()` or `put()`, pass an array of parameters / file paths in the third argument:

```
$response = $client->post('entry', [
	'title' => 'Ser Bronn'
], [
	'image => 'bronn.jpg'
]);

```

Exceptions
----------

[](#exceptions)

If something goes wrong, a subclass of `Blipfoto\Exceptions\BaseException` will be thrown. The type of exceptions are:

- `FileException`

    Thrown when a problem was encountered with a file upload.
- `NetworkException`

    Thrown when a connection fails, times out, etc.
- `InvalidResponseException`

    Thrown when the server returns a response that can't be understood.
- `OAuthException`

    Thrown when OAuth is misconfigured or the user denies permisson to your app during the auth flow.
- `ApiResponseException`

    Thrown when the API returns an Error object.

Authorization
-------------

[](#authorization)

By default, the client will authorize using App auth, i.e. just sending your app's client ID. To perform an action on behalf of a user, you'll need to obtain an access token for the user using OAuth 2.

The `Blipfoto\Api\OAuth` class makes this easy. Your `Client` can create an instance for you :

```
$oauth = $client->oauth();

```

Now call `authorize()`, passing in the `redirect_uri` in your app settings, and optionally the scope of the token you're requesting (default is read-only):

```
$oauth->authorize('https://yoursite.com/callback', Client::SCOPE_READ_WRITE);

```

The user can now grant or deny app permissions, and will be taken back to your `redirect_uri`. On this page, we create the OAuth instance as before, obtain the access token and store it on the client:

```
$oauth = $client->oauth();
try {
	$token = $oauth->getToken();
	$client->accessToken($token['access_token']);
} catch (OAuthException $e) {
	// handle OAuth errors here
}

```

You'll probably want to store this token somewhere in your database, so your users don't have to authorize each time they use your app.

Custom requests
---------------

[](#custom-requests)

There may be cases where you need more visibility into the underlying request. The `Client`'s `before()` and `after()` methods accept a callback which is invoked immediately before / after the request is sent. This lets you inspect or customize the request, for example adding your own curl options:

```
$client->before(function($request) {
	// customise timeout
	curl_setopt($request->curl(), CURLOPT_CONNECTTIMEOUT, 5);
});

```

License
-------

[](#license)

This software is licensed under the MIT License - see the LICENSE file for details.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.9% 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

Unknown

Total

1

Last Release

4158d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/19725991c3f2f1bd2faf151e9626003a63074c92872fee2e691383bb49736f68?d=identicon)[gbradley](/maintainers/gbradley)

---

Top Contributors

[![gbradley](https://avatars.githubusercontent.com/u/116627?v=4)](https://github.com/gbradley "gbradley (13 commits)")[![jbarronuk](https://avatars.githubusercontent.com/u/16863943?v=4)](https://github.com/jbarronuk "jbarronuk (1 commits)")

---

Tags

blipfoto

### Embed Badge

![Health badge](/badges/blipfoto-blipfoto/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M186](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M33](/packages/facebook-php-business-sdk)[microsoft/microsoft-graph

The Microsoft Graph SDK for PHP

65723.5M95](/packages/microsoft-microsoft-graph)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)

PHPackages © 2026

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