PHP code example of stannp / stannp-php

1. Go to this page and download the library: Download stannp/stannp-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

stannp / stannp-php example snippets




define("STANNP_API_KEY", "API_KEY_HERE");
or
$user = new User("API_KEY_HERE");

use Stannp\API\Campaigns;
use Stannp\API\Groups;
use Stannp\API\Letters;
use Stannp\API\Postcard;
use Stannp\API\Recipients;
use Stannp\API\Reporting;
use Stannp\API\User;

use Stannp\API\Postcard;

$user = new User();
$user->getMe();

use Stannp\API\Postcard

$postcard = new Postcard();
$postcard->create(
	"A6",
	"https://www.stannp.com/assets/samples/a6-postcard-front.jpg",
	"Hello World",
	"Signature goes here",
	"Mr",
	"John",
	"Smith",
	"123 Fakestreet",
	"Address ln 2",
	"Cityshire",
	"AB12 3CD",
	 true,
	"GB"
);