AttachmentsApiV2Controller

Extends \HttpApiV2Controller

Class AttachmentsApiV2Controller

This controller enables the API consumers to handle email attachments which can be later used in emails. The most common scenario is that if an email has attachments, they must be already uploaded before the email is sent.

category

System

package

ApiV2Controllers

Methods

AbstractApiV2Controller Constructor

__construct(\Slim\Slim $api, array $uri) 
inherited

Call this constructor from every child controller class in order to set the Slim instance and the request routes arguments to the class.

deprecated

The "__initialize" method will is deprecated and will be removed in a future version. Please use the new "init" for bootstrapping your child API controllers.

Throws
\HttpApiV2Exception

Through _validateRequest

Arguments

$api

\Slim\Slim

Slim framework instance, used for request/response manipulation.

$uri

array

This array contains all the segments of the current request, starting from the resource.

Initialize API Controller

__initialize() 

getCallableResource

getCallableResource( $controller, array $mappedURI, \Slim\Slim $api) 
inherited static

Arguments

$controller

$mappedURI

array

$api

\Slim\Slim

post

post() 
api
apiVersion

2.1.0

apiName

UploadAttachments

apiGroup

Emails

apiDescription

If an email contains an attachment this must be uploaded before the email is sent. This method accepts the upload of one file at a time. It will return its temporary path which can be used as the attachment path in the email JSON data. The name of the file form field is not taken into concern (can be whatever). The important rule is that only one file will be uploaded at a time.

apiExample

{curl} Upload Attachment curl --user admin@shop.de:12345 -F name=test -F filedata=@localfile.jpg http://shop.de/api.php/v2/attachments

apiSuccessExample

{json} Success-Response { "code": 201, "status": "success", "action": "upload", "path": "/var/www/html/uploads/tmp/myfilename.txt" }

Constants

Defines the default page offset for responses that return multiple items.

DEFAULT_PAGE_ITEMS
inherited
var

Default controller to be loaded when no resource was selected.

DEFAULT_CONTROLLER_NAME
inherited
var

Defines the maximum request limit for an authorized client.

DEFAULT_RATE_LIMIT
inherited
var

Defines the duration of an API session in minutes.

DEFAULT_RATE_RESET_PERIOD
inherited
var

Properties