user_context

This class provides RESTful services to get the user context of a shopper. For example, PersonalizationId.

Handler Class:

com.ibm.commerce.rest.member.handler.UserContextHandler

Method Summary

HTTP MethodPathDescription
GET/store/{storeId}/usercontext/@self/contextdataGets the context data by the cookies and tokens sent with the request.
GET/store/{storeId}/usercontext/personalizationIdGets or generates the Personalization ID of the current session.

Method Details

GET /store/{storeId}/usercontext/@self/contextdata

Gets the context data by the cookies and tokens sent with the request.

Handler Method:

getContextData

Secure Call Mandatory:

false

Partial Authentication Allowed:

true

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
HTTP Status Codes:
HTTP Status CodeDescription
200The requested completed successfully.
400Bad request. Some of the inputs provided to the request aren't valid.
401Not authenticated. The user session isn't valid.
403The user isn't authorized to perform the specified request.
404The specified resource couldn't be found.
500Internal server error. Additional details will be contained on the server logs.
Response Data Type:

com.ibm.commerce.rest.member.handler.UserContextHandler$UserContext


Example

Request:
GET /wcs/resources/store/10001/usercontext/@self/contextdata
HTTP Status Code:

200

Response:
{
	"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
}

GET /store/{storeId}/usercontext/personalizationId

Gets or generates the Personalization ID of the current session.

Handler Method:

getPersonalizationID

Secure Call Mandatory:

false

Partial Authentication Allowed:

true

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
HTTP Status Codes:
HTTP Status CodeDescription
200The requested completed successfully.
400Bad request. Some of the inputs provided to the request aren't valid.
401Not authenticated. The user session isn't valid.
403The user isn't authorized to perform the specified request.
404The specified resource couldn't be found.
500Internal server error. Additional details will be contained on the server logs.
Response Data Type:

com.ibm.commerce.rest.member.handler.UserContextHandler$PersonalizationIdentifier


Example

Request:
GET /wcs/resources/store/10801/usercontext/personalizationId
HTTP Status Code:

200

Response:
{
	"personalizationID": "1414184550631-55"
}

Data Type Details

com.ibm.commerce.rest.member.handler.UserContextHandler$PersonalizationIdentifier

Personalization identitifier.

Properties:
NameData TypeRequired
personalizationIDstringtrue

com.ibm.commerce.rest.member.handler.UserContextHandler$UserContext$BasicInfo

User's basic information.

Properties:
NameData TypeRequired
callerIdstringtrue
runAsIdstringtrue
storeIdstringtrue
channelIdstringtrue

com.ibm.commerce.rest.member.handler.UserContextHandler$UserContext$Catalog

User's catalog.

Properties:
NameData TypeRequired
catalogIdstringtrue
masterCatalogstringtrue

com.ibm.commerce.rest.member.handler.UserContextHandler$UserContext$Entitlement

User's entitlement information.

Properties:
NameData TypeRequired
activeOrganizationIdstringtrue
currentTradingAgreementIdsinteger arrayfalse
hostingContractIdstringfalse
eligibleTradingAgreementIdsinteger arrayfalse
sessionTradingAgreementIdsinteger arrayfalse

com.ibm.commerce.rest.member.handler.UserContextHandler$UserContext$Globalization

User's globalization context.

Properties:
NameData TypeRequired
currencystringtrue
preferredCurrencystringtrue
languageIdstringtrue
preferredLanguageIdstringtrue

com.ibm.commerce.rest.member.handler.UserContextHandler$UserContext$Preview

User's preview information.

Properties:
NameData TypeRequired
initialtimeDiffstringfalse
timestampstringfalse
previewPropertiescom.ibm.commerce.rest.member.handler.UserContextHandler$UserContext$Preview$PreviewPropertiesfalse
staticstringfalse

com.ibm.commerce.rest.member.handler.UserContextHandler$UserContext$Preview$PreviewProperties

User's preview properties information.

Properties:
NameData TypeRequired
previewRestURIstringfalse
previewHoststringfalse
previewInventorystringfalse
previewPathstringfalse

com.ibm.commerce.rest.member.handler.UserContextHandler$UserContext$Workspace

User's workspace information.

Properties:
NameData TypeRequired
workspaceNamestringfalse
taskstringfalse
taskGroupstringfalse