Skip to content

[FEATURE] Facebook Pages - Migrate to Marketing API v23.0 #17701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import crypto from "crypto";
export default {
key: "facebook_marketing-add-email-to-custom-audience",
name: "Add Email to Custom Audience",
description: "Adds an email address to a custom audience segment within Facebook. [See the documentation](https://developers.facebook.com/docs/marketing-api/reference/custom-audience/users/#Updating)",
version: "0.0.1",
description: "Adds an email address to a custom audience segment within Facebook. [See the documentation](https://developers.facebook.com/docs/marketing-api/reference/custom-audience/users/?locale=en_US#Updating)",
version: "0.0.2",
type: "action",
props: {
app,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import app from "../../facebook_marketing.app.mjs";
export default {
key: "facebook_marketing-create-custom-audience",
name: "Create Custom Audience",
description: "Creates a new custom audience in Facebook. [See the documentation](https://developers.facebook.com/docs/marketing-api/audiences/guides/custom-audiences/#build)",
version: "0.0.1",
description: "Creates a new custom audience in Facebook. [See the documentation](https://developers.facebook.com/docs/marketing-api/audiences/guides/custom-audiences/?locale=en_US#build)",
version: "0.0.2",
type: "action",
props: {
app,
Expand Down
17 changes: 8 additions & 9 deletions components/facebook_marketing/facebook_marketing.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,21 @@ export default {
},
},
methods: {
_apiVersion() {
return "v19.0";
},
_baseUrl() {
return `https://graph.facebook.com/${this._apiVersion()}`;
return "https://graph.facebook.com";
},
Comment on lines 59 to +61
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify API versioning strategy for v23.0 migration.

The removal of dynamic API versioning from the base URL is a significant change. Ensure that the Facebook Marketing API v23.0 is properly specified elsewhere or that the default version aligns with the migration objective.


🏁 Script executed:

#!/bin/bash
# Check how API versioning is handled across the component

echo "=== Checking for API version references ==="
rg -A 3 -B 3 "v[0-9]+\." components/facebook_marketing/

echo "=== Checking API endpoint patterns ==="
rg -A 5 "graph\.facebook\.com" components/facebook_marketing/

echo "=== Checking for version-specific API calls ==="
ast-grep --pattern '$_/v$_/$_'

Length of output: 942


Enforce explicit Facebook API version (v23.0) in requests

I didn’t find any references to an API version in the codebase—calls will go to the default “graph.facebook.com” endpoint, which may break when Facebook deprecates older defaults.

• In components/facebook_marketing/facebook_marketing.app.mjs, update _baseUrl() to include /v23.0 (e.g. return "https://graph.facebook.com/v23.0").
• Or prepend /v23.0 to each request path in _makeRequest.
• Verify all endpoints now target v23.0 to align with the migration goal.

🤖 Prompt for AI Agents
In components/facebook_marketing/facebook_marketing.app.mjs around lines 59 to
61, the _baseUrl method returns the Facebook API base URL without specifying an
explicit API version, which risks breaking when defaults change. Update the
_baseUrl method to return "https://graph.facebook.com/v23.0" to enforce using
version v23.0 of the API consistently across all requests. Verify that all
request paths use this updated base URL to ensure alignment with the migration
goal.

_headers() {
return {
Authorization: `Bearer ${this.$auth.oauth_access_token}`,
};
},
async _makeRequest({
$ = this, path, headers, ...otherOpts
$ = this, path, ...otherOpts
}) {
return axios($, {
...otherOpts,
url: this._baseUrl() + path,
headers: {
...headers,
Authorization: `Bearer ${this.$auth.oauth_access_token}`,
},
headers: this._headers(),
});
},
async getAuthenticatedUserInfo() {
Expand Down
4 changes: 2 additions & 2 deletions components/facebook_marketing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/facebook_marketing",
"version": "0.1.0",
"version": "0.1.1",
"description": "Pipedream Facebook Custom Audiences Components",
"main": "facebook_marketing.app.mjs",
"keywords": [
Expand All @@ -13,6 +13,6 @@
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^1.6.0"
"@pipedream/platform": "^3.1.0"
}
}
13 changes: 0 additions & 13 deletions components/facebook_pages/app/facebook_pages.app.ts

This file was deleted.

2 changes: 1 addition & 1 deletion components/facebook_pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^1.5.1"
"@pipedream/platform": "^3.1.0"
}
}
11 changes: 5 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading