API call to generate automatic segment recommendations based on recent traffic. This API sends a request to generate recommendations, and early returns {} in case the request has been accepted. To understand if the segment generation is under processing, succeeded or failed, please refer to /ai/segment/recommend/status. To retrieve the generated segments and processing times, please refer to /ai/segment/recommend/read.
IMPORTANT: The segment recommendations are stored for 24 hours from the last generation.
The user must be authenticated and have read permissions to the siteGroup. The customer must have the AI feature enabled to generate segment descriptions.
Request
The request object has the following fields:
|
Name |
Type |
Required |
Description |
|---|---|---|---|
|
|
String |
Yes |
SiteGroupId used to generate the segments recommendations |
Response (success)
The response object has the following fields:
|
Name |
Type |
Description |
|---|---|---|
|
- |
Object |
Empty Object |
Response (error)
The response object has the following fields:
|
Name |
Type |
Description |
|---|---|---|
|
|
String |
Reason why the request failed |
This API accept only 1 concurrent request per siteGroupId, meaning that if you submit another request while the segment recommendations are under processing, the API will return the error message "Segment recommendations are under processing. Aborting the request."
Examples
1- Submission of the first request (not under processing)
$ python cx.py /ai/segment/recommend '{"siteGroupId": "1234567890"}'
{}
2- Submission of another request after a couple of seconds (error, siteGroup under processing)
$ python cx.py /ai/segment/recommend '{"siteGroupId": "1234567890"}'
{
"error": "Segment recommendations are under processing. Aborting the request."
}