Package com.skava.web
Class UsersController
java.lang.Object
com.skava.web.UsersController
This controller class contains service end-points that are used to perform actions such as Create User,
Update User, Search User(s), Delete User, send and validate user activation respectively.
- Author:
- Infosys Equinox
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<UserCreateResponse>
createUser
(@Valid UsersList users, boolean inviteUserFlag, Long collectionId, String authToken, String locale, String version, long storeId, boolean validateOnly, boolean excludePropertyCheck) This service is used to create a new registered user or guest user.User is created based on the provided identity information and properties.org.springframework.http.ResponseEntity<Object>
deactivateUser
(long userId, Long collectionId, long businessId, String authToken, String locale, String version, long storeId) This service end-point de-activates the requested user, status of the user will be changed to DEACTIVATED.org.springframework.http.ResponseEntity<UserSearchResponse>
getAllUser
(int page, int size, boolean fullProfile, boolean skipTotalCount, String search, String sort, List<Long> userIds, Long collectionId, long businessId, String authToken, String locale, String version, long storeId) This service end-point loads all users data within the given page and size, loads full profile based on the ON and OFF value of fullProfile.org.springframework.http.ResponseEntity<UsersResponse>
getAllUserPublicProfile
(int page, int size, String filter, String sort, Long collectionId, long businessId, String authToken, String locale, String version, long storeId) This API retrieves the user's public profile within the given collection based on the given filter.org.springframework.http.ResponseEntity<Users>
getUser
(long userId, boolean fullProfile, Long collectionId, long businessId, String authToken, String locale, String version, long storeId) This service end-point loads user information based on the provided userID, full profile of user can be loaded based on the ON and OFF value of fullProfile paramorg.springframework.http.ResponseEntity<Users>
sendActivationService
(UserActivationRequest activationRequest, Long collectionId, String authToken, String locale, String version, long storeId) This service end-point sends activation Mail / SMS to the respective user's email / phone numberorg.springframework.http.ResponseEntity<Users>
updateUser
(long userId, @Valid Users user, Long collectionId, long businessId, String authToken, String locale, String version, long storeId, boolean excludePropertyCheck) This service end-point is used to update user's profile information which also includes their identities and properties as well.org.springframework.http.ResponseEntity<Users>
updateUsers
(long userId, @Valid Users user, Long collectionId, long businessId, String authToken, String locale, String version, long storeId) This service end-point is used to update user's profile information which also includes their identities and properties as well.org.springframework.http.ResponseEntity<Users>
validateActivationService
(UserActivationRequest activationRequest, Long collectionId, String authToken, String locale, String version, long storeId) This service endpoint validates the user activation request which was sent to Mail / SMS, after successful validation user will be activated.
-
Constructor Details
-
UsersController
public UsersController()Default Constructor.
-
-
Method Details
-
createUser
@PostMapping @ResponseStatus(CREATED) @Audit(action="createUsers") public org.springframework.http.ResponseEntity<UserCreateResponse> createUser(@RequestBody @Valid @AuditField(field="USERS") @Valid UsersList users, @RequestParam(value="inviteUserFlag",required=false,defaultValue="false") @AuditField(field="INVITE_USER_FLAG") boolean inviteUserFlag, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="COLLECTION_ID") Long collectionId, @RequestHeader(value="x-auth-token",required=false) @AuditField(field="AUTH_TOKEN") String authToken, @RequestParam(value="locale",required=false,defaultValue="en_US") @AuditField(field="LOCALE") String locale, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="VERSION") String version, @RequestHeader(value="x-store-id",required=false,defaultValue="0") @AuditField(field="STORE_ID") long storeId, @RequestParam(value="validateOnly",required=false,defaultValue="false") @AuditField(field="CHECK_USER_FLAG") boolean validateOnly, @RequestParam(value="excludePropertyCheck",required=false,defaultValue="false") @AuditField(field="CHECK_CUSTOM_PROPERTY_FLAG") boolean excludePropertyCheck) This service is used to create a new registered user or guest user.User is created based on the provided identity information and properties. User's identity are email and phone by default which are validated and uniqueness of the user is maintained within a collection. The user creation happens in two ways, one is direct user creation via registered process where use will be created in ACTIVE status. Another one is through invite user done by administrators where user will be created in NOT ACTIVATED status. User activation communication goes through email/phone, post successful validation user will be activated. Registered and Guest users are distinguished with the help of GUEST flag. Guest user will be created without having any profile information in the system with TYPE 2- Parameters:
users
- HoldsUsersList
. Holds usersList request contains the entire user data to be createdinviteUserFlag
- Holds boolean value. If the inviteUserFlag is true, then the user is created through activation flow which means the user will be created as a not activated user and a reminder goes through email/phone validation after which it will be activated,else if inviteUserFlag is false, then the direct create user flow creates a active user directly into the system.collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with configured properties and these properties can be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way storefront can fetch/store the required information from that respective association.authToken
- This field holds a valid authorization token generated using the Authorization microservice for an user. Auth token (JWT format) represents claims containing roles and privileges of the user accessing this API. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API it has to be generated before hand by invoking the /auth/sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in HTML and HTTP environments, while being more compact when compared to XML-based standards such as SAML. Thus generated token has to be passed to this service and the request will be processed only if the following conditions are met:- Token validation against the secret key
- Expiry time should be in the future
- Necessary privileges are available for the user to perform the action on the subjected resource
locale
- API Response and error messages will be responded in the locale mentioned in this parameter.version
- It hold the value of version number of API. Using this parameter we can access the different version of the API. It is currently unused.storeId
- It Holds a valid unique identifier of the store.validateOnly
- Boolean flag which defines whether to check the given identity if it is true else creation of user occurs.- Returns:
- The
ResponseEntity
ofUserCreateResponse
object which contains the list of created users and existing users.
-
updateUser
@PatchMapping("/{userId}") @Audit(action="updateUser") public org.springframework.http.ResponseEntity<Users> updateUser(@PathVariable @AuditField(field="USER_ID") long userId, @RequestBody @Valid @AuditField(field="USER") @Valid Users user, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="COLLECTION_ID") Long collectionId, @RequestParam(value="businessId",required=false,defaultValue="0") @AuditField(field="BUSINESS_ID") long businessId, @RequestHeader(value="x-auth-token",required=true) @AuditField(field="AUTH_TOKEN") String authToken, @RequestParam(value="locale",required=false,defaultValue="en_US") @AuditField(field="LOCALE") String locale, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="VERSION") String version, @RequestHeader(value="x-store-id",required=false,defaultValue="0") @AuditField(field="STORE_ID") long storeId, @RequestParam(value="excludePropertyCheck",required=false,defaultValue="false") @AuditField(field="CHECK_CUSTOM_PROPERTY_FLAG") boolean excludePropertyCheck) This service end-point is used to update user's profile information which also includes their identities and properties as well.- Parameters:
userId
- Indicates User Id which user to be loaded. Holds long value.user
- HoldsUsers
. Holds usersList request contains the entire user data to be updated.collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with configured properties and these properties can be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way storefront can fetch/store the required information from that respective association.businessId
- This field holds a valid business identifier.A Business is typically a customer who has signed up with Infosys Equinox to launch a commerce store or a digital experience. An Infosys Equinox Commerce Instance can have multiple Businesses under which there can be multiple stores - Logical entity which binds all the services together to bring in an storefront experience.authToken
- This field holds a valid authorization token generated using the Authorization microservice for an user. Auth token (JWT format) represents claims containing roles and privileges of the user accessing this API. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API it has to be generated before hand by invoking the /auth/sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in HTML and HTTP environments, while being more compact when compared to XML-based standards such as SAML. Thus generated token has to be passed to this service and the request will be processed only if the following conditions are met:- Token validation against the secret key
- Expiry time should be in the future
- Necessary privileges are available for the user to perform the action on the subjected resource
locale
- API Response and error messages will be responded in the locale mentioned in this parameter.version
- It hold the value of version number of API. Using this parameter we can access the different version of the API. It is currently unused.storeId
- It Holds a valid unique identifier of the store.- Returns:
- The
ResponseEntity
ofUsers
object.
-
getAllUser
@GetMapping @Audit(action="getUsers") public org.springframework.http.ResponseEntity<UserSearchResponse> getAllUser(@RequestParam(value="page",required=false,defaultValue="1") @AuditField(field="PAGE") int page, @RequestParam(value="size",required=false,defaultValue="100") @AuditField(field="SIZE") int size, @RequestParam(value="fullProfile",required=false,defaultValue="false") @AuditField(field="FULL_PROFILE") boolean fullProfile, @RequestParam(value="skipTotalCount",required=false,defaultValue="false") @AuditField(field="SKIP_TOTAL_COUNT") boolean skipTotalCount, @RequestParam(value="search",required=false,defaultValue="") @AuditField(field="FILTER") @DeIdentify String search, @RequestParam(value="sort",required=false,defaultValue="") @AuditField(field="SORT") String sort, @RequestParam(value="userIds",required=false) @AuditField(field="USER_IDS") List<Long> userIds, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="COLLECTION_ID") Long collectionId, @RequestParam(value="businessId",required=false,defaultValue="0") @AuditField(field="BUSINESS_ID") long businessId, @RequestHeader(value="x-auth-token",required=true) @AuditField(field="AUTH_TOKEN") String authToken, @RequestParam(value="locale",required=false,defaultValue="en_US") @AuditField(field="LOCALE") String locale, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="VERSION") String version, @RequestHeader(value="x-store-id",required=false,defaultValue="0") @AuditField(field="STORE_ID") long storeId) This service end-point loads all users data within the given page and size, loads full profile based on the ON and OFF value of fullProfile.- Parameters:
page
- The page number to be retrieved where the size of the page must be specified by the size/offset/pageSize parameter. First page starts with value \"0\". Holds integer value.size
- The number of documents being retrieved on the corresponding page specified by page parameter. Holds integer value.fullProfile
- Holds boolean value.If fullProfile is set as true, then the complete user profile information inclusive of identities, addresses, custom properties, etc will get loaded. Else if the fullProfile flag is set as false,then only partial user profile information exclusive of addresses, identities, etc will get loaded.search
- Holds String value for search criteria. Below are some of the sample search criteria.- /users?search=id:1 - Represents user identifier.The possible values holds long.
- /users?search=type:1 - Refers user type, whether he is a guest or a registered user. It holds either 1 or 2. 1 for registered user and 2 for guest user.
- /users?search=firstName:john - Refers user's first name of String type.
- /users?search=lastName:smith - Refers user's last name of String type.
- /users?search=preferences:email - Holds the user's preference. It is of String type which contain either email or phone.
- Some of the user objects are used as exact search
which includes email,status,phoneNumber and gender.
- /users?search=email:test@infosysequinox.com - Holds user's unique email address.
- /users?search=status:ACTIVE - Holds String value.Refers user status. Status are active, inactive and not activated.
- /users?search=phoneNumber:123435363 - Holds user's unique phone number.Holds String value.
- /users?search=gender:Male - Refers user's gender of String type.
- User Address information can also be searched with the fields city,state,
country and zipcode.Multiple search can also be done with comma separated
between each search.For Example,
- /users?search=city:cbe, country:India,state:TamilNadu,zipCode:12345 - User address multiple search separated by comma, which holds string values.
sort
- aString
object.Holds the sorting param which contains sorting property name and sorting order.The sorting order can be specified along with the property name separated by comma.The default sorting order is ascending. The property which are used for sorting are as follows- /users?sort=firstName,ASC - Sorting user's first name with ascending order.
- /users?sort=lastName,DESC - Sorting user's last name with descending order.
- /users?sort=gender,DESC - Sorting user's gender with descending order
- /users?sort=status,DESC - Sorting user's gender with descending order
- /users?sort=type,ASC - Sorting user's type with ascending order
- /users?sort=id,ASC - Users will get sorted based on the id in ascending order.
- /users?sort=lastName - Sorting user's lastName with default ascending order since the order is not specified
userIds
- aString
object.Holds the userids which needs to be loaded.Eg: "/users?userIds=1,2,3,4,5".collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with configured properties and these properties can be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way storefront can fetch/store the required information from that respective association.businessId
- This field holds a valid business identifier.A Business is typically a customer who has signed up with Infosys Equinox to launch a commerce store or a digital experience. An Infosys Equinox Commerce Instance can have multiple Businesses under which there can be multiple stores - Logical entity which binds all the services together to bring in an storefront experience.authToken
- This field holds a valid authorization token generated using the Authorization microservice for an user. Auth token (JWT format) represents claims containing roles and privileges of the user accessing this API. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API it has to be generated before hand by invoking the /auth/sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in HTML and HTTP environments, while being more compact when compared to XML-based standards such as SAML. Thus generated token has to be passed to this service and the request will be processed only if the following conditions are met:- Token validation against the secret key
- Expiry time should be in the future
- Necessary privileges are available for the user to perform the action on the subjected resource
locale
- API Response and error messages will be responded in the locale mentioned in this parameter.version
- It hold the value of version number of API. Using this parameter we can access the different version of the API. It is currently unused.storeId
- It Holds a valid unique identifier of the store.- Returns:
- The
ResponseEntity
ofUserSearchResponse
object.
-
getUser
@GetMapping("/{userId}") @Audit(action="getUser") public org.springframework.http.ResponseEntity<Users> getUser(@PathVariable @AuditField(field="USER_ID") long userId, @RequestParam(value="fullProfile",required=false,defaultValue="true") @AuditField(field="FULL_PROFILE") boolean fullProfile, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="COLLECTION_ID") Long collectionId, @RequestParam(value="businessId",required=false,defaultValue="0") @AuditField(field="BUSINESS_ID") long businessId, @RequestHeader(value="x-auth-token",required=true) @AuditField(field="AUTH_TOKEN") String authToken, @RequestParam(value="locale",required=false,defaultValue="en_US") @AuditField(field="LOCALE") String locale, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="VERSION") String version, @RequestHeader(value="x-store-id",required=false,defaultValue="0") @AuditField(field="STORE_ID") long storeId) This service end-point loads user information based on the provided userID, full profile of user can be loaded based on the ON and OFF value of fullProfile param- Parameters:
userId
- Indicates User Id for which user to be loaded. Holds long valuefullProfile
- Holds boolean value.If fullProfile is set as true, then the complete user profile information inclusive of identities, addresses, custom properties, etc will get loaded. Else if the fullProfile flag is set as false,then only partial user profile information exclusive of addresses, identities, etc will get loaded.collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with configured properties and these properties can be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way storefront can fetch/store the required information from that respective association.businessId
- This field holds a valid business identifier.A Business is typically a customer who has signed up with Infosys Equinox to launch a commerce store or a digital experience. An Infosys Equinox Commerce Instance can have multiple Businesses under which there can be multiple stores - Logical entity which binds all the services together to bring in an storefront experience.authToken
- This field holds a valid authorization token generated using the Authorization microservice for an user. Auth token (JWT format) represents claims containing roles and privileges of the user accessing this API. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API it has to be generated before hand by invoking the /auth/sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in HTML and HTTP environments, while being more compact when compared to XML-based standards such as SAML. Thus generated token has to be passed to this service and the request will be processed only if the following conditions are met:- Token validation against the secret key
- Expiry time should be in the future
- Necessary privileges are available for the user to perform the action on the subjected resource
locale
- API Response and error messages will be responded in the locale mentioned in this parameter.version
- It hold the value of version number of API. Using this parameter we can access the different version of the API. It is currently unused.storeId
- It Holds a valid unique identifier of the store.- Returns:
- The
ResponseEntity
ofUsers
object.
-
getAllUserPublicProfile
@GetMapping("/publicprofile") @Audit(action="getUsersPublicProfile") public org.springframework.http.ResponseEntity<UsersResponse> getAllUserPublicProfile(@RequestParam(value="page",required=false,defaultValue="1") @AuditField(field="PAGE") int page, @RequestParam(value="size",required=false,defaultValue="10") @AuditField(field="SIZE") int size, @RequestParam(value="filter",required=true,defaultValue="") @AuditField(field="FILTER") @DeIdentify String filter, @RequestParam(value="sort",required=false,defaultValue="") @AuditField(field="SORT") String sort, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="COLLECTION_ID") Long collectionId, @RequestParam(value="businessId",required=false,defaultValue="0") @AuditField(field="BUSINESS_ID") long businessId, @RequestHeader(value="x-auth-token",required=true) @AuditField(field="AUTH_TOKEN") String authToken, @RequestParam(value="locale",required=false,defaultValue="en_US") @AuditField(field="LOCALE") String locale, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="VERSION") String version, @RequestHeader(value="x-store-id",required=false,defaultValue="0") @AuditField(field="STORE_ID") long storeId) This API retrieves the user's public profile within the given collection based on the given filter. It have the limited support in the filters (email or phoneNumber or id) and returns user's firstName, lastName and type in the response. The functionality can be modified by using a plugin with the help of extension point which is configured in collection property in the name of 'public_profile_class'. This filter supports only exact searches and the parameters supported are email, phoneNumber and id and only one among this parameters are used as filter at a time.- Parameters:
page
- The page number to be retrieved where the size of the page must be specified by the size/offset/pageSize parameter. First page starts with value \"0\". Holds integer value.size
- The number of documents being retrieved on the corresponding page specified by page parameter. Holds integer value.filter
- Holds the simple query criteria based on the available fields to limit returned results. The filter fields are id, email and phoneNumber. It provide exact search results in response.sort
- aString
object. Holds the sorting param which contains sorting property name and sorting order.The sorting order can be specified along with the property name separated by comma.The default sorting order is ascending. The property which are used for sorting are as follows:- /users?sort=firstName,ASC - Sorting user's first name with ascending order.
- /users?sort=lastName,DESC - Sorting user's last name with descending order.
- /users?sort=gender,DESC - Sorting user's gender with descending order
- /users?sort=status,DESC - Sorting user's gender with descending order
- /users?sort=type,ASC - Sorting user's type with ascending order
- /users?sort=id,ASC - Users will get sorted based on the id in ascending order.
- /users?sort=lastName - Sorting user's lastName with default ascending order since the order is not specified
collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with configured properties and these properties can be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way storefront can fetch/store the required information from that respective association.businessId
- This field holds a valid business identifier.A Business is typically a customer who has signed up with Infosys Equinox to launch a commerce store or a digital experience. An Infosys Equinox Commerce Instance can have multiple Businesses under which there can be multiple stores - Logical entity which binds all the services together to bring in an storefront experience.authToken
- This field holds a valid authorization token generated using the Authorization microservice for an user. Auth token (JWT format) represents claims containing roles and privileges of the user accessing this API. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API it has to be generated before hand by invoking the /auth/sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in HTML and HTTP environments, while being more compact when compared to XML-based standards such as SAML. Thus generated token has to be passed to this service and the request will be processed only if the following conditions are met:- Token validation against the secret key
- Expiry time should be in the future
- Necessary privileges are available for the user to perform the action on the subjected resource
locale
- API Response and error messages will be responded in the locale mentioned in this parameter.version
- It hold the value of version number of API. Using this parameter we can access the different version of the API. It is currently unused.storeId
- It Holds a valid unique identifier of the store.- Returns:
- The
ResponseEntity
ofUserSearchResponse
object.
-
deactivateUser
@DeleteMapping("/{userId}") @Audit(action="deleteUser") public org.springframework.http.ResponseEntity<Object> deactivateUser(@PathVariable @AuditField(field="USER_ID") long userId, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="COLLECTION_ID") Long collectionId, @RequestParam(value="businessId",required=false,defaultValue="0") @AuditField(field="BUSINESS_ID") long businessId, @RequestHeader(value="x-auth-token",required=true) @AuditField(field="AUTH_TOKEN") String authToken, @RequestParam(value="locale",required=false,defaultValue="en_US") @AuditField(field="LOCALE") String locale, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="VERSION") String version, @RequestHeader(value="x-store-id",required=false,defaultValue="0") @AuditField(field="STORE_ID") long storeId) This service end-point de-activates the requested user, status of the user will be changed to DEACTIVATED.- Parameters:
userId
- Indicates User Id for which user to be deactivated. Holds long value.collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with configured properties and these properties can be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way storefront can fetch/store the required information from that respective association.businessId
- This field holds a valid business identifier.A Business is typically a customer who has signed up with Infosys Equinox to launch a commerce store or a digital experience. An Infosys Equinox Commerce Instance can have multiple Businesses under which there can be multiple stores - Logical entity which binds all the services together to bring in an storefront experience.authToken
- This field holds a valid authorization token generated using the Authorization microservice for an user. Auth token (JWT format) represents claims containing roles and privileges of the user accessing this API. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API it has to be generated before hand by invoking the /auth/sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in HTML and HTTP environments, while being more compact when compared to XML-based standards such as SAML. Thus generated token has to be passed to this service and the request will be processed only if the following conditions are met:- Token validation against the secret key
- Expiry time should be in the future
- Necessary privileges are available for the user to perform the action on the subjected resource
locale
- API Response and error messages will be responded in the locale mentioned in this parameter.version
- It hold the value of version number of API. Using this parameter we can access the different version of the API. It is currently unused.storeId
- It Holds a valid unique identifier of the store.- Returns:
- The
ResponseEntity
ofObject
.
-
sendActivationService
@PostMapping("/activation") @Audit(action="sendActivation") public org.springframework.http.ResponseEntity<Users> sendActivationService(@RequestBody @AuditField(field="USER_ACTIVATION") UserActivationRequest activationRequest, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="COLLECTION_ID") Long collectionId, @RequestHeader(value="x-auth-token",required=false) @AuditField(field="AUTH_TOKEN") String authToken, @RequestParam(value="locale",required=false,defaultValue="en_US") @AuditField(field="LOCALE") String locale, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="VERSION") String version, @RequestHeader(value="x-store-id",required=false,defaultValue="0") @AuditField(field="STORE_ID") long storeId) This service end-point sends activation Mail / SMS to the respective user's email / phone number- Parameters:
activationRequest
- HoldsUserActivationRequest
Holds activation object contains the user data for which user is to be activated.collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with configured properties and these properties can be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way storefront can fetch/store the required information from that respective association.authToken
- This field holds a valid authorization token generated using the Authorization microservice for an user. Auth token (JWT format) represents claims containing roles and privileges of the user accessing this API. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API it has to be generated before hand by invoking the /auth/sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in HTML and HTTP environments, while being more compact when compared to XML-based standards such as SAML. Thus generated token has to be passed to this service and the request will be processed only if the following conditions are met:- Token validation against the secret key
- Expiry time should be in the future
- Necessary privileges are available for the user to perform the action on the subjected resource
locale
- API Response and error messages will be responded in the locale mentioned in this parameter.version
- It hold the value of version number of API. Using this parameter we can access the different version of the API. It is currently unused.storeId
- It Holds a valid unique identifier of the store.- Returns:
- The
ResponseEntity
ofUsers
object.
-
validateActivationService
@PatchMapping("/activation") @Audit(action="validateActivation") public org.springframework.http.ResponseEntity<Users> validateActivationService(@RequestBody UserActivationRequest activationRequest, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="COLLECTION_ID") Long collectionId, @RequestHeader(value="x-auth-token",required=false) @AuditField(field="AUTH_TOKEN") String authToken, @RequestParam(value="locale",required=false,defaultValue="en_US") @AuditField(field="LOCALE") String locale, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="VERSION") String version, @RequestHeader(value="x-store-id",required=false,defaultValue="0") @AuditField(field="STORE_ID") long storeId) This service endpoint validates the user activation request which was sent to Mail / SMS, after successful validation user will be activated.- Parameters:
activationRequest
- HoldsUserActivationRequest
Holds activation object which is needed for validating activation param.collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with configured properties and these properties can be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way storefront can fetch/store the required information from that respective association.authToken
- This field holds a valid authorization token generated using the Authorization microservice for an user. Auth token (JWT format) represents claims containing roles and privileges of the user accessing this API. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API it has to be generated before hand by invoking the /auth/sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in HTML and HTTP environments, while being more compact when compared to XML-based standards such as SAML. Thus generated token has to be passed to this service and the request will be processed only if the following conditions are met:- Token validation against the secret key
- Expiry time should be in the future
- Necessary privileges are available for the user to perform the action on the subjected resource
locale
- API Response and error messages will be responded in the locale mentioned in this parameter.version
- It hold the value of version number of API. Using this parameter we can access the different version of the API. It is currently unused.storeId
- It Holds a valid unique identifier of the store.- Returns:
- The
ResponseEntity
ofUsers
object.
-
updateUsers
@PutMapping("/{userId}") @Audit(action="putUser") public org.springframework.http.ResponseEntity<Users> updateUsers(@PathVariable @AuditField(field="USER_ID") long userId, @RequestBody @Valid @AuditField(field="USER") @Valid Users user, @RequestHeader(value="x-collection-id",required=true) @AuditField(field="COLLECTION_ID") Long collectionId, @RequestParam(value="businessId",required=false,defaultValue="0") @AuditField(field="BUSINESS_ID") long businessId, @RequestHeader(value="x-auth-token",required=true) @AuditField(field="AUTH_TOKEN") String authToken, @RequestParam(value="locale",required=false,defaultValue="en_US") @AuditField(field="LOCALE") String locale, @RequestHeader(value="x-version",required=false,defaultValue="8.19.7") @AuditField(field="VERSION") String version, @RequestHeader(value="x-store-id",required=false,defaultValue="0") @AuditField(field="STORE_ID") long storeId) This service end-point is used to update user's profile information which also includes their identities and properties as well.- Parameters:
userId
- Indicates User Id which user to be loaded. Holds long value.user
- HoldsUsers
. Holds usersList request contains the entire user data to be updated.collectionId
- This field holds a valid collection identifier of this microservice and requested operation will be performed on this collection identifier. Collection is the top most entity of a microservice under which all the other entities/resources reside. Each collection represents an instance of the microservice with configured properties and these properties can be modified to bring in a different behavior per collection of the same microservice. Store association is the process of associating a microservice collection to a store along with its respective sub-entity. This way storefront can fetch/store the required information from that respective association.businessId
- This field holds a valid business identifier.A Business is typically a customer who has signed up with Infosys Equinox to launch a commerce store or a digital experience. An Infosys Equinox Commerce Instance can have multiple Businesses under which there can be multiple stores - Logical entity which binds all the services together to bring in an storefront experience.authToken
- This field holds a valid authorization token generated using the Authorization microservice for an user. Auth token (JWT format) represents claims containing roles and privileges of the user accessing this API. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. Since the token is a required field for this API it has to be generated before hand by invoking the /auth/sessions API provided by Authorization microservice. The output is three Base64 strings separated by dots that can be easily passed in HTML and HTTP environments, while being more compact when compared to XML-based standards such as SAML. Thus generated token has to be passed to this service and the request will be processed only if the following conditions are met:- Token validation against the secret key
- Expiry time should be in the future
- Necessary privileges are available for the user to perform the action on the subjected resource
locale
- API Response and error messages will be responded in the locale mentioned in this parameter.version
- It hold the value of version number of API. Using this parameter we can access the different version of the API. It is currently unused.storeId
- It Holds a valid unique identifier of the store.- Returns:
- The
ResponseEntity
ofUsers
object.
-