Skip to content

industrialdev/wicket-sdk-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wicket-sdk-php

Build Status

A PHP library to interact with the Wicket API

Wicket

Wicket is the world's first Member Data Platform.

To learn more please visit the Wicket Website

Installing Wicket SDK

The recommended way to install the WicketSDK is through Composer.

Once Composer is installed, create a composer.json file to include the latest development version of WicketSDK:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/industrialdev/wicket-sdk-php.git"
    }
  ],
  "require": {
    "industrialdev/wicket-sdk-php": "dev-master"
  }
}

Next, install the packages:

composer install

After installing, you need only to require_once Composer's autoloader in your code:

require_once 'vendor/autoload.php';

You can then later update Wicket using composer:

composer update

Using the SDK

<?php
require_once "vendor/autoload.php";

$client = new Wicket\Client(
	env('API_APP_KEY'),
	env('API_JWT_SECRET'),
	'https://<tenant>-api.wicketcloud.com'
);
$client->authorize(env('PERSON_ID'));

$orgs = $client->organizations->all();    // Collection()

$eml = new \Wicket\Entities\Emails([
	'address' => sprintf('alice_smith+%d@ind.ninja', rand(10000, 99999)),
	'primary' => true,
]);

$person = new \Wicket\Entities\People([
	'given_name'  => sprintf('Alice%d', rand(10000, 99999)),
	'family_name' => sprintf('Smith%d', rand(10000, 99999)),
]);

$person->attach($eml);    // related entities can be `attached`

$new_person = $client->people->create($person, $org);

About

A PHP library for the Wicket Core API. https://wicketapi.docs.apiary.io

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages