Skip to content

Latest commit

 

History

History
62 lines (45 loc) · 2.51 KB

File metadata and controls

62 lines (45 loc) · 2.51 KB

Cloudflare SDK (v4 API Binding for PHP 7)

Build Status

Installation

The recommended way to install this package is via the Packagist Dependency Manager (cloudflare/sdk). You can get specific usage examples on the Cloudflare Knowledge Base under: Cloudflare PHP API Binding

Cloudflare API version 4

The Cloudflare API can be found here. Each API call is provided via a similarly named function within various classes in the Cloudflare\API\Endpoints namespace:

Note that this repository is currently under development, additional classes and endpoints being actively added.

Getting Started

$key     = new Cloudflare\API\Auth\APIKey('user@example.com', 'apiKey');
$adapter = new Cloudflare\API\Adapter\Guzzle($key);
$user    = new Cloudflare\API\Endpoints\User($adapter);

echo $user->getUserID();

Getting started with images

$key     = new Cloudflare\API\Auth\APIToken('apiToken');
$adapter = new Cloudflare\API\Adapter\Guzzle($key);
$images    = new Cloudflare\API\Endpoints\Images($adapter);

var_dump($images->listImages('accountId'));

Contributions

We welcome community contribution to this repository. CONTRIBUTING.md will help you start contributing.

Licensing

Licensed under the 3-clause BSD license. See the LICENSE file for details.