Giter VIP home page Giter VIP logo

seeuletter-php's Introduction

seeuletter-php

Packagist version Dependency Status

Seeuletter.com PHP Client is a simple but flexible wrapper for the Seeuletter.com API. See full Seeuletter.com documentation here. For best results, be sure that you're using the latest version of the Seeuletter API and the latest version of the PHP wrapper.

Table of Contents

Getting Started

Here's a general overview of the Seeuletter services available, click through to read more.

Please read through the official API Documentation to get a complete sense of what to expect from each endpoint.

Registration

First, you will need to first create an account at Seeuletter.com and obtain your Test and Live API Keys.

Once you have created an account, you can access your API Keys from the API keys Panel.

Installation

The recommended way to install Seeuletter.com PHP Client is through Composer.

// Install Composer
curl -sS https://getcomposer.org/installer | php

// Add Seeuletter.com PHP client as a dependency
composer require seeuletter/seeuletter-php

After installing, you need to require Composer's autoloader:

require 'vendor/autoload.php';

Usage

Create a new Letter

<?php
require 'vendor/autoload.php';

// Provide an API Key in the class constructor
// in order to instantiate the Seeuletter object
$apiKey = 'API Key here';
$seeuletter = new \Seeuletter\Seeuletter($apiKey);

$to_address = array(
  'name'                  => 'Seeuletter',
  'address_line1'         => '30 rue de rivoli',
  'address_line2'         => '',
  'address_city'          => 'Paris',
  'address_country'       => 'France',
  'address_postalcode'    => '75004'
);

$letter = $seeuletter->letters()->create(array(
  'to'                  => $to_address,
  'source_file'         => '@test.pdf',
  'description'         => 'Test Letters',
  'color'               => 'bw',
  'source_file_type'    => 'file',
  'postage_type'        => 'verte'
));

print_r($letter);

?>

Get all Letters

<?php
  require 'vendor/autoload.php';

  $seeuletter = new \Seeuletter\Seeuletter('test_12345678901234567890');

  $letters = $seeuletter->letters()->all();

  print_r($letters);
?>

Get a specific Letter

<?php
  require 'vendor/autoload.php';

  $seeuletter = new \Seeuletter\Seeuletter('test_12345678901234567890');

  $letter = $seeuletter->letters()->get('LETTER_ID');

  print_r($letter);
?>

Examples

We've provided various examples for you to try out here.

=======================

Copyright © 2017 Seeuletter.com

Released under the MIT License, which can be found in the repository in LICENSE.txt.

seeuletter-php's People

Contributors

gautiert avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.