2017 © Pedro Peláez
 

library php-sdk

PHP SDK for the BeSnappy.com

image

snappy/php-sdk

PHP SDK for the BeSnappy.com

  • Tuesday, September 2, 2014
  • by taylorotwell
  • Repository
  • 5 Watchers
  • 9 Stars
  • 3,815 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

Snappy PHP SDK

Installation

The SDK should be installed via Composer. Simply add the snappy/php-sdk dependency to your composer.json file., (*1)

Usage

First, create a new authentication provider:, (*2)

$auth = new SnappySdk\UserPassAuthentication('user', 'pass');

Next, create an SDK client instance:, (*3)

$client = new SnappySdk\Client($auth);

Now you're ready to start retrieving information from Snappy!, (*4)

$accounts = $client->getAccounts();

Sending Messages

To send a message to your Snappy account, create a new Message instance, and use the sendMessage method on the client:, (*5)

$message = new SnappySdk\Message;

$message->mailboxId = 3;
$message->setFrom('foo@bar.com', 'John Smith');
$message->subject = 'Hello World';
$message->message = 'This is my message!';

$nonce = $client->sendMessage($message);

To send an outgoing message, a staffId must be specified, as well as the recipient address:, (*6)

$message = new SnappySdk\Message;

$message->mailboxId = 3;
$message->staffId = 3;
$message->addTo('foo@bar.com', 'John Smith');
$message->subject = 'Hello World';
$message->message = 'This is my message!';

$nonce = $client->sendMessage($message);

If you are attaching a message to an existing thread, add the ticket "nonce" to the message:, (*7)

$message->ticketId = $nonce;

Available Methods

These are the available SDK client methods. They all interact with the Snappy API., (*8)

  • getAccounts
  • search($query, $page = 1)
  • getMailboxes($accountId)
  • getDocuments($accountId)
  • getStaff($accountId)
  • getContact($accountId, $idOrEmailAddress)
  • getWaitingTickets($mailboxId)
  • getTicketDetails($ticketId)
  • getTicketNotes($ticketId)
  • updateTicketTags($ticketId, $tags)
  • sendMessage($message)
  • getWallPost($accountId, $after = 0)
  • postToWall($accountId, $content, $type = 'post', $tags = array(), $ticket = null, $note = null)
  • deleteWallPost($accountId, $postId)
  • commentOnWallPost($accountId, $postId, $comment)
  • deleteWallComment($accountId, $postId, $commentId)
  • likeWallPost($accountId, $postId)
  • unlikeWallPost($accountId, $postId)
  • getFaqs($accountId)
  • searchFaqs($accountId, $query, $page = 1)
  • createFaq($accountId, $title, $url = 'faq')
  • updateFaq($accountId, $faqId, $title, $url = 'faq')
  • deleteFaq($accountId, $faqId)
  • getFaqTopics($accountId, $faqId)
  • createFaqTopic($accountId, $faqId, $topic, $order = 0)
  • updateFaqTopic($accountId, $faqId, $topic, $order = 0)
  • deleteFaqTopic($accountId, $faqId, $topicId)
  • getTopicQuestions($accountId, $faqId, $topicId)
  • createTopicQuestion($accountId, $faqId, $topicId, $question, $answer)
  • updateTopicQuestion($accountId, $faqId, $topicId, $questionId, $question, $answer)
  • deleteTopicQuestion($accountId, $faqId, $topicId, $questionId)

The Versions

02/09 2014

dev-master

9999999-dev

PHP SDK for the BeSnappy.com

  Sources   Download

MIT

The Requires

 

The Development Requires

by UserScape

21/07 2014

v1.0.1

1.0.1.0

PHP SDK for the BeSnappy.com

  Sources   Download

MIT

The Requires

 

The Development Requires

by UserScape

17/03 2014

v1.0.0

1.0.0.0

PHP SDK for the BeSnappy.com

  Sources   Download

MIT

The Requires

 

The Development Requires

by UserScape, Inc.