Class CustomersApiV2Controller
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.
category |
System |
---|---|
package |
ApiV2Controllers |
__construct(\Slim\Slim $api, array $uri)
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 |
|
\Slim\Slim
Slim framework instance, used for request/response manipulation.
array
This array contains all the segments of the current request, starting from the resource.
delete()
apiVersion |
2.1.0 |
---|---|
apiName |
DeleteCustomer |
apiGroup |
Customers |
apiDescription |
Remove a customer record from the system. This method will always return success
even if the customer does not exist (due to internal CustomerWriteService architecture
decisions, which strive to avoid unnecessary failures).
An example script to demonstrate how to delete a customer is located under
|
get()
apiVersion |
2.3.0 |
---|---|
apiName |
GetCustomer |
apiGroup |
Customers |
apiDescription |
Get multiple or a single customer record through the GET method. This resource supports
the following GET parameters as described in the first section of documentation: sorting
minimization, search, pagination and links. Additionally you can filter customers by providing
the GET parameter "type=guest" or "type=registree". Sort and pagination GET parameters do not
apply when a single customer record is selected (e.g. api.php/v2/customers/84).
An example script to demonstrate how to fetch customer data is located under
|
getCallableResource( $controller, array $mappedURI, \Slim\Slim $api)
array
\Slim\Slim
post()
apiVersion |
2.3.0 |
---|---|
apiName |
CreateCustomer |
apiGroup |
Customers |
apiDescription |
This method enables the creation of a new customer (whether registree or a guest). Additionally
the user can provide new address information or just set the id of an existing one. Check the
examples bellow. An example script to demonstrate the creation of a new customer is located under
|
put()
apiVersion |
2.3.0 |
---|---|
apiName |
UpdateCustomer |
apiGroup |
Customers |
apiDescription |
This method will update the information of an existing customer record. You will
need to provide all the customer information with the request (except from password
and customer id). Also note that you only have to include the "addressId" property.
An example script to demonstrate how to update the admin accounts telephone number
is located under |
DEFAULT_PAGE_ITEMS
var |
---|
DEFAULT_CONTROLLER_NAME
var |
---|
DEFAULT_RATE_LIMIT
var |
---|
DEFAULT_RATE_RESET_PERIOD
var |
---|