Meta Ads Virtual Assistant

Meta Ads Virtual Assistant · GPT-Aktionen

Adease

Connecting OpenAI to Facebook Ads

  • GET /megetUserInfo
  • GET /searchsearchAdsInterest
  • POST /act_{AdAccountID}/campaignsCreate Campaign

    Creates a new campaign in the user's ad account.

  • POST /act_{AdAccountID}/adsetsCreate Ad Sets

    Creates new ad sets in a campaign.

  • GET /act_{AdAccountID}/adsGet Ads

    Retrieves the ads in an Ad Account, given the AdAccountID.

  • GET /act_{AdAccountID}/insightsgetAccountInsights
  • GET /{CampaignID}/insightsgetCampaignInsights
  • GET /{AdSetID}/insightsgetAdsetInsights
  • GET /{AdID}/insightsgetAdInsights
Ursprüngliches API-Schema
{
  "openapi": "3.1.0",
  "info": {
    "title": "Adease",
    "version": "1.0",
    "description": "Connecting OpenAI to Facebook Ads",
    "termsOfService": "https://adease.io/terms_of_service",
    "contact": {
      "email": "admin@adease.io"
    },
    "license": {
      "name": "API License",
      "url": "https://adease.io/privacy_policy"
    }
  },
  "servers": [
    {
      "url": "https://graph.facebook.com/v17.0"
    }
  ],
  "paths": {
    "/me": {
      "get": {
        "operationId": "getUserInfo",
        "parameters": [
          {
            "name": "fields",
            "in": "query",
            "required": true,
            "description": "Fields to be returned in the response",
            "schema": {
              "type": "string",
              "default": "id,name,picture{url},accounts{name,id,picture},adaccounts{account_id,name,business_name,account_status,amount_spent,currency}"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "picture": {
                      "type": "object",
                      "properties": {
                        "url": {
                          "type": "string"
                        }
                      }
                    },
                    "accounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "picture": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "adaccounts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "account_id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "business_name": {
                            "type": "string"
                          },
                          "account_status": {
                            "type": "integer"
                          },
                          "amount_spent": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/search": {
      "get": {
        "operationId": "searchAdsInterest",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "description": "Search query",
            "schema": {
              "type": "string",
              "example": "Digital Marketing"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": true,
            "description": "Limit for the number of results",
            "schema": {
              "type": "integer",
              "default": 10000
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": true,
            "description": "Type of the search",
            "schema": {
              "type": "string",
              "default": "adinterest"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": true,
            "description": "Locale setting",
            "schema": {
              "type": "string",
              "default": "en_US"
            }
          }
        ]
      }
    },
    "/act_{AdAccountID}/campaigns": {
      "post": {
        "summary": "Create Campaign",
        "description": "Creates a new campaign in the user's ad account.",
        "operationId": "createCampaign",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "objective": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string"
                  },
                  "special_ad_categories": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "buying_type": {
                    "type": "string"
                  },
                  "access_token": {
                    "type": "string"
                  }
                },
                "example": {
                  "name": "GPT Campaign",
                  "objective": "OUTCOME_SALES",
                  "status": "PAUSED",
                  "special_ad_categories": [],
                  "buying_type": "AUCTION",
                  "access_token": "YOUR_ACCESS_TOKEN"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Campaign created successfully"
          }
        }
      }
    },
    "/act_{AdAccountID}/adsets": {
      "post": {
        "summary": "Create Ad Sets",
        "description": "Creates new ad sets in a campaign.",
        "operationId": "createAdSets",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "campaign_id": {
                    "type": "string"
                  },
                  "daily_budget": {
                    "type": "string"
                  },
                  "billing_event": {
                    "type": "string"
                  },
                  "bid_amount": {
                    "type": "string"
                  },
                  "optimization_goal": {
                    "type": "string"
                  },
                  "targeting": {
                    "type": "object",
                    "properties": {
                      "geo_locations": {
                        "type": "object",
                        "properties": {
                          "countries": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      },
                      "interests": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            },
                            "name": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  },
                  "status": {
                    "type": "string"
                  },
                  "access_token": {
                    "type": "string"
                  }
                },
                "example": {
                  "name": "Adset Targeting Apple",
                  "campaign_id": "YOUR_CAMPAIGN_ID",
                  "daily_budget": "1000",
                  "billing_event": "IMPRESSIONS",
                  "bid_amount": "20",
                  "optimization_goal": "REACH",
                  "targeting": {
                    "geo_locations": {
                      "countries": [
                        "US"
                      ]
                    },
                    "interests": [
                      {
                        "id": "6003332346662",
                        "name": "Apple"
                      }
                    ]
                  },
                  "status": "PAUSED",
                  "access_token": "YOUR_ACCESS_TOKEN"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ad sets created successfully"
          }
        }
      }
    },
    "/act_{AdAccountID}/ads": {
      "get": {
        "summary": "Get Ads",
        "description": "Retrieves the ads in an Ad Account, given the AdAccountID.",
        "operationId": "getAccountAds",
        "parameters": [
          {
            "name": "fields",
            "in": "query",
            "description": "Fields to be returned in the response",
            "required": true,
            "schema": {
              "type": "string",
              "example": "name,effective_status"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "effective_status": {
                            "type": "string"
                          },
                          "objective": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/act_{AdAccountID}/insights": {
      "get": {
        "operationId": "getAccountInsights",
        "parameters": [
          {
            "name": "fields",
            "in": "query",
            "required": true,
            "description": "Metrics fields to be returned",
            "schema": {
              "type": "string",
              "default": "spend,reach,impressions,cpm,ctr,clicks,actions,action_values"
            }
          },
          {
            "name": "date_preset",
            "in": "query",
            "description": "Preset date range for the data",
            "schema": {
              "type": "string",
              "enum": [
                "today",
                "yesterday",
                "this_month",
                "last_month",
                "this_quarter",
                "maximum",
                "data_maximum",
                "last_3d",
                "last_7d",
                "last_14d",
                "last_28d",
                "last_30d",
                "last_90d",
                "last_week_mon_sun",
                "last_week_sun_sat",
                "last_quarter",
                "last_year",
                "this_week_mon_today",
                "this_week_sun_today",
                "this_year"
              ]
            }
          },
          {
            "name": "time_range[since]",
            "in": "query",
            "description": "Start date for the time range",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2021-01-01"
            }
          },
          {
            "name": "time_range[until]",
            "in": "query",
            "description": "End date for the time range",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2023-08-28"
            }
          }
        ],
        "headers": [
          {
            "name": "AdAccountID",
            "required": true,
            "description": "The ID of the ad account",
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/{CampaignID}/insights": {
      "get": {
        "operationId": "getCampaignInsights",
        "parameters": [
          {
            "name": "CampaignID",
            "in": "path",
            "required": true,
            "description": "Returns the campaigns in an Ad account given an ad account ID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "required": true,
            "description": "Metrics fields to be returned",
            "schema": {
              "type": "string",
              "default": "spend,reach,impressions,cpm,ctr,clicks,actions,action_values"
            }
          },
          {
            "name": "date_preset",
            "in": "query",
            "description": "Preset date range for the data",
            "schema": {
              "type": "string",
              "enum": [
                "today",
                "yesterday",
                "this_month",
                "last_month",
                "this_quarter",
                "maximum",
                "data_maximum",
                "last_3d",
                "last_7d",
                "last_14d",
                "last_28d",
                "last_30d",
                "last_90d",
                "last_week_mon_sun",
                "last_week_sun_sat",
                "last_quarter",
                "last_year",
                "this_week_mon_today",
                "this_week_sun_today",
                "this_year"
              ]
            }
          },
          {
            "name": "time_range[since]",
            "in": "query",
            "description": "Start date for the time range",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2021-01-01"
            }
          },
          {
            "name": "time_range[until]",
            "in": "query",
            "description": "End date for the time range",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2023-08-28"
            }
          }
        ]
      }
    },
    "/{AdSetID}/insights": {
      "get": {
        "operationId": "getAdsetInsights",
        "parameters": [
          {
            "name": "AdSetID",
            "in": "path",
            "required": true,
            "description": "Returns insights from an Adset given an AdSetID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "required": true,
            "description": "Metrics fields to be returned",
            "schema": {
              "type": "string",
              "fields": "spend,clicks,ctr"
            }
          },
          {
            "name": "date_preset",
            "in": "query",
            "description": "Preset date range for the data",
            "schema": {
              "type": "string",
              "enum": [
                "today",
                "yesterday",
                "this_month",
                "last_month",
                "this_quarter",
                "maximum",
                "data_maximum",
                "last_3d",
                "last_7d",
                "last_14d",
                "last_28d",
                "last_30d",
                "last_90d",
                "last_week_mon_sun",
                "last_week_sun_sat",
                "last_quarter",
                "last_year",
                "this_week_mon_today",
                "this_week_sun_today",
                "this_year"
              ]
            }
          },
          {
            "name": "time_range[since]",
            "in": "query",
            "description": "Start date for the time range",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2021-01-01"
            }
          },
          {
            "name": "time_range[until]",
            "in": "query",
            "description": "End date for the time range",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2023-08-28"
            }
          }
        ]
      }
    },
    "/{AdID}/insights": {
      "get": {
        "operationId": "getAdInsights",
        "parameters": [
          {
            "name": "AdID",
            "in": "path",
            "required": true,
            "description": "Returns the performance insights for a specific ad, given an AdID",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "fields",
            "in": "query",
            "required": true,
            "description": "Metrics fields to be returned",
            "schema": {
              "type": "string",
              "default": "spend,reach,impressions,cpm,ctr,clicks,actions,action_values"
            }
          },
          {
            "name": "time_range[2019-01-01]",
            "in": "query",
            "description": "Start date for the time range",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2021-01-01"
            }
          },
          {
            "name": "time_range[2023-11-10]",
            "in": "query",
            "description": "End date for the time range",
            "schema": {
              "type": "string",
              "format": "date",
              "example": "2023-08-28"
            }
          }
        ]
      }
    }
  }
}