Class TrackingCodeApiV2Controller

Class HttpApiV2Controller

Contains common functionality for all the GX2 APIv2 controllers. You can use the $api instance in the child-controllers in order to gain access to request and response information. The $uri variable is an array that contains the requested resource path.

You can use a protected "__initialize" method in your child controllers for performing common operations without overriding the parent constructor method.

This class contains some private methods that define the core operations of each controller and should not be called from a child-controller (like validation, authorization, rate limiting). The only way to disable the execution of these methods is to override the controller.

AbstractApiV2Controller
HttpApiV2Controller
TrackingCodeApiV2Controller
Package: ApiV2Controllers
Category: System
See: AbstractApiV2Controller
Todo:

Add _cacheResponse() helper function which will cache request data and it will provide the required headers.


Located at Controllers/Api/v2/TrackingCodeApiV2Controller.inc.php

Methods summary

protected init( void )

Initializes API Controller

public get( void )
public post( void )
public delete( void )
protected _convertTrackingCodes( array $orderParcelTrackingCodes )
protected _convertTrackingCode( array $orderParcelTrackingCode )
protected _deserialize( array $json )
protected ensureJsonIsValid( array $json )
protected _deserializeEntity( array $json )
protected _deserializeLightweightEntity( array $json )
protected determineLanguageId( array $json )

Methods inherited from HttpApiV2Controller

_linkResponse(), _locateResource(), _mapResponse(), _minimizeResponse(), _paginateResponse(), _searchResponse(), _setJsonValue(), _sortResponse(), _writeResponse()

Methods inherited from AbstractApiV2Controller

__construct(), _prepareResponse(), _setRateLimitHeader(), _validateRequest()

Constants summary

Constants inherited from AbstractApiV2Controller

DEFAULT_CONTROLLER_NAME, DEFAULT_PAGE_ITEMS, DEFAULT_RATE_LIMIT, DEFAULT_RATE_RESET_PERIOD

Properties summary

Properties inherited from AbstractApiV2Controller

$api, $uri