This class provides RESTful services to get the user context of a shopper. For example, PersonalizationId.
com.ibm.commerce.rest.member.handler.UserContextHandler
| HTTP Method | Path | Description |
|---|---|---|
| GET | /store/{storeId}/usercontext/@self/contextdata | Gets the context data by the cookies and tokens sent with the request. |
| GET | /store/{storeId}/usercontext/personalizationId | Gets or generates the Personalization ID of the current session. |
Gets the context data by the cookies and tokens sent with the request.
getContextData
false
true
| Name | Description | Parameter Type | Data Type | Required | Allow Multiple |
|---|---|---|---|---|---|
| storeId | The store identifier. | path | string | true | N/A |
| HTTP Status Code | Description |
|---|---|
| 200 | The requested completed successfully. |
| 400 | Bad request. Some of the inputs provided to the request aren't valid. |
| 401 | Not authenticated. The user session isn't valid. |
| 403 | The user isn't authorized to perform the specified request. |
| 404 | The specified resource couldn't be found. |
| 500 | Internal server error. Additional details will be contained on the server logs. |
com.ibm.commerce.rest.member.handler.UserContextHandler$UserContext
GET /wcs/resources/store/10001/usercontext/@self/contextdata
200
{
"basicInfo": {
"callerId": 2003,
"channelId": -1,
"runAsId": 2003,
"storeId": 10001
},
"catalog": {
"catalogId": 10052,
"masterCatalog": false
},
"entitlement": {
"activeOrganizationId": -2000,
"currentTradingAgreementIds": [
10001
],
"eligibleTradingAgreementIds": [
10001
],
"hostingContractId": -1,
"sessionTradingAgreementIds": null
},
"globalization": {
"currency": "USD",
"languageId": -1,
"preferredCurrency": "USD",
"preferredLanguageId": -1
},
"isPartiallyAuthenticated": false
}
Gets or generates the Personalization ID of the current session.
getPersonalizationID
false
true
| Name | Description | Parameter Type | Data Type | Required | Allow Multiple |
|---|---|---|---|---|---|
| storeId | The store identifier. | path | string | true | N/A |
| HTTP Status Code | Description |
|---|---|
| 200 | The requested completed successfully. |
| 400 | Bad request. Some of the inputs provided to the request aren't valid. |
| 401 | Not authenticated. The user session isn't valid. |
| 403 | The user isn't authorized to perform the specified request. |
| 404 | The specified resource couldn't be found. |
| 500 | Internal server error. Additional details will be contained on the server logs. |
com.ibm.commerce.rest.member.handler.UserContextHandler$PersonalizationIdentifier
GET /wcs/resources/store/10801/usercontext/personalizationId
200
{
"personalizationID": "1414184550631-55"
}
Personalization identitifier.
| Name | Data Type | Required |
|---|---|---|
| personalizationID | string | true |
User context.
| Name | Data Type | Required |
|---|---|---|
| globalization | com.ibm.commerce.rest.member.handler.UserContextHandler$UserContext$Globalization | true |
| workspace | com.ibm.commerce.rest.member.handler.UserContextHandler$UserContext$Workspace | false |
| preview | com.ibm.commerce.rest.member.handler.UserContextHandler$UserContext$Preview | false |
| catalog | com.ibm.commerce.rest.member.handler.UserContextHandler$UserContext$Catalog | true |
| isPartiallyAuthenticated | string | true |
| basicInfo | com.ibm.commerce.rest.member.handler.UserContextHandler$UserContext$BasicInfo | true |
| entitlement | com.ibm.commerce.rest.member.handler.UserContextHandler$UserContext$Entitlement | true |
User's basic information.
| Name | Data Type | Required |
|---|---|---|
| callerId | string | true |
| runAsId | string | true |
| storeId | string | true |
| channelId | string | true |
User's catalog.
| Name | Data Type | Required |
|---|---|---|
| catalogId | string | true |
| masterCatalog | string | true |
User's entitlement information.
| Name | Data Type | Required |
|---|---|---|
| activeOrganizationId | string | true |
| currentTradingAgreementIds | integer array | false |
| hostingContractId | string | false |
| eligibleTradingAgreementIds | integer array | false |
| sessionTradingAgreementIds | integer array | false |
User's globalization context.
| Name | Data Type | Required |
|---|---|---|
| currency | string | true |
| preferredCurrency | string | true |
| languageId | string | true |
| preferredLanguageId | string | true |
User's preview information.
| Name | Data Type | Required |
|---|---|---|
| initialtimeDiff | string | false |
| timestamp | string | false |
| previewProperties | com.ibm.commerce.rest.member.handler.UserContextHandler$UserContext$Preview$PreviewProperties | false |
| static | string | false |
User's preview properties information.
| Name | Data Type | Required |
|---|---|---|
| previewRestURI | string | false |
| previewHost | string | false |
| previewInventory | string | false |
| previewPath | string | false |
User's workspace information.
| Name | Data Type | Required |
|---|---|---|
| workspaceName | string | false |
| task | string | false |
| taskGroup | string | false |