segment

This class provides RESTful services to retrieve the customer segment data

Handler Class:

com.ibm.commerce.rest.marketing.handler.SegmentHandler

Method Summary

HTTP MethodPathDescription
GET/store/{storeId}/segment?q={q}Get all customer segment by given storeId or get segment by userId or personalizationId or byName
GET/store/{storeId}/segment/{segmentId}Get customer segment by segmentId
GET/store/{storeId}/segment/{segmentId}/isMemberCheck whether the given customer identified by userId or personalizationId is part of given customer segment

Method Details

GET /store/{storeId}/segment?q={q}

Get all customer segment by given storeId or get segment by userId or personalizationId or byName

Handler Method:

getCustomerSegment

Secure Call Mandatory:

true

Partial Authentication Allowed:

false

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
qThe query name.querystringtruefalse
qUserIdThe user identifier. Mandatory if the query is set to : byUserIdqueryintegerfalsefalse
qPersonalizationIdThe user's personalization identifier. Mandatory if the query is set to : byPersonalizationIdquerystringfalsefalse
qNameThe user's name. Mandatory if the query is set to : byNamequerystringfalsefalse
pageNumberPage number, starting at 1. Valid values include positive integers of 1 and above. The "pageSize" must be specified for paging to work.queryintegerfalsefalse
pageSizePage size. Used to limit the amount of data returned by a query. Valid values include positive integers of 1 and above. The "pageNumber" must be specified for paging to work.queryintegerfalsefalse
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:

segment-segments

GET /store/{storeId}/segment/{segmentId}

Get customer segment by segmentId

Handler Method:

getCustomerSegmentById

Secure Call Mandatory:

true

Partial Authentication Allowed:

false

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
segmentIdThe segment 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:

segment-segments


Example

Request:
GET /wcs/resources/store/10001/segment/8000000000000000003
HTTP Status Code:

200

Response:
{
	"MemberGroup": [
		{
			"description": {
				"language": "-1",
				"value": "Shoppers who have not registered with the store"
			},
			"displayName": {
				"language": "-1",
				"value": "Guest Shoppers"
			},
			"id": "8000000000000000003",
			"usage": [
				"GeneralPurpose"
			]
		}
	],
	"recordSetComplete": true,
	"recordSetCount": 1,
	"recordSetStartNumber": 0,
	"recordSetTotal": 1,
	"resourceId": "https:\/\/localhost:443\/wcs\/resources\/store\/10001\/segment\/8000000000000000003",
	"resourceName": "segment"
}

GET /store/{storeId}/segment/{segmentId}/isMember

Check whether the given customer identified by userId or personalizationId is part of given customer segment

Handler Method:

checkIsInSegmentByUserId

Secure Call Mandatory:

true

Partial Authentication Allowed:

false

Parameters:
NameDescriptionParameter TypeData TypeRequiredAllow Multiple
storeIdThe store identifier.pathstringtrueN/A
segmentIdSegment identifier.pathstringtrueN/A
userIdUser unique identifier.queryintegerfalsefalse
personalizationIdThe user's personalization id. Note : this parameter is ignored if the userId parameter is specified.querystringfalsefalse
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.marketing.handler.SegmentHandler$SegmentMemberCheck


Example

Request:
GET /wcs/resources/store/10001/segment/8000000000000000003/isMember?personalizationId=9998316053431-9
HTTP Status Code:

200

Response:
{
	"isInCustomeSegment": true
}

Data Type Details

com.ibm.commerce.foundation.common.datatypes.DescriptionType

Properties:
NameData TypeRequired
valuestringfalse
languagestringfalse

com.ibm.commerce.rest.marketing.handler.SegmentHandler$SegmentMemberCheck

Segment membership check.

Properties:
NameData TypeRequired
isInCustomeSegmentstringtrue

segment-segments

Properties:
NameData TypeRequired
recordSetTotalstringfalse
MemberGroupsegment-segments_item arrayfalse
recordSetStartNumberstringfalse
recordSetCompletestringfalse
recordSetCountstringfalse

segment-segments_item

Properties:
NameData TypeRequired
usagestring arrayfalse
idstringfalse
descriptioncom.ibm.commerce.foundation.common.datatypes.DescriptionTypefalse
displayNamecom.ibm.commerce.foundation.common.datatypes.DescriptionTypefalse