Download the PHP package chrisbarr/amazon-sns-php-api without Composer
On this page you can find all versions of the php package chrisbarr/amazon-sns-php-api. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download chrisbarr/amazon-sns-php-api
More information about chrisbarr/amazon-sns-php-api
Files in chrisbarr/amazon-sns-php-api
Package amazon-sns-php-api
Short Description Amazon SNS PHP API
License MIT
Homepage https://github.com/chrisbarr/AmazonSNS-PHP-API
Informations about the package amazon-sns-php-api
Amazon SNS PHP API
This API wrapper is a lightweight alternative to the official Amazon aws-sdk-for-php for access to Amazon SNS (Simple Notification Service) using PHP
Find out more about Amazon SNS here - http://aws.amazon.com/sns
To use this wrapper you must be using PHP5 with cURL, and have an Amazon AWS account
Basic Use
Install using Composer on the command line:
Or add it to your composer.json file:
Example usage:
API Methods
Available methods:
addPermission($topicArn, $label, $permissions)
confirmSubscription($topicArn, $token)
createTopic($name)
deleteTopic($topicArn)
getTopicAttributes($topicArn)
listSubscriptions()
listSubscriptionsByTopic($topicArn)
listTopics()
publish($topicArn, $message, $subject, $messageStructure)
removePermission($topicArn, $label)
setTopicAttributes($topicArn, $attrName, $attrValue)
subscribe($topicArn, $protocol, $endpoint)
unsubscribe($subscriptionArn)
createPlatformEndpoint($platformApplicationArn, $token, $userData)
deleteEndpoint($deviceArn)
publishToEndpoint($deviceArn,$message)
To set the API region (us-east-1, us-west-2, us-west-1, eu-west-1, etc):
setRegion($region)
The default API region is us-east-1
Further Example
Make sure to catch Exceptions where necessary: