1. User Services
Properties and methods related to users.Auth
List
Get
Set
Delete
Auth
- user authenticationAction: /api/v1/user/auth?email=%email&pass=%pass
Returns:
Array ( [id] => 1 [name] => Wenca [surname] => Skocdopole [role] => user [cn] => cz [lang] => cs )
Errors:
- email = email invalid or not found
- pass = pass incorrect
- locked = account locked
Back
List
- list all usersAction: /api/v1/user/list?cn=%cn
Returns:
Array ( [0] => Array ( [id] => 1 [name] => Wenca [surname] => Skocdopole [role] => user [lang] => cs [pub] => 1 ) [1] => Array ( [id] => 2 [name] => pepa [surname] => z Depa [role] => user [lang] => cs [pub] => ) )
Back
Get
- get user propertiesAction: /api/v1/user/get?usrId=%usrId
Returns:
Array ( [name] => Wenca [surname] => Skocdopole [email] => wenca@skoc.cz [role] => user [cn] => cz [lang] => cs [pub] => 1 )
Errors:
- usrId = user not found
Back
Set
- set user properties- do not send usrId to create a new user
- only send password if it changes
Action: /api/v1/user/set?name=%name&surname=%surname&email=%email&role=%role&cn=%cn&lang=%lang&pub=1/0[&usrId=%usrId&pass=%pass]
Returns:
Array ( [usrId] => 3 )
Errors:
- pass = no password for a new user
- email = email is invalid
- role = role is invalid
- duplicate = user already exists
Back
Delete
- delete a userAction: /api/v1/user/delete?usrId=%usrId
Returns:
Array ( [usrId] => 3 )
Back
2. Brand Services
Properties and methods related to brands.List
Get
Set
Delete
GalleryGet
GallerySet
List
- list all brandsAction: /api/v1/brand/list?cn=%cn&lang=%lang
Returns:
Array ( [0] => Array ( [id] => 1 [name] => irobot [photo] => irobot.jpg [role] => irobot® [dateCreated] => 2021-11-06 [pub] => 1 ) [1] => Array ( [id] => 2 [name] => samsung [photo] => samsung.jpg [role] => samsung® [dateCreated] => 2021-11-07 [pub] => ) )
Back
Get
- get brand propertiesAction: /api/v1/brand/get?brandId=%brandId
Returns:
Array ( [uri] => /irobot [name] => irobot [description] => vacuum bots [gallery] => Array ( [0] => Array ( [img] => irobot1.jpg [alt] => irobot bot ) [1] => Array ( [img] => irobot2.jpg [alt] => irobot virtual map ) ) [ogTitle] => iRobot at your service [ogDescription] => we have the best vacuum bots [keywords] => vacuum, bot, dirt [favicon] => elPiso.jpg [showItems] => 1 [discussions] => 1 [dateCreated] => 2021-11-06 [rating] => 9.5 [cn] => cz [lang] => cs [pub] => 1 )
Errors:
- brandId = brand not found
Back
Set
- set brand properties- do not send brandId to create a new brand
Action: /api/v1/brand/set?uri=%uri&name=%name&description=%description&ogTitle=%ogTitle&ogDescription=%ogDescription&keywords=%keywords&favicon=%favicon&showItems=1/0&discussions=1/0&dateCreated=%dateCreated&rating=%rating&cn=%cn&lang=%lang&pub=1/0[&brandId=%brandId]
Returns:
Array ( [brandId] => 3 )
Errors:
- duplicate = brand already exists
- dateCreated = date invalid
Back
Delete
- delete a brandAction: /api/v1/brand/delete?brandId=%brandId
Returns:
Array ( [brandId] => 3 )
Back
3. Category Services
Properties and methods related to categories.List
Set
Delete
List
- list all categoriesAction: /api/v1/category/list?cn=%cn&lang=%lang
Returns:
Array ( [0] => Array ( [id] => 1 [name] => vacuum bots [pub] => 1 ) [1] => Array ( [id] => 2 [name] => floor mops [pub] => ) )
Back
Set
- set category properties- do not send categoryId to create a new category
Action: /api/v1/category/set?uri=%uri&name=%name&pub=1/0[&categoryId=%categoryId]
Returns:
Array ( [categoryId] => 3 )
Errors:
- duplicate = category already exists
Back
Delete
- delete a categoryAction: /api/v1/category/delete?categoryId=%categoryId
Returns:
Array ( [categoryId] => 3 )
Back
7. Constants
Language, countryProfile-specific
Language, country
- location-specific constantsLanguage:
- cs = čeština
- sk = slovenčina
Country:
- cz = Česko
- sk = Slovensko
Back
Profile-specific
- profile-specific constantsRole:
- 1-user = user can edit content
- 2-editor = user can edit structure
- 3-admin = user can edit other users
Profile status:
- 1-active = user can log on
- 0-inactive = user cannot log on
Back
###