Get Selected Audience for Experiment — API Reference

Method -: GET 

https://www.pagesense.zoho.com/pagesense/api/v1/portal/{portal_name}/audiences?experiment_link_name={linkname}

Scope Required

PageSense.audience.READ

Description

Returns the audience(s) currently assigned to the specified experiment. Use this when you need to load or validate the experiment’s active targeting before publishing, editing, or showing the selection state in the editor.


Request  

URL parameters     

  • portal_name — Portal identifier (path).

  • experiment_link_name — Experiment linkname to indicate selection context.

 

Sample Request

Copiedcurl -X GET "https://www.pagesense.zoho.com/pagesense/api/v1/portal/my-portal/audiences?experiment_link_name=homepage-ab-test" \
-H "Authorization: Zoho-oauthtoken {access_token}
-H "Accept: application/json"

Response field notes 

count (Integer) - Number of selected audiences returned.
audiences (Array) - Selected audience objects (usually 0..N).
audience_id (String) - id for the audience 
audience_linkname (String) - Machine name for the audience.
display_name (String) - Human readable name.
audience_is_selected (Boolean) - Should always be true for returned items 
audience_condition_json (JSON) - Condition tree defining the audience.
success (Boolean) - Success flag

Sample Response

Copied{
	"status_code": "10000",
	"status_string": "All resources were processed successfully.",
	"timeTakenToProcessTheRequest": "79 ms",
	"count": 1,
	"audiences": [{
		"audience_is_selected": true,
		"audience_linkname": "xcv",
		"audience_description": "",
		"success": true,
		"audience_id": "1579000001233001",
		"audience_condition_json": {
			"condition_type": 1,
			"conditions": [{
				"condition_type": 1,
				"conditions": [{
					"values": ["MONDAY"],
					"type": "day_of_week",
					"operator": 1
				}]
			}]
		}
		"display_name": "Monday customers"
	}]
}