2017 © Pedro Peláez
 

library craftnet-php

A PHP library which implements the functionality of the Craftnet API

image

barrelstrength/craftnet-php

A PHP library which implements the functionality of the Craftnet API

  • Saturday, April 21, 2018
  • by BarrelStrength
  • Repository
  • 2 Watchers
  • 6 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Craftnet API PHP Wrapper

A PHP library which implements the functionality of the Craftnet API. See the Craftnet API documentation for all available settings., (*1)

Installation

Add the library to your project via composer:, (*2)

``` php { "require": { "barrelstrength/craftnet-php": "{version}" } }, (*3)


Require the library in your project: ``` php require __DIR__ . '/vendor/autoload.php';

Authentication

To authenticate with Craftnet set your username and apiKey values when instantiating a new CraftnetClient class., (*4)

``` php use barrelstrength\craftnetphp\CraftnetClient;, (*5)

$username = 'USERNAME'; $apiKey = 'API_KEY;, (*6)

$client = new CraftnetClient($username, $apiKey);, (*7)


## Get all plugin licenses for the authenticated Craft ID user ``` php $response = $client->pluginLicenses->get(); $pluginLicenses = $response->getBody()->getContents(); $results = json_decode($pluginLicenses);

Get a secondary page of plugin licenses for the authenticated Craft ID user

``` php $response = $client->pluginLicenses->get([ 'page' => 2 ]);, (*8)

$pluginLicenses = $response->getBody()->getContents();, (*9)

$results = json_decode($pluginLicenses);, (*10)


## Get a specific plugin license for the authenticated Craft ID user ``` php <?php $response = $client->pluginLicenses->get([ 'key' => 'P8GQRVQO5MK9Q673U0IJZ2I3' ]); $pluginLicense = $response->getBody()->getContents(); $result = json_decode($pluginLicense)

Create a new license for a given Craft ID user

``` php $response = $client->pluginLicenses->create([ 'edition' => 'standard', 'plugin' => 'sprout-forms', 'email' => 'sprout@barrelstrengthdesign.com' ]);, (*11)

$pluginLicense = $response->getBody()->getContents();, (*12)

$result = json_decode($pluginLicense) ```, (*13)

The Versions

21/04 2018

dev-master

9999999-dev

A PHP library which implements the functionality of the Craftnet API

  Sources   Download

MIT

The Requires

 

21/04 2018

dev-develop

dev-develop

A PHP library which implements the functionality of the Craftnet API

  Sources   Download

MIT

The Requires

 

21/04 2018

0.0.1

0.0.1.0

A PHP library which implements the functionality of the Craftnet API

  Sources   Download

MIT

The Requires