This class provides RESTful services to retrieve the customer segment data
com.ibm.commerce.rest.marketing.handler.SegmentHandler
| HTTP Method | Path | Description |
|---|---|---|
| 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}/isMember | Check whether the given customer identified by userId or personalizationId is part of given customer segment |
Get all customer segment by given storeId or get segment by userId or personalizationId or byName
getCustomerSegment
true
false
| Name | Description | Parameter Type | Data Type | Required | Allow Multiple |
|---|---|---|---|---|---|
| storeId | The store identifier. | path | string | true | N/A |
| q | The query name. | query | string | true | false |
| qUserId | The user identifier. Mandatory if the query is set to : byUserId | query | integer | false | false |
| qPersonalizationId | The user's personalization identifier. Mandatory if the query is set to : byPersonalizationId | query | string | false | false |
| qName | The user's name. Mandatory if the query is set to : byName | query | string | false | false |
| pageNumber | Page number, starting at 1. Valid values include positive integers of 1 and above. The "pageSize" must be specified for paging to work. | query | integer | false | false |
| pageSize | Page 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. | query | integer | false | false |
| 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. |
Get customer segment by segmentId
getCustomerSegmentById
true
false
| Name | Description | Parameter Type | Data Type | Required | Allow Multiple |
|---|---|---|---|---|---|
| storeId | The store identifier. | path | string | true | N/A |
| segmentId | The segment 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. |
GET /wcs/resources/store/10001/segment/8000000000000000003
200
{
"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"
}
Check whether the given customer identified by userId or personalizationId is part of given customer segment
checkIsInSegmentByUserId
true
false
| Name | Description | Parameter Type | Data Type | Required | Allow Multiple |
|---|---|---|---|---|---|
| storeId | The store identifier. | path | string | true | N/A |
| segmentId | Segment identifier. | path | string | true | N/A |
| userId | User unique identifier. | query | integer | false | false |
| personalizationId | The user's personalization id. Note : this parameter is ignored if the userId parameter is specified. | query | string | false | false |
| 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.marketing.handler.SegmentHandler$SegmentMemberCheck
GET /wcs/resources/store/10001/segment/8000000000000000003/isMember?personalizationId=9998316053431-9
200
{
"isInCustomeSegment": true
}
| Name | Data Type | Required |
|---|---|---|
| value | string | false |
| language | string | false |
Segment membership check.
| Name | Data Type | Required |
|---|---|---|
| isInCustomeSegment | string | true |
| Name | Data Type | Required |
|---|---|---|
| recordSetTotal | string | false |
| MemberGroup | segment-segments_item array | false |
| recordSetStartNumber | string | false |
| recordSetComplete | string | false |
| recordSetCount | string | false |
| Name | Data Type | Required |
|---|---|---|
| usage | string array | false |
| id | string | false |
| description | com.ibm.commerce.foundation.common.datatypes.DescriptionType | false |
| displayName | com.ibm.commerce.foundation.common.datatypes.DescriptionType | false |