ePages 7.37.0 - DE_EPAGES/MultiStoreConnector/API/RestConnector.pm

Package DE_EPAGES::MultiStoreConnector::API::RestConnector

module to get shop data from REST resources

Functions

createCategory
createProduct
createProductCategory
deleteSubshopProductMap
getCategories
getProducts
getShops
getStores
getSubshop
getSubshopProductMap
new
postSubshop
postSubshopProductMapViaSubshop

createCategory

Creates category in the specified shop.

Syntax
$Response = $RestConnector->createCategory($ShopGUID, $Category);
Input
$ShopGUID (string)
GUID of the shop
$Category (ref)
category to add
Return
$Response (ref)
added category

createProduct

Creates product in the specified shop.

Syntax
$Response = $RestConnector->createProduct($ShopGUID, $Product);
Input
$ShopGUID (string)
GUID of the shop
$Product (ref)
product to add
Return
$Response (ref)
added product

createProductCategory

Creates assignment of a product to a category in the specified shop.

Syntax
$Response = $RestConnector->createProductCategory($ShopGUID, $Product, $Category);
Input
$ShopGUID (string)
GUID of the shop
$ProductCategory (ref)
product-category assignment
Return
$Response (ref)
the created product-category assignment

deleteSubshopProductMap

Delete subshop_product_map with ID from the EMS app.

Syntax
$Response = $RestConnector->deleteSubshopProductMap($hSubshopProductMapID);
Input
$hSubshopProductMapID (ref.hash)
ID of subshop_product_map in EMS
Return
$Response (ref)
the requested subshop as json

getCategories

Gets all categories of the specified shop

Syntax
$Response = $RestConnector->getCategories($Shop);
Input
$ShopGUID (string)
GUID of the shop
Return
$Response (ref)
categories

getProducts

Gets all categories of the specified shop

Syntax
$Response = $RestConnector->getProducts($ShopGUID, $CategoryGUID);
Input
$ShopGUID (string)
GUID of the shop
$CategoryGUID (string)
GUID of the category
Return
$Response (ref)
products

getShops

Gets all shops of the specified store

Syntax
$Response = $RestConnector->getShops($Store);
Input
$StoreName (string)
alias of the store
Return
$Response (ref)
shops

getStores

Gets a list of all stores

Syntax
$Response= $RestConnector->getStores();
Return
$Reeponse (ref)
stores

getSubshop

Get subshop with values from the EMS app.

Syntax
$Response = $RestConnector->getSubshop($hGetVariables);
Input
$hGetVariables (ref.hash)
list of variables describing the subshop
Return
$Response (ref)
the requested subshop as json

getSubshopProductMap

Get subshop product map with given ID and product alias from the EMS app.

Syntax
$Response = $RestConnector->getSubshopProductMap($hSubshopID, $hProductAlias);
Input
$hSubshopID (ref.hash)
ID of subshop in EMS
$hProductAlias (ref.hash)
alias of product which was assigned to a subshop
Return
$Response (ref)
the requested subshop as json

new

Creates a new REST connector for multistore data

Syntax
$RestConnector = DE_EPAGES::MultiStore::API::RestConnector->new(%options);
Input
$BaseURL
base URL of the REST service to connect to
%options (hash)
options for un/install
  • IsRecursive - recursive un/installation of required or dependent
    cartridges

Return
$RestConnector (object)
rest connector object

postSubshop

Sends subshop to EMS.

Syntax
$Response = $RestConnector->postSubshop($hPostContent);
Input
$hPostContent (json)
json containing subshop which will be posted to EMS
Return
$Response (ref)
the created subshop

postSubshopProductMapViaSubshop

Sends subshop product map to EMS.

Syntax
$Response = $RestConnector->postSubshopProductMapViaSubshop($hSubshopID, hMessage);
Input
$hSubshopID (ref.hash)
ID of subshop in EMS
$hMessage (ref.hash)
JSON wich should be overhand to EMS
Return
$Response (ref)
the created subshop product map