- Api
- ApiFactory
- Campaign
- Client
- Client
- Customization
- InvalidResourceException
- LaravelServiceProvider
- Request
- RequestFactory
- Response
- ResponseErrorException
- ResponseFactory
- Subscriber
- Suppression
- Tag
- Template
- Transaction
- Full name: \Rule\ApiWrapper\Api\Api
Create api instance
Api::__construct( \Rule\ApiWrapper\Client\Client $client )Parameters:
| Parameter | Type | Description |
|---|---|---|
$client |
\Rule\ApiWrapper\Client\Client | HTTP client implementation for api |
Get http client
Api::getClient( ): \Rule\ApiWrapper\Client\Client- Full name: \Rule\ApiWrapper\ApiFactory
Creates api resource
ApiFactory::make( string $key, string $resource, $version = 'v2' ): \Rule\ApiWrapper\Api- This method is static. Parameters:
| Parameter | Type | Description |
|---|---|---|
$key |
string | Rule api key |
$resource |
string | Resource name [subscriber, campaign, customization, suppression, tag, template, transaction] |
$version |
**** |
- Full name: \Rule\ApiWrapper\Api\V2\Campaign\Campaign
- Parent class: \Rule\ApiWrapper\Api\Api
Create api instance
Campaign::__construct( \Rule\ApiWrapper\Client\Client $client )Parameters:
| Parameter | Type | Description |
|---|---|---|
$client |
\Rule\ApiWrapper\Client\Client | HTTP client implementation for api |
Get http client
Campaign::getClient( ): \Rule\ApiWrapper\Client\ClientGet campaigns
Campaign::getList( integer $limit = 100 ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$limit |
integer | Limit for the campaigns count, default 100 max 100 |
Return Value:
Request result
See Also:
Get campaign data.
Campaign::get( integer $id ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$id |
integer | Id of the campaign. |
Return Value:
Request result
See Also:
Get campaign statistics.
Campaign::statistics( integer $id ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$id |
integer | Id of the campaign. |
Return Value:
Request result
See Also:
Send campaign.
Campaign::send( array $campaign ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$campaign |
array | Campaign data formated according {@link https://rule.se/apidoc/#campaigns-send-campaign-post} |
See Also:
Schedule campaign.
Campaign::schedule( array $campaign ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$campaign |
array | Campaign data formated according {@link https://rule.se/apidoc/#campaigns-send-campaign-post} |
See Also:
- Full name: \Rule\ApiWrapper\Guzzle\Client
- Parent class: \Rule\ApiWrapper\Client\Client
Creates new Guzzle client instance
Client::__construct( string $apiKey, string $version = 'v2', string $baseUrl = "http://app.rule.io/api/" )Client constructor.
Parameters:
| Parameter | Type | Description |
|---|---|---|
$apiKey |
string | |
$version |
string | |
$baseUrl |
string |
Get Rule api key
Client::getApiKey( ): stringGet Rule api version
Client::getVersion( ): stringGet base Rule url
Client::getBaseUrl( ): stringClient::setApiKey( $key )Parameters:
| Parameter | Type | Description |
|---|---|---|
$key |
**** |
Client::setVersion( $version )Parameters:
| Parameter | Type | Description |
|---|---|---|
$version |
**** |
Client::setBaseUrl( $baseUrl )Parameters:
| Parameter | Type | Description |
|---|---|---|
$baseUrl |
**** |
Makes get request
Client::get( \Rule\ApiWrapper\Client\Request $request ): \Rule\ApiWrapper\Client\ResponseParameters:
| Parameter | Type | Description |
|---|---|---|
$request |
\Rule\ApiWrapper\Client\Request | Request instance |
Makes post request
Client::post( \Rule\ApiWrapper\Client\Request $request ): \Rule\ApiWrapper\Client\ResponseParameters:
| Parameter | Type | Description |
|---|---|---|
$request |
\Rule\ApiWrapper\Client\Request | Request instance |
Makes put request
Client::put( \Rule\ApiWrapper\Client\Request $request ): \Rule\ApiWrapper\Client\ResponseParameters:
| Parameter | Type | Description |
|---|---|---|
$request |
\Rule\ApiWrapper\Client\Request | Request instance |
Makes delete request
Client::delete( \Rule\ApiWrapper\Client\Request $request ): \Rule\ApiWrapper\Client\ResponseParameters:
| Parameter | Type | Description |
|---|---|---|
$request |
\Rule\ApiWrapper\Client\Request | Request instance |
- Full name: \Rule\ApiWrapper\Logger\Client
- Parent class: \Rule\ApiWrapper\Client\Client
Client constructor.
Client::__construct( $apiKey, string $version = 'v2', string $baseUrl = "http://app.rule.io/api/" )Parameters:
| Parameter | Type | Description |
|---|---|---|
$apiKey |
**** | |
$version |
string | |
$baseUrl |
string |
Get Rule api key
Client::getApiKey( ): stringGet Rule api version
Client::getVersion( ): stringGet base Rule url
Client::getBaseUrl( ): stringClient::setApiKey( $key )Parameters:
| Parameter | Type | Description |
|---|---|---|
$key |
**** |
Client::setVersion( $version )Parameters:
| Parameter | Type | Description |
|---|---|---|
$version |
**** |
Client::setBaseUrl( $baseUrl )Parameters:
| Parameter | Type | Description |
|---|---|---|
$baseUrl |
**** |
Make get request to api
Client::get( \Rule\ApiWrapper\Client\Request $request ): \Rule\ApiWrapper\Client\ResponseParameters:
| Parameter | Type | Description |
|---|---|---|
$request |
\Rule\ApiWrapper\Client\Request | Request instance |
Make post request to api
Client::post( \Rule\ApiWrapper\Client\Request $request ): \Rule\ApiWrapper\Client\ResponseParameters:
| Parameter | Type | Description |
|---|---|---|
$request |
\Rule\ApiWrapper\Client\Request | Request instance |
Make put request to api
Client::put( \Rule\ApiWrapper\Client\Request $request ): \Rule\ApiWrapper\Client\ResponseParameters:
| Parameter | Type | Description |
|---|---|---|
$request |
\Rule\ApiWrapper\Client\Request | Request instance |
Make delete request to api
Client::delete( \Rule\ApiWrapper\Client\Request $request ): \Rule\ApiWrapper\Client\ResponseParameters:
| Parameter | Type | Description |
|---|---|---|
$request |
\Rule\ApiWrapper\Client\Request | Request instance |
Client::setLogger( $logger )Parameters:
| Parameter | Type | Description |
|---|---|---|
$logger |
**** |
- Full name: \Rule\ApiWrapper\Api\V2\Customization\Customization
- Parent class: \Rule\ApiWrapper\Api\Api
Create api instance
Customization::__construct( \Rule\ApiWrapper\Client\Client $client )Parameters:
| Parameter | Type | Description |
|---|---|---|
$client |
\Rule\ApiWrapper\Client\Client | HTTP client implementation for api |
Get http client
Customization::getClient( ): \Rule\ApiWrapper\Client\ClientCreate fields.
Customization::create( array $fields ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$fields |
array | Array of fields {@link https://rule.se/apidoc/#subscriber-fields-create-groups-and-fields-post} |
Return Value:
Response result
Get groups.
Customization::getList( integer $limit = 100 ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$limit |
integer | Limit of the results count |
Return Value:
Request result
Get group fields
Customization::get( integer $id ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$id |
integer | Id of the group |
Return Value:
Request result
- Full name: \Rule\ApiWrapper\Api\Exception\InvalidResourceException
- Parent class:
- Full name: \Rule\ApiWrapper\LaravelServiceProvider
- Parent class:
LaravelServiceProvider::register( )- Full name: \Rule\ApiWrapper\Client\Request
Request constructor. Create new Request instance
Request::__construct( $resource )Parameters:
| Parameter | Type | Description |
|---|---|---|
$resource |
**** |
Sets request query
Request::setQuery( array $query )Parameters:
| Parameter | Type | Description |
|---|---|---|
$query |
array |
Returns request query
Request::getQuery( ): mixedSets id parameter to Request
Request::setIdParam( string $idParam )Parameters:
| Parameter | Type | Description |
|---|---|---|
$idParam |
string |
Returns request id parameter
Request::getIdParam( ): mixedSets request parameters
Request::setParams( array $params )Parameters:
| Parameter | Type | Description |
|---|---|---|
$params |
array |
Returns request parameters
Request::getParams( ): mixedSets request resource
Request::setResource( string $resource )Parameters:
| Parameter | Type | Description |
|---|---|---|
$resource |
string |
Returns request resource
Request::getResource( ): mixedSets request subresources
Request::setSubresources( array $subresources )Parameters:
| Parameter | Type | Description |
|---|---|---|
$subresources |
array |
Returns request subresources
Request::getSubresources( ): mixedAdds subresources to request
Request::addSubresource( array $subresource )Parameters:
| Parameter | Type | Description |
|---|---|---|
$subresource |
array |
Set request method
Request::setMethod( string $method )Parameters:
| Parameter | Type | Description |
|---|---|---|
$method |
string |
Returns request method
Request::getMethod( ): mixedGet relative url from request
Request::getRelativeUrl( ): stringReturn Value:
Relative url
- Full name: \Rule\ApiWrapper\Guzzle\RequestFactory
RequestFactory::make( \Rule\ApiWrapper\Client\Request $request, $baseUrl = "" )- This method is static. Parameters:
| Parameter | Type | Description |
|---|---|---|
$request |
\Rule\ApiWrapper\Client\Request | |
$baseUrl |
**** |
- Full name: \Rule\ApiWrapper\Client\Response
Response constructor. Creates new Response instance.
Response::__construct( $statusCode, array $data )Parameters:
| Parameter | Type | Description |
|---|---|---|
$statusCode |
**** | |
$data |
array |
Returns Response status code.
Response::getStatusCode( ): integerReturns Response result.
Response::getData( ): array- Full name: \Rule\ApiWrapper\Api\Exception\ResponseErrorException
- Parent class:
- Full name: \Rule\ApiWrapper\Guzzle\ResponseFactory
ResponseFactory::make( \GuzzleHttp\Psr7\Response $response )- This method is static. Parameters:
| Parameter | Type | Description |
|---|---|---|
$response |
\GuzzleHttp\Psr7\Response |
- Full name: \Rule\ApiWrapper\Api\V2\Subscriber\Subscriber
- Parent class: \Rule\ApiWrapper\Api\Api
Create api instance
Subscriber::__construct( \Rule\ApiWrapper\Client\Client $client )Parameters:
| Parameter | Type | Description |
|---|---|---|
$client |
\Rule\ApiWrapper\Client\Client | HTTP client implementation for api |
Get http client
Subscriber::getClient( ): \Rule\ApiWrapper\Client\ClientCreates new subscriber
Subscriber::create( array $subscriber ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$subscriber |
array |
See Also:
Create new subscribers
Subscriber::createMultiple( array $subscribers ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$subscribers |
array |
See Also:
Returns subscribers list
Subscriber::getList( integer $limit = 100 ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$limit |
integer |
See Also:
Returns single subscriber
Subscriber::get( $id, string $identifyBy = 'email' ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$id |
**** | |
$identifyBy |
string |
See Also:
Returns subscriber fields
Subscriber::getFields( $id, string $identifyBy = "email" ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$id |
**** | |
$identifyBy |
string |
See Also:
Updates subscriber
Subscriber::update( $id, $subscriber ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$id |
**** | |
$subscriber |
**** |
See Also:
Adds tags to subscriber
Subscriber::addTags( $id, array $tags, string $identifyBy = 'email' ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$id |
**** | |
$tags |
array | |
$identifyBy |
string |
See Also:
Returns subscriber tags
Subscriber::getTags( $id, string $identifyBy = "email" ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$id |
**** | |
$identifyBy |
string |
See Also:
Removes subscriber tags
Subscriber::deleteTag( $id, $tag, string $identifyBy = "email" ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$id |
**** | |
$tag |
**** | |
$identifyBy |
string |
See Also:
Subscriber::delete( integer|string $id, string $identifiedBy = 'email' ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$id |
integer|string | User identifier to delete |
$identifiedBy |
string | Identifier type |
Return Value:
Server response
See Also:
Subscriber::deleteMultiple( array $subscribers ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$subscribers |
array |
Subscriber::import( string $filename, array $mappings, array $tags, boolean $overrideSuppressions = false ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$filename |
string | Name of the file stored on s3 |
$mappings |
array | Mappings for the columns |
$tags |
array | Tags to import to |
$overrideSuppressions |
boolean |
Return Value:
Response data
- Full name: \Rule\ApiWrapper\Api\V2\Suppression\Suppression
- Parent class: \Rule\ApiWrapper\Api\Api
Create api instance
Suppression::__construct( \Rule\ApiWrapper\Client\Client $client )Parameters:
| Parameter | Type | Description |
|---|---|---|
$client |
\Rule\ApiWrapper\Client\Client | HTTP client implementation for api |
Get http client
Suppression::getClient( ): \Rule\ApiWrapper\Client\ClientReturns suppression list
Suppression::getList( integer $limit = 100 ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$limit |
integer |
See Also:
Creates new Suppression
Suppression::create( array $suppressions, array $suppressOn = null ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$suppressions |
array | |
$suppressOn |
array |
See Also:
Delete suppression Suppression
Suppression::delete(string $identifier, string $identifiedBy = 'email', ?string $dispatcherType = null, ?string $messageType = null): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$identifier |
string | Required |
$identifiedBy |
string | email / phone_number / id. Default: email |
$dispatcherType |
string|null | campaign / transaction |
$messageType |
string|null | email / text_message |
See Also:
- Full name: \Rule\ApiWrapper\Api\V2\Tag\Tag
- Parent class: \Rule\ApiWrapper\Api\Api
Create api instance
Tag::__construct( \Rule\ApiWrapper\Client\Client $client )Parameters:
| Parameter | Type | Description |
|---|---|---|
$client |
\Rule\ApiWrapper\Client\Client | HTTP client implementation for api |
Get http client
Tag::getClient( ): \Rule\ApiWrapper\Client\ClientGet list of tags
Tag::getList( integer $limit = 100 ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$limit |
integer |
See Also:
Delete tag by id
Tag::delete( $id ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$id |
**** |
See Also:
Clear associations between subscriber and tag
Tag::clear( $id ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$id |
**** |
See Also:
- Full name: \Rule\ApiWrapper\Api\V2\Template\Template
- Parent class: \Rule\ApiWrapper\Api\Api
Create api instance
Template::__construct( \Rule\ApiWrapper\Client\Client $client )Parameters:
| Parameter | Type | Description |
|---|---|---|
$client |
\Rule\ApiWrapper\Client\Client | HTTP client implementation for api |
Get http client
Template::getClient( ): \Rule\ApiWrapper\Client\ClientGet list of templates
Template::getList( ): arraySee Also:
Get template by id
Template::get( $id ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$id |
**** |
See Also:
- Full name: \Rule\ApiWrapper\Api\V2\Transaction\Transaction
- Parent class: \Rule\ApiWrapper\Api\Api
Create api instance
Transaction::__construct( \Rule\ApiWrapper\Client\Client $client )Parameters:
| Parameter | Type | Description |
|---|---|---|
$client |
\Rule\ApiWrapper\Client\Client | HTTP client implementation for api |
Get http client
Transaction::getClient( ): \Rule\ApiWrapper\Client\ClientSend transaction
Transaction::send( array $transaction ): arrayParameters:
| Parameter | Type | Description |
|---|---|---|
$transaction |
array |
See Also:
This document was automatically generated from source code comments on 2020-02-13 using phpDocumentor and cvuorinen/phpdoc-markdown-public