Newer Version Available

This content describes an older version of this product. View Latest

Personalization Audiences

Get a list of audiences that include a user. Create an audience.
Resource
1/connect/communities/communityId/personalization/audiences
Available version
47.0
Requires Chatter
No
HTTP methods
GET, POST
Request parameters for GET
Parameter Name Type Description Required or Optional Available Version
domain String Name of the user’s Salesforce custom domain. If not specified, no audiences with domain criteria are returned. Optional 47.0
includeAudience​Criteria Boolean Specifies whether to include audience criteria (true) or not (false). If unspecified, defaults to false. Optional 47.0
ipAddress String IP address of the user. If not specified, no audiences with location criteria are returned. Optional 47.0
publishStatus String Publish status of the audience. Values are:
  • Draft
  • Live
If not specified, the default is Live.
Optional 47.0
targetTypes String[] Comma-separated list of target types to filter the results. In API version 47.0 and later, supported values include ExperienceVariation and custom object API names, such as CustomObjectName__c. If not specified, all target types are returned.

For more information on the ExperienceVariation target type, see ExperienceBundle in the Metadata API Developer Guide.

Optional 47.0
userId String ID of the user. If not specified, the default is the ID of the context user. Optional 47.0
Response body for GET
Audience Collection
Request body for POST
Root XML tag
<audience>
JSON example
1{
2   "criteria": [
3      {
4      "criterion": [
5         {
6         "entityType": "User",
7         "fieldValue": "60005500",
8         "entityField": "Contact.Account.AnnualRevenue"
9         },
10         {
11         "entityType": "User",
12         "fieldValue": "6000557700",
13         "entityField": "Contact.Account.AnnualRevenue"
14         }
15      ],
16      "criterionNumber": 1,
17      "criterionOperator": "Equal",
18      "criterionType": "FieldBased"
19      },
20      {
21      "criterion": [
22         {
23         "permission": "AssignTopics", // give permission id in case of custom permission
24         "isEnabled": "true"
25         }
26      ],
27      "criterionNumber": 2,
28      "criterionOperator": "Equal",
29      "criterionType": "Permission"
30      },
31      {
32      "criterion": [
33         {
34         "domainId": "0I4...", // give domain id 
35         },
36         {
37         "domainId": "0I4...", // give domain id 
38         }
39      ],
40      "criterionNumber": 3,
41      "criterionOperator": "Equal",
42      "criterionType": "Domain"
43      },
44      {
45      "criterion": [
46         {
47         "profileId": "00e...", // give profile id 
48         },
49         {
50         "profileId": "00e...", // give profile id 
51         }
52      ],
53      "criterionNumber": 4,
54      "criterionOperator": "Equal",
55      "criterionType": "Profile"
56      },
57      {
58      "criterion": [
59         {
60         "country": "US",
61         "subdivision" : "California",
62         "city" : "LA"
63         },
64         {
65         "country": "US",
66         "subdivision" : "California",
67         "city" : "SF"
68         },
69      ],
70      "criterionNumber": 5,
71      "criterionOperator": "Equal",
72      "criterionType": "GeoLocation"
73      }   ],
74   "customFormula": "(1 OR (2 AND 3)) AND 4 AND 5",
75   "formulaFilterType": "CustomLogicMatches",
76   "name": "CreateAudienceExample"
77}
Properties
Name Type Description Required or Optional Available Version
criteria Audience Criterion Input[] List of audience criteria to update or add. Required when creating an audience

Optional when updating an audience

47.0
customFormula String Custom formula for the audience criteria. For example, (1 AND 2) OR 3. Required when creating an audience with the formulaFilterType set to CustomLogicMatches

Optional, otherwise

47.0
formulaFilter​Type String Formula filter type for the personalization audience. Values are:
  • AllCriteriaMatch—All audience criteria are true (AND operation).
  • AnyCriterionMatches—Any audience criterion is true (OR operation).
  • CustomLogicMatches—Audience criteria match the custom formula (for example, (1 AND 2) OR 3).
Required when creating an audience

Optional when updating an audience

47.0
name String Name of the audience. Required when creating an audience

Optional when updating an audience

47.0
Response body for POST
Audience