Skip to content

🎧 Unofficial Papercups PHP library provides convenient access to the Papercups API from applications written in server-side PHP.

License

Notifications You must be signed in to change notification settings

sooluh/papercups

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Papercups PHP

Latest Stable Version Total Downloads Latest Unstable Version License

Unofficial Papercups PHP library provides convenient access to the Papercups API from applications written in server-side PHP.

Requirements

  • PHP >= 7.3
  • Composer

Features

  • PSR-4 autoloading compliant structure
  • PSR-2 compliant code style
  • Easy to use with any framework or even a plain php file
  • Useful tools for better code included

Installation

Install the package with:

composer require sooluh/papercups

Usage

The package needs to be configured with an API key, which is available in the Papercups dashboard. Require the package with the key's value:

<?php
// make sure composer dependencies have been installed
require __DIR__ . '/vendor/autoload.php';

$papercups = new \Papercups\Client('PAPERCUPS_API_KEY');

$response = $papercups->messages()->create([
    'body' => 'Hello world!',
    'conversation_id' => '...'
]);

print_r($response);

If you're self-hosting Papercups on a different server, you can specify the API host:

$papercups = new \Papercups\Client('PAPERCUPS_API_KEY', 'https://papercups.mycompany.co');

License

Code licensed under MIT License.

About

🎧 Unofficial Papercups PHP library provides convenient access to the Papercups API from applications written in server-side PHP.

Topics

Resources

License

Stars

Watchers

Forks

Languages