Skip to content
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

Sending wrong params when creating campaign #255

Open
pelly-ryu opened this issue Jul 15, 2023 · 0 comments
Open

Sending wrong params when creating campaign #255

pelly-ryu opened this issue Jul 15, 2023 · 0 comments

Comments

@pelly-ryu
Copy link

Which SDK version are you using?

17.0.1

What's the issue?

(I think this is a known issue for contributors, because it is a general behaviour of AbstractCrudObject, but couldn't find an existing issue)

  • in my case:
    • when await user.getAdAccounts(["id", "name"]) -> await adAccount.createCampaign(["id"], { name: campaignName, ... }) , it loses the name param and sends a request with { name: adAccountName, ... } not {name: campignName}.
  • in repo:
    • in createEdge(), params are overwritten with a wrong value by params = Object.assign(params, this.exportData());

Steps/Sample code to reproduce the issue

const user = new User("me");
const adAccounts = await user.getAdAccounts(["id", "name"]);
adAccounts[0].createCampaign(["id"], {
  objective: "OUTCOME_LEADS",
  special_ad_categories: [],
  name: "Campaign Name",
  bid_strategy: "LOWEST_COST_WITHOUT_CAP",
  buying_type: "AUCTION",
  status: "ACTIVE",
  spend_cap: 10000000,
  daily_budget: 5000,
}

Observed Results:

200 POST https://graph.facebook.com/v17.0/act_<acct id>/campaigns?access_token=<token> {"objective":"OUTCOME_LEADS","special_ad_categories":[],"name":"Simba Ryu","bid_strategy":"LOWEST_COST_WITHOUT_CAP","buying_type":"AUCTION","status":"ACTIVE","spend_cap":10000000,"daily_budget":5000,"fields":"id","id":"act_<acct id>"}

Expected Results:

200 POST https://graph.facebook.com/v17.0/act_<acct id>/campaigns?access_token=<token> {"objective":"OUTCOME_LEADS","special_ad_categories":[],"name":"Campaign Name","bid_strategy":"LOWEST_COST_WITHOUT_CAP","buying_type":"AUCTION","status":"ACTIVE","spend_cap":10000000,"daily_budget":5000,"fields":"id","id":"act_<acct id>"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant