Class ProductsLinksApiV2Controller
Class ProductsLinksApiV2Controller
Provides an API interface for managing the product links.
Notice: This controller is a sub-resource of the ProductsApiV2Controller.
-
AbstractApiV2Controller
-
┗
HttpApiV2Controller
-
┗
ProductsLinksApiV2Controller
Methods summary
protected
__initialize( void )
Initialize API Controller
Initialize API Controller
Throws
public
post( void )
Api
{post} /products/:id/links Create Product Link
Apidescription
Creates a new 'product to category' record in the system.
Apigroup
Products
Apiname
CreateProductLink
Apiparamexample
{json} Request-Body
{
"categoryId": 1
}
Apisuccessexample
{json} Success-Response
{
"code": 201,
"status": "success",
"action": "create",
"resource": "ProductLink",
"productId": 1,
"categoryId": 1
}
Apiversion
2.1.0
public
put( void )
Api
{put} /products/:id/links Update Product Link
Apidescription
Changes an existing 'product to category' link.
Apigroup
Products
Apiname
UpdateProductLink
Apiparamexample
{json} Request-Body
{
"oldCategoryId": 1,
"newCategoryId": 2
}
Apisuccessexample
{json} Success-Response
{
"code": 200,
"status": "success",
"action": "update",
"resource": "ProductLink",
"productId": 1,
"oldCategoryId": 1,
"newCategoryId": 2
}
Apiversion
2.1.0
public
delete( void )
Api
{delete} /products/:id/links Delete Product Link
Apidescription
Deletes an existing 'product to category' link.
If there is no categoryId property set, all the product links will be removed.
Apiexample
{curl} Delete product link for Product with ID = 1 in Category with ID = 1
curl -X DELETE --user admin@shop.de:12345 http://shop.de/api.php/v2/products/1/links
Apigroup
Products
Apiname
DeleteProductLink
Apisuccessexample
{json} Success-Response
{
"code": 200,
"status": "success",
"action": "delete",
"resource": "ProductLink",
"productId": 1
}
Apiversion
2.1.0
public
get( void )
Api
{get} /products/:id/links Get Product Links
Apidescription
Get all 'product to category' links for associated with a specific product.
Apiexample
{curl} Get product links for product with ID = 1
curl -i --user admin@shop.de:12345 http://shop.de/api.php/v2/products/1/links
Apigroup
Products
Apiname
GetProductLink
Apisuccessexample
{json} Success-Response
[
0,
1
]
Apiversion
2.1.0
_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