diff --git a/gen_resources/config_fb.json b/gen_resources/config_fb.json
index 593a7ae..3e591a0 100644
--- a/gen_resources/config_fb.json
+++ b/gen_resources/config_fb.json
@@ -77,6 +77,14 @@
{
"openapiOperationID": "Delete Ad",
"connectorOperationName": "deleteAd"
+ },
+ {
+ "openapiOperationID": "CreateCustomAudience",
+ "connectorOperationName": "createCustomAudience"
+ },
+ {
+ "openapiOperationID": "GetCustomAudiences",
+ "connectorOperationName": "getCustomAudiences"
}
]
}
diff --git a/gen_resources/facebook_ads_open_api.yaml b/gen_resources/facebook_ads_open_api.yaml
index ed14b2d..35aaa93 100644
--- a/gen_resources/facebook_ads_open_api.yaml
+++ b/gen_resources/facebook_ads_open_api.yaml
@@ -16,9 +16,60 @@ tags:
description: A group of ads that share the same daily or lifetime budget, schedule, bid type, bid info, and targeting data.
- name: Ad
description: Contains information to display an ad and associate it with an ad set.
+ - name: CustomAudience
+ description: Represent a custom audience
security:
- - ApiKeyAuth: []
+ - ApiKeyAuth: [ ]
paths:
+ /act_{ad_account_id}/custom_audiences:
+ get:
+ tags:
+ - "CustomAudience"
+ description: Retrieves custom audiences for an ad account.
+ operationId: GetCustomAudiences
+ parameters:
+ - name: ad_account_id
+ in: path
+ description: The ID of the ad account.
+ required: true
+ schema:
+ type: string
+ - name: fields
+ in: query
+ description: Comma-separated list of fields to retrieve for each custom audience.
+ schema:
+ type: string
+ responses:
+ 200:
+ description: Success
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CustomAudienceList'
+ post:
+ tags:
+ - "CustomAudience"
+ description: Creates a new custom audience under the specified ad account.
+ operationId: CreateCustomAudience
+ parameters:
+ - name: ad_account_id
+ in: path
+ description: The ID of the ad account.
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CustomAudienceCreate'
+ responses:
+ 201:
+ description: Custom Audience created successfully.
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CustomAudienceResponse'
/act_{ad_account_id}/campaigns:
get:
tags:
@@ -684,6 +735,66 @@ components:
$ref: '#/components/schemas/Paging'
summary:
$ref: '#/components/schemas/ListSummary'
+ CustomAudienceCreate:
+ type: object
+ properties:
+ name:
+ type: string
+ description: Name of the custom audience.
+ description:
+ type: string
+ description: Description of the custom audience.
+ subtype:
+ type: string
+ enum:
+ - CUSTOM
+ - WEBSITE
+ - APP
+ - OFFLINE_CONVERSION
+ description: The type of custom audience being created.
+ retention_days:
+ type: integer
+ description: The number of days to retain audience members.
+ rule:
+ type: string
+ description: A rule that defines this custom audience.
+
+ CustomAudienceResponse:
+ type: object
+ properties:
+ id:
+ type: string
+ description: ID of the newly created custom audience.
+ name:
+ type: string
+ description: Name of the custom audience.
+ description:
+ type: string
+ description: Description of the custom audience.
+ success:
+ type: boolean
+ description: Operation status.
+ CustomAudienceList:
+ type: object
+ properties:
+ data:
+ type: array
+ items:
+ $ref: '#/components/schemas/CustomAudience'
+ paging:
+ $ref: '#/components/schemas/Paging'
+ CustomAudience:
+ type: object
+ properties:
+ id:
+ type: string
+ description: ID of the custom audience.
+ name:
+ type: string
+ description: Name of the custom audience.
+ description:
+ type: string
+ description: Description of the custom audience.
Paging:
type: object
properties:
diff --git a/src/main/resources/functions/component.xml b/src/main/resources/functions/component.xml
index a017337..328d3c6 100644
--- a/src/main/resources/functions/component.xml
+++ b/src/main/resources/functions/component.xml
@@ -81,5 +81,13 @@
updateCampaign.xml
Updates a campaign.
+
+ createCustomAudience.xml
+ Creates a new custom audience under the specified ad account.
+
+
+ getCustomAudiences.xml
+ Retrieves custom audiences for an ad account.
+
diff --git a/src/main/resources/functions/createCustomAudience.xml b/src/main/resources/functions/createCustomAudience.xml
new file mode 100644
index 0000000..a89aaaa
--- /dev/null
+++ b/src/main/resources/functions/createCustomAudience.xml
@@ -0,0 +1,76 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ "name": "${args.arg1}", #if>
+ <#if (args.arg2)?has_content>
+ "description": "${args.arg2}", #if>
+ <#if (args.arg3)?has_content>
+ "subtype": "${args.arg3}", #if>
+ <#if (args.arg4)?has_content>
+ "retention_days": "${args.arg4}", #if>
+ <#if (args.arg5)?has_content>
+ "rule": "${args.arg5}" #if>
+ }]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/functions/getCustomAudiences.xml b/src/main/resources/functions/getCustomAudiences.xml
new file mode 100644
index 0000000..e011afd
--- /dev/null
+++ b/src/main/resources/functions/getCustomAudiences.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/uischema/createCustomAudience.json b/src/main/resources/uischema/createCustomAudience.json
new file mode 100644
index 0000000..4f40f60
--- /dev/null
+++ b/src/main/resources/uischema/createCustomAudience.json
@@ -0,0 +1,132 @@
+{
+ "connectorName": "facebookAds",
+ "operationName": "createCustomAudience",
+ "title": "Create Custom Audience",
+ "help": "Creates a new custom audience under the specified ad account.",
+ "elements": [
+ {
+ "type": "attributeGroup",
+ "value": {
+ "groupName": "General",
+ "elements": [
+ {
+ "type": "attribute",
+ "value": {
+ "name": "configRef",
+ "displayName": "Connection",
+ "inputType": "connection",
+ "allowedConnectionTypes": [
+ "facebookAds"
+ ],
+ "defaultType": "connection.facebookAds",
+ "defaultValue": "",
+ "required": "true",
+ "helpTip": "Connection to be used."
+ }
+ },
+ {
+ "type": "attributeGroup",
+ "value": {
+ "groupName": "Search",
+ "elements": [
+ {
+ "type": "attribute",
+ "value": {
+ "name": "search",
+ "displayName": "Search",
+ "inputType": "searchBox",
+ "defaultValue": "",
+ "required": "false",
+ "helpTip": "Search for an attribute using the display name"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "type": "attributeGroup",
+ "value": {
+ "groupName": "Parameters",
+ "elements": [
+ {
+ "type": "attribute",
+ "value": {
+ "name": "adAccountId",
+ "displayName": "Ad Account Id",
+ "inputType": "stringOrExpression",
+ "defaultValue": "",
+ "required": "true",
+ "helpTip": "The ID of the ad account."
+ }
+ }
+ ]
+ }
+ },
+ {
+ "type": "attributeGroup",
+ "value": {
+ "groupName": "Request Body",
+ "elements": [
+ {
+ "type": "attribute",
+ "value": {
+ "name": "name",
+ "displayName": "Name",
+ "inputType": "stringOrExpression",
+ "defaultValue": "",
+ "required": "false",
+ "helpTip": "Name of the custom audience. Type: string"
+ }
+ },
+ {
+ "type": "attribute",
+ "value": {
+ "name": "description",
+ "displayName": "Description",
+ "inputType": "stringOrExpression",
+ "defaultValue": "",
+ "required": "false",
+ "helpTip": "Description of the custom audience. Type: string"
+ }
+ },
+ {
+ "type": "attribute",
+ "value": {
+ "name": "subtype",
+ "displayName": "Subtype",
+ "inputType": "stringOrExpression",
+ "defaultValue": "",
+ "required": "false",
+ "helpTip": "The type of custom audience being created. Type: string"
+ }
+ },
+ {
+ "type": "attribute",
+ "value": {
+ "name": "retentionDays",
+ "displayName": "Retention Days",
+ "inputType": "stringOrExpression",
+ "defaultValue": "",
+ "required": "false",
+ "helpTip": "The number of days to retain audience members. Type: integer"
+ }
+ },
+ {
+ "type": "attribute",
+ "value": {
+ "name": "rule",
+ "displayName": "Rule",
+ "inputType": "stringOrExpression",
+ "defaultValue": "",
+ "required": "false",
+ "helpTip": "A rule that defines this custom audience. Type: string"
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+}
diff --git a/src/main/resources/uischema/getCustomAudiences.json b/src/main/resources/uischema/getCustomAudiences.json
new file mode 100644
index 0000000..b8fd7d8
--- /dev/null
+++ b/src/main/resources/uischema/getCustomAudiences.json
@@ -0,0 +1,80 @@
+{
+ "connectorName": "facebookAds",
+ "operationName": "getCustomAudiences",
+ "title": "Get Custom Audiences",
+ "help": "Retrieves custom audiences for an ad account.",
+ "elements": [
+ {
+ "type": "attributeGroup",
+ "value": {
+ "groupName": "General",
+ "elements": [
+ {
+ "type": "attribute",
+ "value": {
+ "name": "configRef",
+ "displayName": "Connection",
+ "inputType": "connection",
+ "allowedConnectionTypes": [
+ "facebookAds"
+ ],
+ "defaultType": "connection.facebookAds",
+ "defaultValue": "",
+ "required": "true",
+ "helpTip": "Connection to be used"
+ }
+ },
+ {
+ "type": "attributeGroup",
+ "value": {
+ "groupName": "Search",
+ "elements": [
+ {
+ "type": "attribute",
+ "value": {
+ "name": "search",
+ "displayName": "Search",
+ "inputType": "searchBox",
+ "defaultValue": "",
+ "required": "false",
+ "helpTip": "Search for an attribute using the display name"
+ }
+ }
+ ]
+ }
+ },
+ {
+ "type": "attributeGroup",
+ "value": {
+ "groupName": "Parameters",
+ "elements": [
+ {
+ "type": "attribute",
+ "value": {
+ "name": "adAccountId",
+ "displayName": "Ad Account Id",
+ "inputType": "stringOrExpression",
+ "defaultValue": "",
+ "required": "true",
+ "helpTip": "The ID of the ad account."
+ }
+ },
+ {
+ "type": "attribute",
+ "value": {
+ "name": "fields",
+ "displayName": "Fields",
+ "inputType": "stringOrExpression",
+ "defaultValue": "",
+ "required": "false",
+ "helpTip": "Comma-separated list of fields to retrieve for each custom audience."
+ }
+ }
+ ]
+ }
+ }
+ ]
+ }
+ }
+ ]
+}