Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • components
        • events
          • default
      • controllers
      • models
    • components
      • auth
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • exchange
        • rates
          • foxrate
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
      • json
      • modules
      • net
        • http
        • net
          • amazon
            • s3
          • geo
            • ip
      • plugins
      • recaptcha
      • security
      • session
        • cart
      • settingscollection
      • upgrades
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
  • com
    • tecnick
      • tcpdf
        • blesta
          • components
            • invoice
              • templates
                • quickbooks
                  • invoice
                • templates
                  • default
  • Crypt
    • AES
    • DES
    • Hash
    • Random
    • RC4
    • Rijndael
    • RSA
    • TerraDES
  • File
    • ANSI
    • ASN1
    • X509
  • Math
    • BigInteger
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • html
      • xml
    • lib
  • Net
    • SFTP
    • SSH1
    • SSH2
  • None
  • PHP
  • PHPMailer
  • Services
    • JSON
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • _404
  • AdminBilling
  • AdminClient
  • AdminClients
  • AdminCompanyAutomation
  • AdminCompanyBilling
  • AdminCompanyCurrencies
  • AdminCompanyCustomfields
  • AdminCompanyEmails
  • AdminCompanyGateways
  • AdminCompanyGeneral
  • AdminCompanyGroups
  • AdminCompanyModules
  • AdminCompanyPlugins
  • AdminCompanyTaxes
  • AdminDialog
  • AdminLicense
  • AdminLogin
  • AdminLogout
  • AdminMain
  • AdminMyinfo
  • AdminPackages
  • AdminSearch
  • AdminSettings
  • AdminSystemApi
  • AdminSystemAutomation
  • AdminSystemBackup
  • AdminSystemCompanies
  • AdminSystemGeneral
  • AdminSystemHelp
  • AdminSystemMarketplace
  • AdminSystemStaff
  • AdminSystemThemes
  • AdminSystemUpgrade
  • AdminTests
  • AdminTheme
  • AdminTools
  • Api
  • Callback
  • ClientAccounts
  • ClientContacts
  • ClientDialog
  • ClientInvoices
  • ClientLogin
  • ClientLogout
  • ClientMain
  • ClientPay
  • ClientServices
  • ClientTheme
  • ClientTransactions
  • Cron
  • Install
  • Main
  • Upgrade
  • Uploads

Class Api

A RESTful API system for interacting with the Blesta backend.

All public model methods are accessible. Plugin models may also be invoked by simply formatting the model as Plugin.Model (e.g. /api/plugin.model/method.format). Supports XML, JSON, and PHP as format types.

Controller
Extended by AppController
Extended by Api
Package: blesta\app\controllers
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at app/controllers/api.php

Methods summary

public
# preAction( )

Verify that the request is properly formatted, and ensure the requester is authorized.

Verify that the request is properly formatted, and ensure the requester is authorized.

Overrides

AppController::preAction
public
# index( )

The backbone of the API. Processes the request for the desired resource

The backbone of the API. Processes the request for the desired resource

Overrides

Controller::index
private array
# matchParameters( array $parameters = null )

Matches the given parameters with those defined in the requested method.

Matches the given parameters with those defined in the requested method.

Parameters

$parameters
array
An array of candidate parameters to be passed to the requested method.

Returns

array
An array of parameters to be passed to the requested method.
private
# response( string $response, mixed $data = null, boolean $encode = true )

Outputs the response and data of the current Request in the desired format

Outputs the response and data of the current Request in the desired format

Parameters

$response
string
$response The server response
$data
mixed
$data The data to be output (will be encoded into the appropriate format automatically)
$encode
boolean
$encode True to automatically encode the given data, false otherwise.
private string
# encode( array $data )

Encodes the data given into the desired output format

Encodes the data given into the desired output format

Parameters

$data
array
$data the Data to encode into $this->format

Returns

string
The encoded data based on the format given in $this->format
private boolean
# authenticate( )

Attempt to authenticate the user

Attempt to authenticate the user

Returns

boolean
True if the user is valid, false otherwise
private string
# getAuthMode( )

Returns the authentication mode being used by the user

Returns the authentication mode being used by the user

Returns

string
The authentication mode being used by the user

Methods inherited from AppController

__construct(), authorized(), flashMessage(), getCompany(), getDaysOfWeek(), getMonths(), getTimes(), getWidgets(), isAjax(), isLoggedIn(), isStaffAsClient(), licenseCheck(), outputAsJson(), postAction(), primeCompany(), renderAjaxWidget(), renderAjaxWidgetIfAsync(), reorderWidgets(), requireLogin(), setMessage(), setWidgetState(), toggleWidget()

Methods inherited from Controller

clearCache(), components(), draw(), emptyCache(), helpers(), partial(), redirect(), render(), set(), setDefaultViewPath(), startCaching(), stopCaching(), uses()

Magic methods summary

Constants summary

string OK "OK"
#
string NOT_FOUND "The requested resource does not exist."
#
string UNAUTHORIZED "The authorization details given appear to be invalid."
#
string FORBIDDEN "The requested resource is not accessible."
#
string UNSUPPORTED_FORMAT "The format requested is not supported by the server."
#
string MAINTENANCE_MODE "The requested resource is currently unavailable due to maintenance."
#
string INTERNAL_ERROR "An unexpected error occured."
#
string BAD_REQUEST "The request cannot be fulfilled due to bad syntax."
#

Properties summary

private static array $formats
#

The available output formats

The available output formats

private string $format
#

The current output format

The current output format

private string $model
#

The full model string (e.g. Plugin.Model)

The full model string (e.g. Plugin.Model)

private string $model_name
#

The model name to load (e.g. Model)

The model name to load (e.g. Model)

private string $method
#

The method of the model to execute

The method of the model to execute

private mixed $errors
#

An array containing all errors set by the model, false if no errors set

An array containing all errors set by the model, false if no errors set

private string $request_method
#

The request method (POST, GET, PUT, DELETE)

The request method (POST, GET, PUT, DELETE)

Properties inherited from AppController

$admin_uri, $base_uri, $base_url, $client_uri, $company_id, $components, $helpers, $layout, $request_uri, $server_protocol

Properties inherited from Controller

$action, $controller, $files, $get, $is_cli, $plugin, $post, $structure, $structure_view, $uri, $uri_str, $uses, $view

Blesta API documentation generated by ApiGen 2.8.0