Class VpeApiV2Controller
-
AbstractApiV2Controller
-
┗
HttpApiV2Controller
-
┗
VpeApiV2Controller
Methods summary
protected
__initialize( void )
Initialize controller components.
Initialize controller components.
public
get( void )
Api
{get} /vpe/:id Get Customers
Apidescription
Get multiple or a single vpe record through the GET method
Apierror
404-NotFound VPE record could not be found.
Apierrorexample
Error-Response (VPE Not Found)
HTTP/1.1 404 Not Found
{
"code": 404,
"status": "error",
"message": "Vpe record could not be found."
}
Apiexample
{curl} Get All VPE records
curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/vpe
{curl} Get VPE record With ID = 982
curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/vpe/982
Apigroup
VPE
Apiname
GetVPE
Apiversion
2.5.0
public
patch( void )
Api
{patch} /vpe/:id Updates VPE
Apidescription
Use this method if you want to update an existing vpe record.
Apierror
400-BadRequest VPE data were not provided or vpe record ID was not provided or is invalid.
Apierrorexample
Error-Response (Empty request body)
HTTP/1.1 400 Bad Request
{
"code": 400,
"status": "error",
"message": "VPE data were not provided."
}
Error-Response (Missing or invalid ID)
HTTP/1.1 400 Bad Request
{
"code": 400,
"status": "error",
"message": "VPE record ID was not provided or is invalid."
}
Apigroup
VPE
Apiname
UpdateVPE
Apiparam
{Object} name Object that contains the language codes as key and the vpe name as value.
Apiparamexample
{json} VPE entity
{
"name": {
"EN": "API Packing unit",
"DE": "API Verpackungseinheit"
}
}
Apisuccess
(200) Request-Body If successful, this method returns the complete vpe resource
in the response body.
Apisuccessexample
{json} Success-Response
{
"id": 4,
"name": {
"EN": "API Packing unit",
"DE": "API Verpackungseinheit"
}
}
Apiversion
2.5.0
public
delete( void )
Api
{delete} /vpe/:id Delete VPE
Apidescription
Removes a vpe record from the system. This method will always return success
even if the vpe does not exist (due to internal VPEWriteService architecture
decisions, which strive to avoid unnecessary failures).
Apiexample
{curl} Delete VPE with ID = 84
curl -X DELETE --user admin@shop.de:12345 http://shop.de/api.php/v2/vpe/84
Apigroup
VPE
Apiname
DeleteVPE
Apisuccessexample
{json} Success-Response
{
"code": 200,
"status": "success",
"action": "delete",
"vpeId": 84
}
Apiversion
2.5.0
public
post( void )
Api
{post} /vpe Create VPE
Apidescription
This method enables the creation of a new VPE into the system.
Apierror
400-BadRequest The body of the request was empty.
Apierrorexample
Error-Response
HTTP/1.1 400 Bad Request
{
"code": 400,
"status": "error",
"message": "VPE data were not provided."
}
Apigroup
VPE
Apiname
CreateVPE
Apiparam
{Object} name Object that contains the language codes as key and the vpe name as value.
Apiparamexample
{json} Request-Body
{
"name": {
"EN": "API Packing unit",
"DE": "API Verpackungseinheit"
}
}
Apisuccess
(201) Request-Body If successful, this method returns the complete vpe resource
in the response body.
Apiversion
2.5.0
protected
_saveVpe( array $vpeData, VPEInterface $vpe )
:
Saves the given vpe entity with the given data in the database.
Saves the given vpe entity with the given data in the database.
Parameters
$vpeData
- VPE entity data to save.
$vpe
- VPE entity to be saved.
Returns
$this|\VpeApiV2Controller Same instance for chained method calls.
protected
_serializeVpeCollection( VPECollection $vpeCollection )
: array
Serializes a vpe collection to an array.
Serializes a vpe collection to an array.
Parameters
$vpeCollection
- VPECollection to be serialized.
Returns
array
Serialized vpe collection.
protected
_serializeVpe( VPEInterface $vpe )
: array
Serializes a single vpe entity to an array.
Serializes a single vpe entity to an array.
Parameters
$vpe
- VPE entity to be serialized.
Returns
array
Serialized vpe entity.
_linkResponse(),
_locateResource(),
_mapResponse(),
_minimizeResponse(),
_paginateResponse(),
_searchResponse(),
_setJsonValue(),
_sortResponse(),
_writeResponse()
__construct(),
_prepareResponse(),
_setRateLimitHeader(),
_validateRequest()
Constants summary
DEFAULT_CONTROLLER_NAME,
DEFAULT_PAGE_ITEMS,
DEFAULT_RATE_LIMIT,
DEFAULT_RATE_RESET_PERIOD
Properties summary
$api,
$uri